Enforce Pod Security Standards by Configuring the Built-in Admission Controller

    Configure the Admission Controller

    1. apiVersion: apiserver.config.k8s.io/v1
    2. kind: AdmissionConfiguration
    3. plugins:
    4. - name: PodSecurity
    5. configuration:
    6. apiVersion: pod-security.admission.config.k8s.io/v1alpha1
    7. # Defaults applied when a mode label is not set.
    8. #
    9. # - "privileged" (default)
    10. # - "baseline"
    11. # - "restricted"
    12. #
    13. # Version label values must be one of:
    14. # - "latest" (default)
    15. # - specific version like "v1.23"
    16. defaults:
    17. enforce-version: "latest"
    18. audit-version: "latest"
    19. warn: "privileged"
    20. warn-version: "latest"
    21. exemptions:
    22. # Array of authenticated usernames to exempt.
    23. usernames: []
    24. # Array of runtime class names to exempt.
    25. runtimeClasses: []
    26. # Array of namespaces to exempt.