skydns无法在kubernetes集群中解析dns

时间:2016-04-23 03:17:05

标签: kubernetes skydns

我正在使用此模板http://kubernetes.io/docs/getting-started-guides/docker-multinode/skydns.yaml.in为kubernetes设置skydns。但它无法解决dns。在寻找解决方案后,还在kube2sky参数中添加了-kube_master_url,但仍然存在同样的问题。这是skydns日志:

InetAddress address = client.discoverHost(54777, 5000);

任何指针? Kube2sky记录:

2016/04/23 02:49:26 skydns: falling back to default configuration,  could not read from etcd: 501: All the given peers are not reachable (failed to propose on members [http://127.0.0.1:4001] twice [last error: Get http://127.0.0.1:4001/v2/keys/skydns/config?quorum=false&recursive=false&sorted=false: dial tcp 127.0.0.1:4001: connection refused]) [0]
2016/04/23 02:49:26 skydns: ready for queries on cluster.local. for tcp://0.0.0.0:53 [rcache 0]
2016/04/23 02:49:26 skydns: ready for queries on cluster.local. for udp://0.0.0.0:53 [rcache 0]
2016/04/23 02:49:33 skydns: error from backend: 501: All the given peers are not reachable (failed to propose on members [http://127.0.0.1:4001] twice [last error: Get http://127.0.0.1:4001/v2/keys/skydns/local/cluster/svc/default/kubernetes?quorum=false&recursive=true&sorted=false: dial tcp 127.0.0.1:4001: connection refused]) [0]

1 个答案:

答案 0 :(得分:1)

我有一些iptables规则集阻止了docker0接口上的连接,其中kubernetes服务包括skydns正在运行。冲洗规则后它起作用了。因此,第一个问题似乎是我的本地设置而不是skydns。

然而,安装本地docker注册表后问题又出现了,我收到了这个错误:

I0427 20:30:45.183419 1 kube2sky.go:627] Ignoring error while waiting  for service default/kubernetes: Get https://10.0.0.1:443/api/v1/namespaces/default/services/kubernetes: x509: certificate signed by unknown authority. Sleeping 1s before retrying.

作为一种解决方法,我使用kubectl delete secrets/default-token-q4siz删除了秘密,然后重新启动了skydns并重新开始工作。