kubectl get deployments --namespace=kube-system core-dns
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
core-dns 1 1 1 1 45d
此外,还有一个
Kubernetes
服务可以为
DNS
服务器提供负载均衡:
$
kubectl get services --namespace=kube-system core-dns
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
core-dns 10.96.0.10 <none> 53/UDP,53/TCP 45d
以上输出表明这个集群
DNS
服务的地址为
10.96.0.10
。如果登录到集群的容
器中,你就可以看到这个地址写到了容器的
/etc/resolv.conf
文件中。
从
Kubernetes 1.12
开始,
Kubernetes
的
DNS
服务由
kube-dns
改成了
core-
dns
。因此,如果你运行的旧版的 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.