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

chore: enable container security contexts modifications #50

Merged
merged 3 commits into from
Nov 15, 2023

Conversation

jmehitch
Copy link
Contributor

@jmehitch jmehitch commented Nov 13, 2023

Resolves issue: #49.

This PR updates the chart to enable us to override/set additional security context configuration at the container level in each of the containers in the athens-proxy deployment template.

It moves the existing securityContext configuration to the PodSecurityContext at the pod spec level to ensure this isn't a breaking change and ensures backwards compatibility. It adds two new values in the chart securityContext (for the main athens container) and initContainerSecurityContext (for the init container, if used). This allows us to override/modify the existing configuration with additional security context configuration options in each of the containers, at the container securityContext level.

See PodSecurityContext API reference for fields that can be set at the pod spec level (for the existing image.runAsNonRoot configuration): https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#podsecuritycontext-v1-core.

And see SecurityContext API reference for the fields that can be set at the container spec level: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#securitycontext-v1-core.

closes #49

@jmehitch jmehitch requested a review from a team as a code owner November 13, 2023 20:34
@jmehitch
Copy link
Contributor Author

jmehitch commented Nov 13, 2023

Tested in forked repo and release created: https://github.com/jmehitch/athens-charts/releases/tag/athens-proxy-0.8.0 as per contribution guidelines

charts/athens-proxy/values.yaml Show resolved Hide resolved
charts/athens-proxy/templates/deployment.yaml Outdated Show resolved Hide resolved
@DrPsychick
Copy link
Member

Thank you very much for your contribution @jmehitch and your effort in testing the changes, please check my comments.

@jmehitch
Copy link
Contributor Author

@DrPsychick thanks for your review and picking up my mistake - was a bad copy & paste in the template 🙂 have updated the PR

---

Resolves issue: gomods#49.

This commit updates the chart to enable us to override/set additional
security context configuration at the container level in each of the
containers in the athens-proxy deployment template.

It moves the existing `securityContext` configuration to the
`PodSecurityContext` at the pod spec level to ensure this isn't a
breaking change and ensures backwards compatibility. It adds two new
values in the chart `securityContext` (for the main athens container)
and `initContainerSecurityContext` (for the init container, if used).
This allows us to override/modify the existing configuration with
additional security context configuration options in each of the
containers, at the container `securityContext` level.

See `PodSecurityContext` API reference for fields that can be set at the
pod spec level (for the existing `image.runAsNonRoot` configuration):
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#podsecuritycontext-v1-core.

And see `SecurityContext` API reference for the fields that can be set
at the container spec level:
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#securitycontext-v1-core.
@DrPsychick DrPsychick merged commit abb874e into gomods:main Nov 15, 2023
1 check passed
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.

Enable ability to modify pod security context
2 participants