Lookup namespace and bound manager to it
This MR configures the Manager to work with a specific namespace. This will remove the need for cluster level roles.
It also introduces a function to automatically lookup the namespace. It first attempts to use POD_NAMESPACE
environment variable which can be set in operator Deployment:
env:
- name: API_SUBGROUP
value: {{ .Release.Name }}
- name: POD_NAMESPACE
valueFrom:
fieldPath: metadata.namespace
If it is not specified, it will try to retrieve it from in-cluster configuration, namely /var/run/secrets/kubernetes.io/serviceaccount/namespace
.
Edited by Robert Marshall