Kubernetes API pod拒绝连接

时间:2015-11-02 16:33:03

标签: kubernetes coreos

我目前正在尝试使用CoreOS和Kubernetes设置一个小型群集。要开始使用,请关注this教程。我有三台运行在VirtualBox上的CoreOS机器,使用vagrant。我到达了教程的second step,但卡住了。

我似乎可以使用systemctl start kubelet启动kubelet,但我似乎无法连接到API服务器。似乎它没有启动API服务器,但是首先尝试连接它。

当我输入curl http://127.0.0.1:8080/version时,我会回复curl: (7) Failed to connect to 127.0.0.1 port 8080: Connection refused

Journalctl只是告诉我kubelet正在尝试连接到API服务器,并且由于无法访问API服务器,我无法使用kubectl来查看Pod发生了什么。我应该如何解决这个问题?

修改

我手动执行了docker命令,得到了以下内容:

I1109 09:30:18.680796       1 plugins.go:69] No cloud provider specified.
I1109 09:30:18.826523       1 master.go:273] Node port range unspecified. Defaulting to 30000-32767.
E1109 09:30:18.847815       1 reflector.go:136] Failed to list *api.ResourceQuota: Get http://127.0.0.1:8080/api/v1/resourcequotas: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:18.848277       1 reflector.go:136] Failed to list *api.Secret: Get http://127.0.0.1:8080/api/v1/secrets?fieldSelector=type%3Dkubernetes.io%2Fservice-account-token: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:18.848581       1 reflector.go:136] Failed to list *api.ServiceAccount: Get http://127.0.0.1:8080/api/v1/serviceaccounts: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:18.848766       1 reflector.go:136] Failed to list *api.LimitRange: Get http://127.0.0.1:8080/api/v1/limitranges: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:18.848943       1 reflector.go:136] Failed to list *api.Namespace: Get http://127.0.0.1:8080/api/v1/namespaces: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:18.849698       1 reflector.go:136] Failed to list *api.Namespace: Get http://127.0.0.1:8080/api/v1/namespaces: dial tcp 127.0.0.1:8080: connection refused
[restful] 2015/11/09 09:30:18 log.go:30: [restful/swagger] listing is available at https://172.17.8.101:443/swaggerapi/
[restful] 2015/11/09 09:30:18 log.go:30: [restful/swagger] https://172.17.8.101:443/swaggerui/ is mapped to folder /swagger-ui/
E1109 09:30:19.849251       1 reflector.go:136] Failed to list *api.Secret: Get http://127.0.0.1:8080/api/v1/secrets?fieldSelector=type%3Dkubernetes.io%2Fservice-account-token: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:19.850278       1 reflector.go:136] Failed to list *api.ResourceQuota: Get http://127.0.0.1:8080/api/v1/resourcequotas: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:19.852294       1 reflector.go:136] Failed to list *api.ServiceAccount: Get http://127.0.0.1:8080/api/v1/serviceaccounts: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:19.852462       1 reflector.go:136] Failed to list *api.LimitRange: Get http://127.0.0.1:8080/api/v1/limitranges: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:19.852802       1 reflector.go:136] Failed to list *api.Namespace: Get http://127.0.0.1:8080/api/v1/namespaces: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:19.854201       1 reflector.go:136] Failed to list *api.Namespace: Get http://127.0.0.1:8080/api/v1/namespaces: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:20.852158       1 reflector.go:136] Failed to list *api.Secret: Get http://127.0.0.1:8080/api/v1/secrets?fieldSelector=type%3Dkubernetes.io%2Fservice-account-token: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:20.852217       1 reflector.go:136] Failed to list *api.ResourceQuota: Get http://127.0.0.1:8080/api/v1/resourcequotas: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:20.853732       1 reflector.go:136] Failed to list *api.ServiceAccount: Get http://127.0.0.1:8080/api/v1/serviceaccounts: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:20.854456       1 reflector.go:136] Failed to list *api.LimitRange: Get http://127.0.0.1:8080/api/v1/limitranges: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:20.855127       1 reflector.go:136] Failed to list *api.Namespace: Get http://127.0.0.1:8080/api/v1/namespaces: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:20.855954       1 reflector.go:136] Failed to list *api.Namespace: Get http://127.0.0.1:8080/api/v1/namespaces: dial tcp 127.0.0.1:8080: connection refused

... Repeated many times ...

E1109 09:30:35.882091       1 reflector.go:136] Failed to list *api.Namespace: Get http://127.0.0.1:8080/api/v1/namespaces: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:36.082552       1 reflector.go:136] Failed to list *api.Secret: Get http://127.0.0.1:8080/api/v1/secrets?fieldSelector=type%3Dkubernetes.io%2Fservice-account-token: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:36.282562       1 reflector.go:136] Failed to list *api.ResourceQuota: Get http://127.0.0.1:8080/api/v1/resourcequotas: dial tcp 127.0.0.1:8080: connection refused
E1109 09:30:36.482611       1 reflector.go:136] Failed to list *api.ServiceAccount: Get http://127.0.0.1:8080/api/v1/serviceaccounts: dial tcp 127.0.0.1:8080: connection refused
F1109 09:30:36.664838       1 controller.go:80] Unable to perform initial IP allocation check: unable to refresh the service IP block: 501: All the given peers are not reachable (failed to propose on members [172.17.8.101 172.17.8.102 172.17.8.103] twice [last error: Get 172.17.8.103/v2/keys/registry/ranges/serviceips?quorum=false&recursive=false&sorted=false: unsupported protocol scheme ""]) [0]

2 个答案:

答案 0 :(得分:0)

您将在下一步中设置apiserver。这是在127.0.0.1:8080服务的东西。一旦apiserver启动,kubelet应该停止抱怨。你提到的:h window :h :sp :h :sb :h :b :h 'hidden' :h :_% :h CTRL-W 命令也应该在那时工作。

答案 1 :(得分:0)

我现在放弃了这个设置。我认为它与ssl设置中的配置错误有关。现在我只使用this指南,结合前面提到的教程,并从配置文件中删除所有与ssl相关的东西。这给了我现在的工作设置。