Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit 2ec346a

Browse files
authored
Merge pull request #1905 from brandong954/v0.16.x
[v0.16.x] disables old kubedns when coredns-local enabled.
2 parents ce5faab + 91b569f commit 2ec346a

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

builtin/files/userdata/cloud-config-controller

+12-3
Original file line numberDiff line numberDiff line change
@@ -1141,6 +1141,7 @@ write_files:
11411141
{{- end }}
11421142

11431143
# CLUSTER DNS
1144+
{{ if not .KubeDns.DNSMasq.CoreDNSLocal.Enabled -}}
11441145
{{ if eq .KubeDns.Provider "coredns" -}}
11451146
remove_object ConfigMap kube-system/kubedns-cm
11461147
remove_object Deployment kube-system/kube-dns
@@ -1160,6 +1161,13 @@ write_files:
11601161
"${mfdir}/kube-dns-autoscaler-de.yaml" \
11611162
"${mfdir}/kube-dns-de.yaml"
11621163
{{- end }}
1164+
{{- else }}
1165+
remove_object ConfigMap kube-system/kubedns-cm
1166+
remove_object Deployment kube-system/kube-dns
1167+
remove_object ConfigMap kube-system/coredns-cm
1168+
remove_object Deployment kube-system/coredns
1169+
remove_object Deployment kube-system/kube-dns-autoscaler
1170+
{{- end }}
11631171
{{- if .KubeDns.NodeLocalResolver }}
11641172
{{- if .KubeDns.DNSMasq.CoreDNSLocal.Enabled }}
11651173
deploy "${mfdir}/dnsmasq-node-coredns-local.yaml"
@@ -1168,7 +1176,11 @@ write_files:
11681176
{{- end }}
11691177
deploy "${mfdir}/dnsmasq-node-ds.yaml"
11701178
{{- end }}
1179+
{{ if not .KubeDns.DNSMasq.CoreDNSLocal.Enabled -}}
11711180
forceapply "${mfdir}/kube-dns-pdb.yaml"
1181+
{{- else }}
1182+
remove "${mfdir}/kube-dns-pdb.yaml"
1183+
{{- end }}
11721184

11731185
{{ if .Addons.MetricsServer.Enabled -}}
11741186
# METRICS SERVER
@@ -5632,10 +5644,7 @@ write_files:
56325644
- --no-resolv
56335645
- --keep-in-foreground
56345646
- --neg-ttl={{ .KubeDns.DNSMasq.NegTTL }}
5635-
# Send requests to the last server (coredns-local) first and only
5636-
# fallback to the previous one (global coredns) if it's unreachable.
56375647
- --strict-order
5638-
- --server={{.DNSServiceIP}}#53
56395648
- --server=127.0.0.1#9254
56405649
{{ else }}
56415650
- --server=//{{.DNSServiceIP}}

0 commit comments

Comments
 (0)