以下是一些细节,以及为什么这对我下一步测试非常重要:
我在Kube2Sky日志中唯一看到的是找到了etcd。我想我应该看到的不仅仅是这个?
[fedora@kubemaster ~]$ kubectl logs kube-dns-v10-q9mlb -c kube2sky --namespace=kube-system
I0118 17:42:24.639508 1 kube2sky.go:436] Etcd server found: http://127.0.0.1:4001
I0118 17:42:25.642366 1 kube2sky.go:503] Using https://10.254.0.1:443 for kubernetes master
I0118 17:42:25.642772 1 kube2sky.go:504] Using kubernetes API
[fedora@kubemaster ~]$
更多详情:
[fedora@kubemaster ~]$ kubectl exec -t busybox -- nslookup kubelab.local
Server: 10.254.0.10
Address 1: 10.254.0.10
nslookup: can't resolve 'kubelab.local'
error: error executing remote command: Error executing command in container: Error executing in Docker Container: 1
fedora@kubemaster ~]$ etcdctl ls --recursive
/kubelab.local
/kubelab.local/network
/kubelab.local/network/config
/kubelab.local/network/subnets
/kubelab.local/network/subnets/172.16.46.0-24
/kubelab.local/network/subnets/172.16.12.0-24
/kubelab.local/network/subnets/172.16.70.0-24
/kubelab.local/network/subnets/172.16.21.0-24
/kubelab.local/network/subnets/172.16.54.0-24
/kubelab.local/network/subnets/172.16.71.0-24
......等等......钥匙都在那里,正如所料......
答案 0 :(得分:2)
我看到你将默认的“cluster.local”更改为“kubelab.local”。你是否更改了skydns配置以服务该域?
kubectl exec --namespace=kube-system $podname -c skydns ps
PID USER COMMAND
1 root /skydns -machines=http://127.0.0.1:4001 -addr=0.0.0.0:53 -ns-rotate=false -domain=cluster.local.
11 root ps
请注意-domain
标记。
如果这是正确的,请检查您是否已将正确的--cluster-dns
和--cluster-domain
标记传递给Kubelet。然后从无法进行DNS查找的pod中显示/etc/resolv.conf。