workder节点运行命令提示加入成功,但是master查看没有得到

来源:1-6 向集群加入worker节点

喵的薛定谔i

2018-10-04

根据之前问的,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

显示成功,并有加入的命令

  • 在k8s2机器上运行join命令(xxx是master的公网IP)
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.

问题是:

  • 切换至master分支之后,验证是否加入,仍然只显示master这个node
kubectl get nodes
  • admin.conf文件scp过去之后,在k8s2上面运行kubectl get nodes的时候,没有任何反应,卡住了,只能ctl + c退出
写回答

2回答

喵的薛定谔i

提问者

2018-10-09

已经解决

0
1
williamluo
我也是没有发现workder节点运行命令提示加入成功,但是master查看没有得到,请问是什么问题?
2019-11-15
共1条回复

春松

2018-10-05

我的是修改hostname及hosts文件。

0
1
喵的薛定谔i
master节点的机器以及worker机器都要加吗?
2018-10-06
共1条回复

Kubernetes实战 高可用集群搭建,配置,运维与应用

以生产为目标,原理+操作, Kubernetes结合典型云原生应用

794 学习 · 196 问题

查看课程