前面我們已經(jīng)搭建好環(huán)境,現(xiàn)在需要測試一下dns是否可用
kubectl run curl --image=radial/busyboxplus:curl -i --ttyWaiting for pod default/curl-2421989462-3xx4j to be running, status is Pending, pod ready: falseWaiting for pod default/curl-2421989462-3xx4j to be running, status is Pending, pod ready: falseWaiting for pod default/curl-2421989462-3xx4j to be running, status is Pending, pod ready: falseWaiting for pod default/curl-2421989462-3xx4j to be running, status is Pending, pod ready: false
進(jìn)入后執(zhí)行nslookup kubernetes.default確認(rèn)解析正常凳谦。
[ root@curl-2421989462-3xx4j:/ ]$ nslookup kubernetes.defaultServer: 10.96.0.10
Address 1: 10.96.0.10 kube-dns.kube-system.svc.cluster.local
Name: kubernetes.default
Address 1: 10.96.0.1 kubernetes.default.svc.cluster.local
測試OK后忆畅,刪除掉curl這個Pod。
kubectl delete deploy curl`
到這一步就可以向集群中發(fā)布微服務(wù)了尸执,同時可以使用kubeadm join命令添加新的Node到集群中家凯。