-
Notifications
You must be signed in to change notification settings - Fork 150
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
Add missing fields for Security context and secrets #102
Conversation
854db4a
to
9e92aab
Compare
780b3e0
to
ed363d7
Compare
+1 to this - would love to have the ability to pass securityContexts |
+1 this is a crucial feature I need this change so that I can set |
This is a needed feature for us as well! |
sorry everyone! i was on paternal leave. hoping this gets merged soon |
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.
LGTM
@canterberry Could we get an This MR looks good to me, and it's backwards compatible. Also, happy to become a maintainer for this repo if you need some help going through these issues. |
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.
@erikfuego I realize this is not backwards compatible as of now, if people have securityContext disabled, this update will now automatically enable it which may be undesired and breaking (since there are default fields for securityContext set).
In the case that someone already has it enabled, you receive the following warning when installing:
W0201 10:03:19.051240 7376 warnings.go:70] unknown field "spec.template.spec.securityContext.enabled"
I've suggested some ways to work around this by keeping the enabled field, and omitting it when populating the securityContext sections.
I was using the Bitnami MongoDB chart as a basis
Yeah thats a good point. Can you confirm that all the changes you suggested are in? The CI tests are failing. Im also going to test this locally with the values I set for the chart |
@joshsizer I reverted the changes you suggested for |
Awesome! I wonder, would it be good to keep the changes for containerSecurityContext, so that the schemas for each section are similar? I see either option as viable, but lean towards keeping them similar. I think lint was failing because we would have to add in to containerSecurityContext:
enabled: false |
I prefer the pattern where |
sorry about that weird merge, I merged this branch into a colleagues forked repo to test these changes, and for some reason his changes were merged into my branch. |
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.
The last change we need is to add to values.yaml:
containerSecurityContext:
enabled: false
that broke the CI |
Could you add into values.yaml
That will fix the CI. I'm not sure I can push to this branch |
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.
LGTM
@canterberry Can you review this as well?
wanted to bumb this. Thanks! |
@erikfuego Would you be able to recommit with signed commits? I am now a maintainer, and can approve and merge, but this repository is setup to only allow signed commits |
76f5c91
to
436cb9d
Compare
436cb9d
to
ed0a778
Compare
Not sure what the protocol should be moving forward, but I'm also a maintainer and I can now merge if you'd like. |
Let's do it! |
Due to PodSecurity policies in place after CIS hardening my cluster, I had to add the following to the pod or container security context:
With the current securityContext implementation, only
securityContext.fsGroup
andsecurityContext.runAsUser
were included. This change adds the ability to include everything in thesecurityContext
provided. It also removes theenabled
parameter which is unnecessary to me because we can just check if anything in thesecurityContext
exists.I added a
containerSecurityContext
to help differentiate between adding these fields for a container or the service itself. IfsecurityContext
is added for the service, PodSecurity fails because it specifically asks to be added to the container level.This also adds a missing field for secrets called
secretRef
for s3.