PodSecurityPolicy deprecation
Estimated time to read: 1 minute
Move to PodSecurity
Kubernetes has deprecated the PodSecurityPolicy API in v1.21 and it will be removed in v1.25. With v1.23, a new feature called PodSecurity was promoted to beta. From v1.25 onwards, there will be no API serving PodSecurityPolicys, so you have to cleanup all the existing PSPs before upgrading your cluster.
The field spec.kubernetes.allowPrivilegedContainers
is defaulted by the Gardener API Server because if we allow the field to be removed when PodSecurityPolicy admission plugin is active, the existing pods running in the cluster which need privileges can fail.
Upgrade to Kubernetes v1.25
Steps to upgrade your EMK cluster to v1.25:
Alls steps can be executed from the Fuga Dashboard or using the Kubernetes command line client kubectl.
-
Migrate from PodSecurityPolicy to the Built-In PodSecurity Admission Controller, see Kubernetes documentation
-
Disable PodSecurityPolicy, add the following to the shoot spec:
-
Save YAML and wait for shoot to reconcile
-
Remove the field
spec.kubernetes.allowPrivilegedContainers
from the shoot spec -
Save YAML and wait for your shoot to reconcile
-
Upgrade Kubernetes from the Fuga Dashboard or in the shoot spec
-
Wait for your shoot to reconcile
Sources: