我正在尝试按照此article
中的说明安装kubernetes集群,一台服务器和两台运行Ubuntu 16.04的从服务器当到达将从节点连接到主节点的步骤时,我执行(如kubeadm init
输出步骤所建议的)以下命令:
sudo kubeadm join <master ip>:6443 --token 6wz<...etc...>goj --discovery-token-ca-cert-hash sha256:ac3<...etc...>54a
在这里,我收到错误
.
.
.
[discovery] Trying to connect to API Server "<master ip>:6443"
[discovery] Created cluster-info discovery client, requesting info from "https://<master ip>:6443"
[discovery] Failed to request cluster info, will try again: [Get https://<master ip>:6443/api/v1/namespaces/kube-public/configmaps/cluster-info:
dial tcp <master ip>:6443: getsockopt: connection refused]
.
.
.
我的问题是:
kubeadm init
打印了一条消息Your Kubernetes master has initialized successfully!
,但我不知道如何实际检查这是真的)kubeadm init
期间,我有一个徘徊docker version is greater than the most recently validated version. Docker version: 17.05.0-ce. Max validated version: 17.03
,不知道这是否与我的问题有关)答案 0 :(得分:0)
如果您在apiserver上更改了TLS证书,则可能会发生这种情况。您的服务帐户中将包含无效令牌,并且必须再次删除并制作一个令牌。这样做:
kubectl delete serviceaccount default
kubectl delete serviceaccount --namespace=kube-system default
您可以验证主节点是否成功托管。这将让你知道你的master-url-dns。
kubectl cluster-info