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.
apiVersion: policies.kyverno.io/v1alpha1kind: MutatingPolicymetadata:name: add-castai-removal-disabledannotations:policies.kyverno.io/title: Add CAST AI Removal Disabledpolicies.kyverno.io/category: CAST AIpolicies.kyverno.io/severity: mediumpolicies.kyverno.io/subject: Job, CronJobkyverno.io/kyverno-version: 1.15.0kyverno.io/kubernetes-version: "1.25"policies.kyverno.io/minversion: 1.15.0policies.kyverno.io/description: "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. "spec:matchConstraints:resourceRules:- apiGroups:- batchapiVersions:- v1operations:- CREATE- UPDATEresources:- jobs- cronjobsmutations:- patchType: ApplyConfigurationapplyConfiguration:expression: |object.kind == "Job" ?Object{spec: Object.spec{template: Object.spec.template{metadata: Object.spec.template.metadata{labels: {"autoscaling.cast.ai/removal-disabled": "true"}}}}} :object.kind == "CronJob" ?Object{spec: Object.spec{jobTemplate: Object.spec.jobTemplate{spec: Object.spec.jobTemplate.spec{template: Object.spec.jobTemplate.spec.template{metadata: Object.spec.jobTemplate.spec.template.metadata{labels: {"autoscaling.cast.ai/removal-disabled": "true"}}}}}}} : Object{}reinvocationPolicy: Never
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.
Automatically adjusts resource quotas based on time schedules to optimize cloud costs. During non-business hours, the policy reduces resource quotas to prevent overprovisioning while ensuring essential services remain operational.