根据之前问的,master上init的时候,加上了
--apiserver-cert-extra-sans=xxxx
,xxx是master的公网IP地址,命令如下
kubeadm reset
kubeadm init --apiserver-advertise-address=0.0.0.0 --kubernetes-version=1.10.2 --apiserver-cert-extra-sans=xxxx --pod-network-cidr=192.168.16.0/20
显示成功,并有加入的命令
kubeadm join xxx:6443 --token xmru8j.n3vi8uomzgrzm735 --discovery-token-ca-cert-hash sha256:1688d80014c826cbcc06008ac3765c011829429fa154197e8d94a3a9224c0ab2
提示成功:
[preflight] Running pre-flight checks.
[WARNING FileExisting-crictl]: crictl not found in system path
Suggestion: go get github.com/kubernetes-incubator/cri-tools/cmd/crictl
[discovery] Trying to connect to API Server "xxxxx:6443"
[discovery] Created cluster-info discovery client, requesting info from "https://xxxxx:6443"
[discovery] Requesting info from "https://xxxxx:6443" again to validate TLS against the pinned public key
[discovery] Cluster info signature and contents are valid and TLS certificate validates against pinned roots, will use API Server "180.76.161.14:6443"
[discovery] Successfully established connection with API Server "xxxxx:6443"
This node has joined the cluster:
* Certificate signing request was sent to master and a response
was received.
* The Kubelet was informed of the new secure connection details.
kubectl get nodes
admin.conf
文件scp过去之后,在k8s2上面运行kubectl get nodes
的时候,没有任何反应,卡住了,只能ctl + c退出