Don't schedule kubedns to Windows node
**Problem:**
Schedule kubedns component to Windows node will cause DNS doesn't work
well
**Solution:**
Add nodeAffinity to kubedns
**Issue:**
@@ -15,6 +15,15 @@ spec:
labels:
k8s-app: kube-dns-autoscaler
spec:
+ affinity:
+ nodeAffinity:
+ requiredDuringSchedulingIgnoredDuringExecution:
+ nodeSelectorTerms:
+ - matchExpressions:
+ - key: beta.kubernetes.io/os
+ operator: NotIn
+ values:
+ - windows
serviceAccountName: kube-dns-autoscaler
containers:
- name: autoscaler
@@ -128,6 +137,14 @@ spec:
operator: In
values: ["kube-dns"]
topologyKey: kubernetes.io/hostname
+ nodeAffinity:
+ requiredDuringSchedulingIgnoredDuringExecution:
+ nodeSelectorTerms:
+ - matchExpressions:
+ - key: beta.kubernetes.io/os
+ operator: NotIn
+ values:
+ - windows
tolerations:
- key: "CriticalAddonsOnly"
operator: "Exists"
