Pod tolerations are used to schedule on Nodes which have a matching taint. This policy adds the toleration `org.com/role=service:NoSchedule` if existing tolerations do not contain the key `org.com/role`.
apiVersion: policies.kyverno.io/v1alpha1kind: MutatingPolicymetadata:name: add-tolerationsannotations:policies.kyverno.io/title: Add Tolerationspolicies.kyverno.io/category: Otherpolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: Podkyverno.io/kyverno-version: 1.15.0policies.kyverno.io/minversion: 1.6.0kyverno.io/kubernetes-version: "1.23"policies.kyverno.io/description: Pod tolerations are used to schedule on Nodes which have a matching taint. This policy adds the toleration `org.com/role=service:NoSchedule` if existing tolerations do not contain the key `org.com/role`.spec:matchConstraints:resourceRules:- apiGroups:- ""apiVersions:- v1operations:- CREATE- UPDATEresources:- podsmatchConditions:- name: skip-if-toleration-existsexpression: |!has(object.spec.tolerations) ||object.spec.tolerations == null ||!object.spec.tolerations.exists(t, t.key == "org.com/role")mutations:- patchType: JSONPatchjsonPatch:expression: |(!has(object.spec.tolerations) || object.spec.tolerations == null) ?[JSONPatch{op: "add",path: "/spec/tolerations",value: [dyn({"key": "org.com/role","operator": "Equal","value": "service","effect": "NoSchedule"})]}] :[JSONPatch{op: "add",path: "/spec/tolerations/-",value: dyn({"key": "org.com/role","operator": "Equal","value": "service","effect": "NoSchedule"})}]
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.