Kubernetes API pod拒绝连接

Kubernetes API pod拒绝连接,kubernetes,coreos,Kubernetes,Coreos,我目前正在尝试使用CoreOS和Kubernetes建立一个小型集群。首先,我将学习本教程。我有三台CoreOS机器在VirtualBox上运行,使用vagrant。我达到了教程的结尾,但被卡住了 我似乎能够使用systemctl start kubelet启动kubelet,但似乎无法连接到API服务器。似乎它没有启动API服务器,但尝试先连接到它 当我输入curl时http://127.0.0.1:8080/version,我得到curl:(7)连接到127.0.0.1端口8080失败:连接

我目前正在尝试使用CoreOS和Kubernetes建立一个小型集群。首先,我将学习本教程。我有三台CoreOS机器在VirtualBox上运行,使用vagrant。我达到了教程的结尾,但被卡住了

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

当我输入
curl时http://127.0.0.1:8080/version
,我得到
curl:(7)连接到127.0.0.1端口8080失败:连接被拒绝
返回

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]

您将在下一步中设置apiserver。这是服务于127.0.0.1:8080的事物。一旦apiserver启动,kubelet应该停止抱怨。您提到的
curl
命令在这一点上也应该起作用。

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

嗨,谢谢你的回答。我在本教程的第3部分看到了“设置kube apiserver Pod”一节。奇怪的是,在第2部分中,他们要求您等待api服务器出现。我在下周一之前没有办法测试这个。我会告诉你它是否成功。我似乎错过了一些东西,因为第3部分没有谈到设置API服务器。问题仍然存在。它表示要
wgethttps://raw.githubusercontent.com/coreos/pods/master/kubernetes.yaml
sudo cp kubernetes.yaml/etc/kubernetes/manifests/
kubernetes.yaml
包含运行kube apiserver的说明,
cp
命令将文件放入一个目录中,kubelet将自动检测并读取文件并启动apiserver。执行该步骤并等待片刻后,
ps-ef
应显示
kube-apiserver
正在运行。这将在端口127.0.0.1:8080上提供服务,然后kubelet将与之对话。@EricTune如果您是指命令
kubectl运行kubernetes bootcamp--image=gci.io/google samples/kubernetes bootcamp:v1--port=8080
,这是在遇到此问题之前的一节中完成的。我没有在OP中遇到这个问题,但类似的问题