Skip to content

Lookup namespace and bound manager to it

Hossein Pursultani requested to merge 1190-namespaced-watch into master

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.

Closes https://gitlab.com/charts/gitlab/issues/1190

Edited by Robert Marshall

Merge request reports