diff --git a/Dockerfile b/Dockerfile index 1ae850d..f7969fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM registry.k8s.io/node-problem-detector/node-problem-detector:v0.8.12 +FROM registry.k8s.io/node-problem-detector/node-problem-detector:v0.8.13 RUN set -eux; \ apt-get update; \ diff --git a/config/local-dns-resolver-config.json b/config/local-dns-resolver-config.json index 9dfdbff..468c378 100644 --- a/config/local-dns-resolver-config.json +++ b/config/local-dns-resolver-config.json @@ -21,7 +21,7 @@ "reason": "NodeLocalDnsResolutionFailing", "path": "./config/plugin/local_dns_resolver.sh", "args": [ - "169.254.20.10" + "kube-dns-upstream.kube-system.svc.cluster.local." ] } ] diff --git a/config/plugin/upstream_dns_resolver.sh b/config/plugin/upstream_dns_resolver.sh index 301df32..1cd1fdd 100755 --- a/config/plugin/upstream_dns_resolver.sh +++ b/config/plugin/upstream_dns_resolver.sh @@ -6,9 +6,11 @@ UNKNOWN=2 readonly fqdn_a_record="$1" + + # We send a single attempt only, without retries and with 1s timeout. # We expect to receive an IPv4 address for a given A record. -dig_cmd_out="$(dig -t A @169.254.20.10 +tries=1 +retry=0 +time=1 +short "${fqdn_a_record}" 2>&1 | head -n1)" +dig_cmd_out="$(dig -t A @${LOCAL_DNS_RESOLVER_IP} +tries=1 +retry=0 +time=1 +short "${fqdn_a_record}" 2>&1 | head -n1)" dig_cmd_return_code="$?" dig_cmd_out_ipv4ish="$(echo "${dig_cmd_out}" | grep -E -o "^([0-9]{1,3}[\.]){3}[0-9]{1,3}$")"