1

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

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]

任何指针?Kube2sky 日志:

I0423 02:49:39.286489       1 kube2sky.go:436] Etcd server found:  http://127.0.0.1:4001
I0423 02:49:40.295909       1 kube2sky.go:503] Using http://172.17.0.1:8080 for kubernetes master
I0423 02:49:40.296183       1 kube2sky.go:504] Using kubernetes API v1
4

1 回答 1

1

我设置了一些 iptables 规则,这些规则阻止了 docker0 接口上的连接,其中包括 skydns 在内的 kubernetes 服务正在运行。刷新规则后,它起作用了。因此,第一个问题似乎是我的本地设置而不是 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 删除了机密,然后它又开始工作了。

于 2016-05-02T23:32:39.233 回答