File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1919 "type" : " permanent" ,
2020 "condition" : " NodeLocalDnsResolutionFailure" ,
2121 "reason" : " NodeLocalDnsResolutionFailing" ,
22- "path" : " ./config/plugin/local_dns_resolver.sh" ,
23- "args" : [
24- " 169.254.20.10"
25- ]
22+ "path" : " ./config/plugin/local_dns_resolver.sh"
2623 }
2724 ]
2825}
Original file line number Diff line number Diff line change 44NONOK=1
55UNKNOWN=2
66
7- readonly local_dns_resolver_ip=" $1 "
7+ if [ -z " ${NODE_NAME} " ]; then
8+ exit $UNKNOWN
9+ fi
10+
11+ # Get the node-local-dns pod IP running on this node directly,
12+ # bypassing 169.254.20.10 which requires Cilium's eBPF path
13+ local_dns_resolver_ip=" $( curl -s \
14+ -H " Authorization: Bearer $( cat /var/run/secrets/kubernetes.io/serviceaccount/token) " \
15+ --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt \
16+ " https://${KUBERNETES_SERVICE_HOST} :${KUBERNETES_SERVICE_PORT} /api/v1/namespaces/kube-system/pods?labelSelector=k8s-app%3Dnode-local-dns&fieldSelector=spec.nodeName%3D${NODE_NAME} " \
17+ 2> /dev/null | jq -r ' .items[0].status.podIP' ) "
18+
19+ if [ -z " ${local_dns_resolver_ip} " ] || [ " ${local_dns_resolver_ip} " = " null" ]; then
20+ exit $UNKNOWN
21+ fi
822
923dig_cmd_out=" $( dig -t TXT @" ${local_dns_resolver_ip} " +tries=1 +retry=0 +time=33 +noqr +noall +comments kubernetes.default.svc. 2>&1 ) "
1024dig_cmd_return_code=" $? "
You can’t perform that action at this time.
0 commit comments