Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clusterrole.yaml: add if condition for .Values.rbac.enabled #242

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kastl-ars
Copy link

clusterrole.yaml: add if condition for .Values.rbac.enabled, like on the clusterrolebinding

fix #241

@mittal-ishaan
Copy link
Contributor

Hi @kastl-ars
Thank you for this. LGTM
Due to my recent merge, we did add rbac like this which we would want to consider upon. My bad here, I should have seen it under my PR.
Should we also have them under this if condition too, we are already gating them under a helm config?

Question is do we also want to have rbac.enabled flag gate the cluster role needed in openshift environment too (that looks exactly what this flag is intended to do) or we can have scenarios where a user wants to disable the rbac.enabled flag but want the required cluster role, etc for openshift environment.

Otherwise the Issue raised and PR is really helpful

…ues.rbac.enabled, like on the clusterrolebinding

fix opencost#241
@kastl-ars kastl-ars force-pushed the 20241220_rbac_if_condition branch from 1918c7c to 2228329 Compare January 7, 2025 07:20
@kastl-ars
Copy link
Author

Hi @kastl-ars Thank you for this. LGTM Due to my recent merge, we did add rbac like this which we would want to consider upon. My bad here, I should have seen it under my PR. Should we also have them under this if condition too, we are already gating them under a helm config?

Sorry, I am not quite sure what you mean?

Question is do we also want to have rbac.enabled flag gate the cluster role needed in openshift environment too (that looks exactly what this flag is intended to do) or we can have scenarios where a user wants to disable the rbac.enabled flag but want the required cluster role, etc for openshift environment.

In my opinion, as the OpenShift stuff needs to be enabled explicitly and there is already a value to enable/disable the creation of the clusterRoleBinding, I would say they can be left independent of each other.

https://github.com/opencost/opencost-helm-chart/blob/main/charts/opencost/values.yaml#L340
https://github.com/opencost/opencost-helm-chart/blob/main/charts/opencost/values.yaml#L342

The cluster I want to run OpenCost in does not allow me to create roles and rolebindings, so I will keep these settings disabled and have the cluster owner create them for me. But I will enable the general OpenShift integration.

@kastl-ars
Copy link
Author

Is there anything from blocking this from being merged and released? This prevents me from running OpenCost in one of my clusters, where my permissions do not allow creating roles and rolebindings. And the fix is simple...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Creation of ClusterRole and Clusterrolebindings cannot be disabled
2 participants