Skip to content

Support running in namespaced mode #310

Open
@alexymantha

Description

@alexymantha

By default, the manager runs with cluster scope and required cluster-scoped access to secrets. Changing the ClusterRole(Binding) to their namespaced equivalent will result in:

E0509 15:21:40.162416       1 reflector.go:166] "Unhandled Error" err="pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:251: Failed to watch *v1.Secret: failed to list *v1.Secret: secrets is forbidden: User \"system:serviceaccount:argocd-dois:argocd-promoter-controller-manager\" cannot list resource \"secrets\" in API group \"\" at the cluster scope" logger="UnhandledError"

In our environment, I am not allowed to deploy a ClusterRole that can list all secrets. Instead, namespace owners need to opt-in by creating a namespaced role in their namespace with a binding to allow us to read the secrets. This means that I need to be able to specifically target the namespaces that should be watched.

Proposal

  1. Support running the manager in namespaced mode, where a list of namespaces that should be watched can be provided. For example, a --watch-namespaces flag.
  2. Provide a namespaced version of https://github.com/argoproj-labs/gitops-promoter/blob/main/dist/install.yaml that installs the promoter in namespaced mode and replaces the ClusterRoles and ClusterRoleBindings with their Role and RoleBinding equivalents.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions