Add option to configure securityContext on both pods and containers #1666
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #1253
Fixes: #1660
Why is it needed?
With the introduction of PodSecurityStandard (see https://kubernetes.io/docs/concepts/security/pod-security-standards/) in Kubernetes, users are able to enforce stricter security policies. In addition to that security-hardened distributions of k8s (like Openshift/OKD) changes the default behavior in 4.12+ (due to the introduction of mentioned PSP and integration with existing SecurityContextConstraints) and requires more values in
securityContexts
to be defined.Because of this, it's becoming impossible for users with stricter security to deploy the chart without forking it.
What is does?
securityContexts
through the chart(except for permission initContainer in internal database deployment, see below)Makesdata-permissions-ensurer
initContainer in internal database deploy always run as a root, since it should be able to usechmod
(if uid viapodSecurityContext
was set to999
before, was it even working at all?)Note: This PR does not make the chart compatible with stricter security k8s distribution by default, but enables users to do so on their own.
If the idea gets accepted, I will also update the README.