machine-api-termination-handler: run DaemonSet only on Linux
not compatible with other OSes.
@@ -42,6 +42,8 @@ const (
hostKubeConfigPath = "/var/lib/kubelet/kubeconfig"
hostKubePKIPath = "/var/lib/kubelet/pki"
operatorStatusNoOpMessage = "Cluster Machine API Operator is in NoOp mode"
+ kubernetesOSlabel = "kubernetes.io/os"
+ kubernetesOSlabelLinux = "linux"
minimumWorkerReplicas = int32(2)
)
@@ -799,7 +801,10 @@ func newTerminationPodTemplateSpec(config *OperatorConfig) *corev1.PodTemplateSp
Spec: corev1.PodSpec{
Containers: containers,
PriorityClassName: "system-node-critical",
- NodeSelector: map[string]string{machinecontroller.MachineInterruptibleInstanceLabelName: ""},
+ NodeSelector: map[string]string{
+ machinecontroller.MachineInterruptibleInstanceLabelName: "",
+ kubernetesOSlabel: kubernetesOSlabelLinux,
+ },
ServiceAccountName: machineAPITerminationHandler,
AutomountServiceAccountToken: pointer.BoolPtr(false),
HostNetwork: true,
