kubernetes 中排查dns解析问题
参考官方:https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/
文档中提供的dnsutils镜像下载不到,修改镜像地址
wget https://k8s.io/examples/admin/dns/dnsutils.yaml
# cat dnsutils.yaml
apiVersion: v1
kind: Pod
metadata:
name: dnsutils
namespace: default
spec:
containers:
- name: dnsutils
image: tutum/dnsutils
command:
- sleep
- "infinity"
imagePullPolicy: IfNotPresent
restartPolicy: Always
# kubectl apply -f dnsutils.yaml
# kubectl get pod
NAME READY STATUS RESTARTS AGE
dnsutils 1/1 Running 0 27s
# kubectl exec -i -t dnsutils -- nslookup kubernetes.default
Server: 10.43.0.10
Address: 10.43.0.10#53
Name: kubernetes.default.svc.cluster.local
Address: 10.43.0.1