Skip to content

Commit 055e393

Browse files
author
surajnarwade
committed
fix upstream dns url fix
1 parent 8c047ea commit 055e393

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM registry.k8s.io/node-problem-detector/node-problem-detector:v0.8.12
1+
FROM registry.k8s.io/node-problem-detector/node-problem-detector:v0.8.13
22

33
RUN set -eux; \
44
apt-get update; \

config/local-dns-resolver-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"reason": "NodeLocalDnsResolutionFailing",
2222
"path": "./config/plugin/local_dns_resolver.sh",
2323
"args": [
24-
"169.254.20.10"
24+
"kube-dns-upstream.kube-system.svc.cluster.local."
2525
]
2626
}
2727
]

config/plugin/upstream_dns_resolver.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ UNKNOWN=2
66

77
readonly fqdn_a_record="$1"
88

9+
10+
911
# We send a single attempt only, without retries and with 1s timeout.
1012
# We expect to receive an IPv4 address for a given A record.
11-
dig_cmd_out="$(dig -t A @169.254.20.10 +tries=1 +retry=0 +time=1 +short "${fqdn_a_record}" 2>&1 | head -n1)"
13+
dig_cmd_out="$(dig -t A @${LOCAL_DNS_RESOLVER_IP} +tries=1 +retry=0 +time=1 +short "${fqdn_a_record}" 2>&1 | head -n1)"
1214
dig_cmd_return_code="$?"
1315
dig_cmd_out_ipv4ish="$(echo "${dig_cmd_out}" | grep -E -o "^([0-9]{1,3}[\.]){3}[0-9]{1,3}$")"
1416

0 commit comments

Comments
 (0)