-
Notifications
You must be signed in to change notification settings - Fork 227
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
Decouple Service account creation from PodSecurityPolicy #387
Decouple Service account creation from PodSecurityPolicy #387
Conversation
@tisonkun can I ask if you can PTAL? |
Sorry I don't have the related tech knowledge to review this patch. Perhaps @michaeljmarshall can help here? |
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.
Thanks for the contribution @frankjkelly! I made some further changes:
- renamed *-rbac.yaml to *-psp.yaml so that PSP changes are completely separated from other parts
- moved service account creation to *-service-account.yaml files
- disabled PSP by default on k8s >= 1.25
- added new CI test to ensure that chart can be deployed on both 1.21 and 1.27 with rbac.enabled and rbac.psp enabled (would ignore rbac.psp on 1.27)
@lhotari Somehow I missed the email with your changes and the merge. Just wanted to say thanks so much! |
Thanks for the work @lhotari and @frankjkelly. I am trying to implement #424 and stumbled upon your recent work.
|
Good questions @Mortom123 .
The referred roles and role bindings defined in broker-psp.yaml are tightly coupled to PSP. That's why they are in the broker-psp.yaml file and require toggling PSP.
That is already split into the
If we would start from a clean slate with the Pulsar Helm Chart, we would most likely do it this way. It seems that @Mortom123 The Apache Pulsar PMC is looking for maintainers for this repository so if you'd like to show some care for this project, it would be appreciated. We can introduce breaking changes in major releases so if it would make sense to organize things differently, that could be done as long as the breaking changes are documented and we bump the major version number. |
Mhh. I see the problem. Historic growth of repos always comes at a price..., I guess for now I will settle to just be able to toggle account creation and leave the rest for the psp-Flag to toggle. While I appreciate the offer @lhotari , I do not feel confident in my documentation skills and just started working with kubernetes-clusters recently - however the company I am working at plans to introduce Pulsar as major infrastructure building block. Once the projects responsibilities and the way we use Pulsar is settled, I might be able to revise my position or even recommend someone whose daily business will be pulsar. |
Motivation
Primary reason: We need component-specific service accounts (for our Istio Authz roles) but cannot deploy the current
3.0.0
version of the Helm Chart as is withpsp: true
since K8S/EKS 1.25+ does not support thePodSecurityPolicy
API any longer.Secondary reason: I am not aware of any reason not to give the pods specific service accounts even if pod security is disabled. So seems like a reasonable idea to decouple the two.
Modifications
Removed the helm templating rules around
serviceAccountName
Local Testing
Using Minikube
First with
rbac.enabled: false
andrbac.psp: false
and then with
rbac.enabled: true
andrbac.psp: true
Verifying this change