• Kubernetes Submit Queue's avatar
    Merge pull request #52849 from liggitt/psp-defaulting-order · 97808e5a
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue (batch tested with PRs 48665, 52849, 54006, 53755). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
    
    Order PSP by name, prefer non-mutating PSPs
    
    Fixes #36184
    Fixes #23217
    Related to #23217
    
    Removes unnecessary mutation of pods:
    * Determines effective security context for pods using a wrapper containing the pod and container security context, rather than building/setting a combined struct on every admission
    * Does not set `privileged:&false` on security contexts with `privileged:nil`
    * Does not set `runAsNonRoot:&true` on security contexts that already have a non-nil, non-0 `runAsUser`
    * Does not mutate/normalize container capabilities unless changes are required (missing  defaultAddCapabilities or requiredDropCapabilities)
    
    Defines behavior when multiple PSP objects allow a pod:
    * PSPs which allow the pod as-is (no defaulting/mutating) are preferred
    * If the pod must be defaulted/mutated to be allowed, the first PSP (ordered by name) to allow the pod is selected
    * During update operations, when mutations to pod specs are disallowed, only non-mutating PSPs are used to validate the pod
    
    ```release-note
    PodSecurityPolicy: when multiple policies allow a submitted pod, priority is given to ones which do not require any fields in the pod spec to be defaulted. If the pod must be defaulted, the first policy (ordered by name) that allows the pod is used.
    ```
    97808e5a
Name
Last commit
Last update
..
api Loading commit data...
apimachinery/tests Loading commit data...
apis Loading commit data...
auth Loading commit data...
bootstrap/api Loading commit data...
capabilities Loading commit data...
client Loading commit data...
cloudprovider Loading commit data...
controller Loading commit data...
credentialprovider Loading commit data...
features Loading commit data...
fieldpath Loading commit data...
generated Loading commit data...
hyperkube Loading commit data...
kubeapiserver Loading commit data...
kubectl Loading commit data...
kubelet Loading commit data...
kubemark Loading commit data...
master Loading commit data...
printers Loading commit data...
probe Loading commit data...
proxy Loading commit data...
quota Loading commit data...
registry Loading commit data...
routes Loading commit data...
security Loading commit data...
securitycontext Loading commit data...
serviceaccount Loading commit data...
ssh Loading commit data...
util Loading commit data...
version Loading commit data...
volume Loading commit data...
watch Loading commit data...
.import-restrictions Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...