Skip to content

Commit

Permalink
Merge pull request #18 from uswitch/upstream-dns-url-fix
Browse files Browse the repository at this point in the history
fix upstream dns url
  • Loading branch information
surajnarwade authored Aug 23, 2023
2 parents 8c047ea + 055e393 commit ef120c0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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; \
Expand Down
2 changes: 1 addition & 1 deletion config/local-dns-resolver-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
]
}
]
Expand Down
4 changes: 3 additions & 1 deletion config/plugin/upstream_dns_resolver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}$")"

Expand Down

0 comments on commit ef120c0

Please sign in to comment.