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

Fix the permissions in config/rbac/bases/operator/role.yaml #155

Merged
merged 4 commits into from
Jun 12, 2024

Conversation

paulzhang97
Copy link
Contributor

@paulzhang97 paulzhang97 commented Jun 11, 2024

Related to #154, config/rbac/bases/operator/role.yaml is actually pulled by Cloud, need to add the permissions to it.

Copy link
Contributor

@RafalKorepta RafalKorepta left a comment

Choose a reason for hiding this comment

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

LGHT with none blocking comment

- scheduling.k8s.io
resources:
- priorityclasses
verbs:
Copy link
Contributor

Choose a reason for hiding this comment

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

I normally add watch verb to the list below. Yet the code that checks storage class is within webook, so it might not have proper client cache configured

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added.

Copy link
Contributor

@chrisseto chrisseto left a comment

Choose a reason for hiding this comment

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

This file should be generated by kubebuilder when you run task k8s:manifests (or something similar). You can affect how that file is generated by adding kubebuilder markers/directives above the controller. There should be a big block that exists already and just needs to have priorityclasses add. Can you add it there and then regenerate this file?

@paulzhang97
Copy link
Contributor Author

This file should be generated by kubebuilder when you run task k8s:manifests (or something similar). You can affect how that file is generated by adding kubebuilder markers/directives above the controller. There should be a big block that exists already and just needs to have priorityclasses add. Can you add it there and then regenerate this file?

Let me try.

@paulzhang97
Copy link
Contributor Author

Added the marker. I only added it for ClusterRole. I don't think we need to add it to Role. Let me know if otherwise.

@chrisseto
Copy link
Contributor

Ah, sorry this should be added above the controller that's actually using those permissions

//+kubebuilder:rbac:groups=apps,resources=statefulsets,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=cert-manager.io,resources=issuers;certificates,verbs=create;get;list;watch;patch;delete;update;
//+kubebuilder:rbac:groups=cert-manager.io,resources=clusterissuers,verbs=create;get;list;watch;patch;delete;update;
//+kubebuilder:rbac:groups=core,resources=configmaps,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=core,resources=nodes,verbs=get;list;watch
//+kubebuilder:rbac:groups=core,resources=persistentvolumeclaims,verbs=get;list;watch;delete;
//+kubebuilder:rbac:groups=core,resources=pods,verbs=get;list;watch;update;delete
//+kubebuilder:rbac:groups=core,resources=pods/finalizers,verbs=update
//+kubebuilder:rbac:groups=core,resources=pods/status,verbs=update;patch
//+kubebuilder:rbac:groups=core,resources=secrets,verbs=get;list;watch;create;update;patch;
//+kubebuilder:rbac:groups=core,resources=serviceaccounts,verbs=get;list;watch;create;update;patch;
//+kubebuilder:rbac:groups=core,resources=services,verbs=get;list;watch;create;update;patch;
//+kubebuilder:rbac:groups=networking.k8s.io,resources=ingresses,verbs=create;get;list;watch;patch;delete;update;
//+kubebuilder:rbac:groups=policy,resources=poddisruptionbudgets,verbs=create;get;list;watch;patch;delete;update;
//+kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterroles;clusterrolebindings,verbs=get;list;watch;create;update;patch;
//+kubebuilder:rbac:groups=redpanda.vectorized.io,resources=clusters,verbs=get;list;watch;create;update;patch;delete
//+kubebuilder:rbac:groups=redpanda.vectorized.io,resources=clusters/finalizers,verbs=update
//+kubebuilder:rbac:groups=redpanda.vectorized.io,resources=clusters/status,verbs=get;update;patch

@paulzhang97
Copy link
Contributor Author

Ah, sorry this should be added above the controller that's actually using those permissions

No problem. Done.

Copy link
Contributor

@chrisseto chrisseto left a comment

Choose a reason for hiding this comment

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

LGTM!

@chrisseto chrisseto merged commit 9aaa753 into main Jun 12, 2024
5 checks passed
@chrisseto chrisseto deleted the paulz/fix-rbac branch June 12, 2024 21:13
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.

None yet

3 participants