gpt4 book ai didi

Kubernetes API pod 拒绝连接

转载 作者:行者123 更新时间:2023-12-02 11:29:33 25 4
gpt4 key购买 nike

我目前正在尝试使用 CoreOS 和 Kubernetes 设置一个小型集群。首先,我正在关注 this 教程。我有三台 CoreOS 机器在 VirtualBox 上运行,使用 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]

最佳答案

您将在下一步中设置 apiserver。它是服务于 127.0.0.1:8080 的东西。一旦 apiserver 启动,kubelet 应该停止提示。 curl您提到的命令也应该在那时起作用。

关于Kubernetes API pod 拒绝连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33482418/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com