-
Notifications
You must be signed in to change notification settings - Fork 979
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
Update RBAC permissions for controller and webhook #1035
Conversation
✔️ Deploy Preview for karpenter-docs-prod ready! 🔨 Explore the source changes: 6ceca84 🔍 Inspect the deploy log: https://app.netlify.com/sites/karpenter-docs-prod/deploys/61e0ba58cf5961000858034f 😎 Browse the preview: https://deploy-preview-1035--karpenter-docs-prod.netlify.app |
- apiGroups: [""] | ||
resources: ["nodes", "pods"] | ||
verbs: ["get", "list", "watch", "patch", "delete"] | ||
- apiGroups: [""] | ||
resources: ["configmaps"] | ||
verbs: ["get", "list", "watch", "update"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that knative/pkg's configmap controller might need this to update configmaps. We should be able to restrict it to the karpenter namespace.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh I see, this is the controller's rbac.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you have in mind as it relates to approving the running workflow?
No rush, just curious to see the workflow run to completion and getting acquainted to the contribution process for this project.
Either way - this should be the first contribution of many since I plan to consistently contribute to this project going forward.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way - this should be the first contribution of many since I plan to consistently contribute to this project going forward.
Awesome!
Unfortunately, RBAC is not included in the current testing workflow. We run make battletest
as part of CI, which stands up a local APIServer/ETCD using controller-runtime's testenv
package. In order to test this, you should run make apply
(see https://karpenter.sh/docs/development-guide/) and do some basic scaling and provisioner CRUD.
We definitely need to improve this -- I'll cut a ticket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were you able to test this manually?
Hey @Nuatu, just checking in if you've had a chance to test this. |
Hey @ellistarn, haven't finished yet but will have it wrapped up soon. I'll follow up really soon with the results. |
@ellistarn Manual testing has been completed. Nodes get provisioned and de-provisioned as expected when I scale various deployments up and down. |
1. Issue, if available:
#973
2. Description of changes:
Update RBAC permissions for controller and webhook managed/deployed by helm.
3. Does this change impact docs?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
configmaps
removed "update" from configmaps list within karpenter-controller [ClusterRole]
provisioners
removed "provisioners" from resources list within karpenter-controller [ClusterRole]
added "provisioners" rule within karpenter-controller [ClusterRole]
leases
moved "leases" from [ClusterRole] to [Role] within karpenter-controller
secrets
added resourceName to existing rule within karpenter-webhook [Role]
added new rule to karpenter-webhook [Role]