mirror of https://github.com/kubernetes/kops.git
coredns: Enforce topologySpreadConstraints
This commit is contained in:
parent
ce3c7b4ec5
commit
6820d751ed
|
|
@ -145,16 +145,18 @@ spec:
|
|||
{{ ToYAML .KubeDNS.Affinity | indent 8 }}
|
||||
{{- end }}
|
||||
topologySpreadConstraints:
|
||||
{{- if ne GetCloudProvider "metal" }}
|
||||
# Metal provider doesn't add the "topology.kubernetes.io/zone" label
|
||||
- maxSkew: 1
|
||||
topologyKey: "topology.kubernetes.io/zone"
|
||||
whenUnsatisfiable: ScheduleAnyway
|
||||
whenUnsatisfiable: DoNotSchedule
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
k8s-app: kube-dns
|
||||
{{- end }}
|
||||
- maxSkew: 1
|
||||
topologyKey: "kubernetes.io/hostname"
|
||||
# Normally we use DoNotSchedule here, but because CoreDNS autoscales, we cannot guarantee this constraint can be satisfied
|
||||
whenUnsatisfiable: ScheduleAnyway
|
||||
whenUnsatisfiable: DoNotSchedule
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
k8s-app: kube-dns
|
||||
|
|
|
|||
|
|
@ -5,14 +5,14 @@ topologySpreadConstraints:
|
|||
app.kubernetes.io/instance: '{{ .Release.Name }}'
|
||||
topologyKey: topology.kubernetes.io/zone
|
||||
maxSkew: 1
|
||||
whenUnsatisfiable: ScheduleAnyway
|
||||
whenUnsatisfiable: DoNotSchedule
|
||||
- labelSelector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: '{{ template "coredns.name" . }}'
|
||||
app.kubernetes.io/instance: '{{ .Release.Name }}'
|
||||
topologyKey: kubernetes.io/hostname
|
||||
maxSkew: 1
|
||||
whenUnsatisfiable: ScheduleAnyway
|
||||
whenUnsatisfiable: DoNotSchedule
|
||||
|
||||
autoscaler:
|
||||
enabled: true
|
||||
|
|
|
|||
Loading…
Reference in New Issue