When Pod Security Admission is configured with a cluster-wide AdmissionConfiguration file which sets either baseline or restricted, for example in many PaaS CIS profiles, it may be necessary to relax this to privileged on a per-Namespace basis so that more granular control can be provided. This policy labels new and existing Namespaces, except that of kube-system, with the `pod-security.kubernetes.io/enforce: privileged` label.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: add-privileged-existing-namespacesannotations:policies.kyverno.io/title: Add Privileged Label to Existing Namespacespolicies.kyverno.io/category: Pod Security Admissionpolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: Namespacekyverno.io/kyverno-version: 1.8.0policies.kyverno.io/minversion: 1.7.0kyverno.io/kubernetes-version: "1.24"policies.kyverno.io/description: "When Pod Security Admission is configured with a cluster-wide AdmissionConfiguration file which sets either baseline or restricted, for example in many PaaS CIS profiles, it may be necessary to relax this to privileged on a per-Namespace basis so that more granular control can be provided. This policy labels new and existing Namespaces, except that of kube-system, with the `pod-security.kubernetes.io/enforce: privileged` label."spec:mutateExistingOnPolicyUpdate: truerules:- name: label-privileged-namespacesmatch:any:- resources:kinds:- Namespacemutate:targets:- apiVersion: v1kind: NamespacepatchStrategicMerge:metadata:<(name): "!kube-system"labels:pod-security.kubernetes.io/enforce: privileged
The Kubernetes cluster autoscaler does not evict pods that use hostPath or emptyDir volumes. To allow eviction of these pods, the annotation cluster-autoscaler.kubernetes.io/safe-to-evict=true must be added to the pods.
The Kubernetes cluster autoscaler does not evict pods that use hostPath or emptyDir volumes. To allow eviction of these pods, the annotation cluster-autoscaler.kubernetes.io/safe-to-evict=true must be added to the pods.
CAST AI will not downscale a node that includes a pod with the autoscaling.cast.ai/removal-disabled="true" label on it, this protects sensitive workloads from being evicted and can be attributed to any pod to protect against unwanted downscaling. This policy will mutate jobs and cronjobs to add the removal-disabled label to protect against eviction.