Skip to content

[Feature]: CNPG operator should not crash when nodes & clusterimagecatalog resource access not permitted #9346

Closed as not planned

Description

@maxlengdell

Is there an existing issue already for this feature request/idea?

  • I have searched for an existing issue, and could not find anything. I believe this is a new feature request to be evaluated.

What problem is this feature going to solve? Why should it be added?

CNPG currently requires cluster-wide permissions to access Node and ClusterImageCatalog resources. This creates a security concern for hardened Kubernetes environments where RBAC should follow the principle of least privilege. Removing these permissions causes the operator to fail at startup.

Describe the solution you'd like

Two independent environment variables to control cluster-wide object access:

  • WATCH_NODES (default: true) - Enable/disable Node resource access
  • WATCH_CLUSTER_IMAGE_CATALOGS (default: true) - Enable/disable ClusterImageCatalog resource access

When disabled, the operator:

  1. Does not attempt to list or watch the corresponding cluster-wide resources
  2. Allows the corresponding ClusterRole permissions to be removed by deployment tools (Helm, ArgoCD, FluxCD, etc.)
  3. Continues to function normally for namespace-scoped resources

Similar deployment parameters exist in other open source projects. For example CN Cert Manager which implemented this: cert-manager/cert-manager#7678

Describe alternatives you've considered

Removing the ClusterRoles for the relevant cluster resources results in CNPG Operator to fail startup.
"failed to list *v1.Node: nodes is forbidden: User \"system:serviceaccount:cnpg-system:cnpg-manager\" cannot list resource \"nodes\" in API group \"\" at the cluster scope"

Additional context

No response

Backport?

No

Are you willing to actively contribute to this feature?

Yes

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added
    triage
    on Dec 2, 2025
  2. 23 remaining items

  3. changed the title [-][Feature]: CNPG to support namespaced deployment[/-] [+][Feature]: CNPG operator should not crash when nodes & clusterimagecatalog resource not allowed[/+] on Mar 5, 2026
  4. changed the title [-][Feature]: CNPG operator should not crash when nodes & clusterimagecatalog resource not allowed[/-] [+][Feature]: CNPG operator should not crash when nodes & clusterimagecatalog resource access not permitted[/+] on Mar 5, 2026
  5. dosubot commented on Jun 5, 2026

    @dosubot

    Hi, @maxlengdell. I'm Dosu, and I'm helping the cloudnative-pg team manage their backlog and am marking this issue as stale.

    Issue Summary

    • You opened this issue to request that the CNPG operator not crash when it lacks cluster-wide RBAC for Node and ClusterImageCatalog resources.
    • The proposed direction was to add opt-in/opt-out environment variables like WATCH_NODES and WATCH_CLUSTER_IMAGE_CATALOGS so those watches can be disabled while preserving namespace-scoped functionality.
    • The only recent automated follow-up was a stale bot comment after 60 days of inactivity.
    • There was later interest from @armando1988, which suggests the feature is still relevant to some users.

    Next Steps

    • Please let us know if this is still relevant with the latest version of cloudnative-pg.
    • If it is, you can keep the discussion open by commenting here; otherwise, this issue will be automatically closed in 7 days.

    Thanks for your understanding and contribution.

  6. added
    enhancement 🪄
    and removed
    triage
    on Jun 23, 2026
  7. github-actions commented on Sep 8, 2026

    @github-actions
    Contributor

    This issue is stale because it has been open for 60 days with no activity.

  8. github-actions commented on Sep 30, 2026

    @github-actions
    Contributor

    This issue was closed because it has been inactive for 14 days since being marked as stale.

  9. BlaiseAntony commented on Nov 16, 2026

    @BlaiseAntony
    Contributor

    Hi, I'm still interested in seeing this feature implemented. Are there any plans to include it in an upcoming release? Happy to contribute if needed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Staleenhancement 🪄

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions