You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The statefulset.podSecurityContext and statefulset.securityContext fields have not work as one would expect for quite sometime. In the conversion to go, we preserved this behavior (and introduced other issues #1413).
The broken semantics are (roughly): podSecurityContext and securityContext are intermixed and partially applied (FSGroup, FSChangePolicy, RunAsUser, RunAsGroup, AllowPrivilegeEscalation, RunAsNonRoot) to all SecurityContexts and some PodSecurityContexts.
This is clearly less than ideal as:
Users can't set all fields
It's unclear which fields propagate where
It may be surprising that values under statefulset are magically propagated everywhere.
PodSecurityContext's (eg on Jobs) can't be controlled.
This has left us in a bit of a bind as the most ideal field names are taken.
I'm currently leaning towards:
add securityContext and podSecurityContext to the root values with no defaults.
add explicit fields the remaining security contexts following the statefulset.template pattern. e.g. post_install_job.template.securityContext
If any of these fields are provided, statefulset.podSecurityContext and statefulset.securityContext will be ignored. Then in a few releases, we'll remove these fields entirely.
The
statefulset.podSecurityContext
andstatefulset.securityContext
fields have not work as one would expect for quite sometime. In the conversion to go, we preserved this behavior (and introduced other issues #1413).The broken semantics are (roughly):
podSecurityContext
andsecurityContext
are intermixed and partially applied (FSGroup
,FSChangePolicy
,RunAsUser
,RunAsGroup
,AllowPrivilegeEscalation
,RunAsNonRoot
) to allSecurityContext
s and somePodSecurityContext
s.This is clearly less than ideal as:
statefulset
are magically propagated everywhere.This has left us in a bit of a bind as the most ideal field names are taken.
I'm currently leaning towards:
securityContext
andpodSecurityContext
to the root values with no defaults.statefulset.template
pattern. e.g.post_install_job.template.securityContext
If any of these fields are provided,
statefulset.podSecurityContext
andstatefulset.securityContext
will be ignored. Then in a few releases, we'll remove these fields entirely.JIRA Link: K8S-309
The text was updated successfully, but these errors were encountered: