A required component of a MachineSet is the infrastructure name which is a random string created in a separate resource. It can be tedious or impossible to know this for each MachineSet created. This policy fetches the value of the infrastructure name from the Cluster resource and replaces all instances of TEMPLATE in a MachineSet with that name.
apiVersion: kyverno.io/v1kind: ClusterPolicymetadata:name: inject-infrastructurenameannotations:policies.kyverno.io/title: Inject Infrastructure Namepolicies.kyverno.io/category: OpenShiftpolicies.kyverno.io/severity: mediumkyverno.io/kyverno-version: 1.10.0policies.kyverno.io/minversion: 1.10.0kyverno.io/kubernetes-version: "1.26"policies.kyverno.io/subject: MachineSetpolicies.kyverno.io/description: A required component of a MachineSet is the infrastructure name which is a random string created in a separate resource. It can be tedious or impossible to know this for each MachineSet created. This policy fetches the value of the infrastructure name from the Cluster resource and replaces all instances of TEMPLATE in a MachineSet with that name.spec:rules:- name: replace-templatematch:any:- resources:kinds:- machine.openshift.io/v1beta1/MachineSetoperations:- CREATEcontext:- name: clusterapiCall:urlPath: /apis/config.openshift.io/v1/infrastructures/cluster- name: infraidvariable:jmesPath: cluster.status.infrastructureNamemutate:patchesJson6902: |-- op: replacepath: /metadatavalue: {{ replace_all(to_string(request.object.metadata),'TEMPLATE', infraid) }}- op: replacepath: /specvalue: {{ replace_all(to_string(request.object.spec),'TEMPLATE', infraid) }}
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.