gomods / athens-charts

Helm charts for athens
https://gomods.github.io/athens-charts/
MIT License
10 stars 17 forks source link

chore: enable container security contexts modifications #50

Closed jmehitch closed 11 months ago

jmehitch commented 11 months ago

Resolves issue: https://github.com/gomods/athens-charts/issues/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 commented 11 months ago

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

DrPsychick commented 11 months ago

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

jmehitch commented 11 months ago

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