Skip to content

Commit 4d7ad60

Browse files
committed
Azure: Update services that run on control plane nodes
New `update-dns-server` script that adds DNS resolvers to /etc/NetworkManager/conf.d/dns-servers.conf. The script adds the host's own IP address and the cloud metadata server's IP address to the conf file. These would then get added to the local resolv.conf by NetworkManager. This script is run as part of azure-update-dns.service This service runs when the DNSType on the Azure platform is set to "ClusterHosted".
1 parent 9533431 commit 4d7ad60

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: azure-update-dns.service
2+
enabled: {{if and (eq .Infra.Status.PlatformStatus.Type "Azure") (.Infra.Status.PlatformStatus.Azure) (.Infra.Status.PlatformStatus.Azure.CloudLoadBalancerConfig) (eq .Infra.Status.PlatformStatus.Azure.CloudLoadBalancerConfig.DNSType "ClusterHosted") }}true{{else}}false{{end}}
3+
contents: |
4+
[Unit]
5+
Description=Update Default Azure Resolver
6+
# We don't need to do this on the firstboot
7+
After=firstboot-osupdate.target
8+
# Wait for NetworkManager to report it's online
9+
After=NetworkManager-wait-online.service
10+
# Run before kubelet
11+
Before=kubelet-dependencies.target
12+
13+
[Service]
14+
Type=oneshot
15+
RemainAfterExit=yes
16+
ExecStart=/usr/local/bin/update-dns-server 169.254.169.254
17+
18+
[Install]
19+
RequiredBy=kubelet-dependencies.target

0 commit comments

Comments
 (0)