Skip to content

(helm/v2-alpha): disable cluster wide rbac resource creation#5505

Open
Allex1 wants to merge 1 commit intokubernetes-sigs:masterfrom
Allex1:rbac-cluster-scope-toggle
Open

(helm/v2-alpha): disable cluster wide rbac resource creation#5505
Allex1 wants to merge 1 commit intokubernetes-sigs:masterfrom
Allex1:rbac-cluster-scope-toggle

Conversation

@Allex1
Copy link

@Allex1 Allex1 commented Feb 25, 2026

Addresses #5504

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Allex1
Once this PR has been reviewed and has the lgtm label, please assign camilamacedo86 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 25, 2026
@k8s-ci-robot
Copy link
Contributor

Welcome @Allex1!

It looks like this is your first PR to kubernetes-sigs/kubebuilder 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/kubebuilder has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

Hi @Allex1. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 25, 2026
@Allex1 Allex1 force-pushed the rbac-cluster-scope-toggle branch from 791f3d7 to b667c2c Compare February 25, 2026 09:35
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 25, 2026
@Allex1 Allex1 force-pushed the rbac-cluster-scope-toggle branch from b667c2c to 499e20c Compare February 25, 2026 09:40
# should be restricted to a single namespace or when cluster-wide
# permissions are managed externally.
enabled: true

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have either :

## Helper RBAC roles for managing custom resources
##
rbacHelpers:
  # Install convenience admin/editor/viewer roles for CRDs
  enable: false

So, should we have rbac:
Then, insde helpers and default for example instead?

How that would work when the solution is scaffold with the namespaced flag and the RBAC are not cluster scopes? How the Helm Chart would be in this case?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@camilamacedo86 I could reuse the rbacHelpers.enabled for the main clusterrole/crb if that's what you're asking. The problem right now is that you can only generate helm charts only for cluster admins.

Copy link
Member

@camilamacedo86 camilamacedo86 Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see I am think in a way to make it generic enough and address this need.
Could you give me 1 to 2 weeks? I will push that and you can help us to know if that is a good approach. Your collab is very required and welcome btw.

# Set to false to skip cluster-scoped RBAC, useful when the operator
# should be restricted to a single namespace or when cluster-wide
# permissions are managed externally.
enabled: true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here for example we have no cluster scope rules since this sample is namespaced scope.
See; https://book.kubebuilder.io/migration/namespace-scoped.html

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, that could be useful but what I'm trying to achieve is having generated helm charts templates for clickhouse-operator that can work for both cluster admins and name-spaced users.

Copy link
Member

@camilamacedo86 camilamacedo86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for raising this — I think we need think through a few design questions before we decide:

a) What’s the best scaffolding approach to support both namespaced and cluster-scoped solutions?
b) We have RBAC helper, so what’s the cleanest way to model/parameterize them in values.yaml?
c) Does it actually make sense to expose this in values at all? Should this be a decision made by the consumer rather than the project authors?

@Allex1
Copy link
Author

Allex1 commented Feb 25, 2026

@camilamacedo86 to answer your questions:

a) I'm fine either way: we could reuse the rbacHelpers for the mai cr/crb or add a new key clusterScope
b) we can use the enabled as a catchall or do you prefer creating a sub key ?
c) Not sure I understand, I think we should keep it enabled by default in order to not create breaking changes, users can then choose to not deploy the cr/crb by setting the flag to false.

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants