Skip to content

Better support multi-namespace & single-namespace deployments #2525

Open

Description

@clook

Is your feature request related to a problem? Please describe.
I'm not owner of the cluster and have limited permissions at cluster scope level.
Currently, I am able to run cert-manager with reduced permissions at cluster scope level as well as --namespace option, to prevent launching the clusterIssuer controller.
But then, I'm limited to a single namespace. It seems there is no option to process multiple namespaces without some cluster permissions.

Describe the solution you'd like
Be able to give a list of namespaces, either explicit or implicit (ie all namespaces but ..., or regexp).

My cluster provider or myself could initiate a PR for supporting it but we would be sure to agree on the design with Jetstack team ;)

Describe alternatives you've considered
Using clusterIssuer is not possible and not a good alternative since it would allow us to get some permissions on namespaces (like kube-system) we should not have
Alternative considered is to launch one instance of cert-manager per namespace, but this is weird :(

Additional context
Some links about multiple namespaces support on controllers:
https://github.com/kubernetes/client-go/issues/580
kubernetes/ingress-nginx#732 (comment)
kubernetes/ingress-nginx#1225

Some links about kind of implementation on other controllers:
traefik/traefik#1895
https://github.com/coreos/prometheus-operator/blob/master/pkg/prometheus/operator.go#L254

Environment details (if applicable):

  • Kubernetes version (e.g. v1.10.2): v1.16.3 (Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.3", GitCommit:"b3cbbae08ec52a7fc73d334838e18d17e8512749", GitTreeState:"clean", BuildDate:"2019-11-13T11:13:49Z", GoVersion:"go1.12.12", Compiler:"gc", Platform:"linux/amd64"})
  • Cloud-provider/provisioner: Rancher
  • cert-manager version (e.g. v0.4.0): master
  • Install method (e.g. helm or static manifests): patched Helm chart from master. I would be happy to provide it if requested.

/kind feature

Activity

  1. added
    kind/feature
    on Jan 17, 2020
  2. clook commented on Jan 21, 2020

    @clook
    Author

    Seems related to #3

  3. retest-bot commented on Apr 20, 2020

    @retest-bot

    Issues go stale after 90d of inactivity.
    Mark the issue as fresh with /remove-lifecycle stale.
    Stale issues rot after an additional 30d of inactivity and eventually close.
    If this issue is safe to close now please do so with /close.
    Send feedback to jetstack.
    /lifecycle stale

  4. added
    lifecycle/stale
    on Apr 20, 2020
  5. lindhe commented on Apr 21, 2020

    @lindhe

    I'd still be interested in this. Any chances?

  6. munnerz commented on Apr 24, 2020

    @munnerz
    Member

    This isn't something trivial for us to support right now as Kubernetes informers don't support watching multiple namespaces, only a single one or none.

    For now, I'd recommend running a cert-manager per namespace if you need to. You will need to make a few changes yourself though, and it's not super easy:

    1. Deploy the CRD/apiserver related cert-manager components (without deploying the controller):
    • cainjector
    • webhook
    • CRDs
    • ValidatingWebhookConfiguration & MutatingWebhookConfiguration resource
    1. Deploy just the controller into each namespace, with the --namespace flag set and the ClusterIssuer controller disabled. You'll also need to change the leader election namespace to make this work too.

    It'd be great if this deployment model were easier to manage, however it does also require more coordination during upgrades too. You'll need to ensure you update the CRDs, webhook, cainjector and webhook configuration resources before updating the controllers.

    We have a similar requirement for this to improve the recently introduced cert-manager operator lifecycle manager integration too, if we ever want to support modes other than AllNamespaces.

    /cc @meyskens
    /area deploy
    /priority important-longterm
    /remove-lifecycle stale

  7. added
    area/deploy
    priority/important-longterm
    and removed
    lifecycle/stale
    on Apr 24, 2020
  8. changed the title [-]Support multiple namespaces without clusterIssuer[/-] [+]Better support multi-namespace & single-namespace deployments[/+] on Apr 24, 2020
  9. vijaykatam commented on Jul 2, 2020

    @vijaykatam

    @munnerz - I tried the approach you suggested to deploy controller(and associated service account) into specific namespace but it looks like the webhook depends on a secret being created by the controller. Is that expected? I am trying this on v0.11.x so don't know if this is supported on that version.

     MountVolume.SetUp failed for volume "certs" : secret "cert-manager-webhook-tls" not found
    
  10. vijaykatam commented on Jul 3, 2020

    @vijaykatam

    I verified scoping controller to single namespace works in 0.15.1

  11. Lirt commented on Jul 16, 2020

    @Lirt

    If you install into different namespace than cert-manager and install CRDs manually, check my comment #2920 (comment)

  12. DashrathMundkar commented on May 5, 2021

    @DashrathMundkar

    Hi @vijaykatam did you deployed the controller in separate namespace and rest of the other component in cert-manager namespace right? and also have you deployed all these WITHOUT clusterRole scope?

  13. wallrj commented on Aug 13, 2021

    @wallrj
    Member

    Linkerd Multi-Stage Install documentation describes the rationale for wanting users to be able to install the controllers in the namespace scope.

  14. 57 remaining items

  15. removed
    lifecycle/stale
    on Aug 14, 2024
  16. modified the milestones: 1.16, 1.17 on Oct 3, 2024
  17. cert-manager-bot commented on Jan 1, 2025

    @cert-manager-bot
    Contributor

    Issues go stale after 90d of inactivity.
    Mark the issue as fresh with /remove-lifecycle stale.
    Stale issues rot after an additional 30d of inactivity and eventually close.
    If this issue is safe to close now please do so with /close.
    /lifecycle stale

  18. added
    lifecycle/stale
    on Jan 1, 2025
  19. jkroepke commented on Jan 1, 2025

    @jkroepke
    Contributor

    /remove-lifecycle stale

  20. removed
    lifecycle/stale
    on Jan 1, 2025
  21. modified the milestones: 1.17, 1.18 on Jan 28, 2025
  22. cert-manager-bot commented on Apr 28, 2025

    @cert-manager-bot
    Contributor

    Issues go stale after 90d of inactivity.
    Mark the issue as fresh with /remove-lifecycle stale.
    Stale issues rot after an additional 30d of inactivity and eventually close.
    If this issue is safe to close now please do so with /close.
    /lifecycle stale

  23. added
    lifecycle/stale
    on Apr 28, 2025
  24. sarahkadar commented on Apr 28, 2025

    @sarahkadar

    /remove-lifecycle stale

  25. removed
    lifecycle/stale
    on Apr 28, 2025
  26. jkroepke commented on Apr 28, 2025

    @jkroepke
    Contributor

    /lifecycle frozen

  27. added
    lifecycle/frozen
    on Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/deploykind/featurelifecycle/frozenpriority/important-longterm

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions