# 开机启动 [root@localhost ~]# systemctl enable docker Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@localhost ~]# kubeadm join --token 61dcb1.71255fe1915d0048 192.168.56.101:6443 --discovery-token-ca-cert-hash sha256:28116d25a952e58d4ad94c68a5190e17bebac4f7d066fe3a9c8dc78f93eb4108 [preflight] Running pre-flight checks. [WARNING Hostname]: hostname "localhost.node" could not be reached [WARNING Hostname]: hostname "localhost.node" lookup localhost.node on 192.168.7.2:53: no such host [WARNING FileExisting-crictl]: crictl not found in system path [discovery] Trying to connect to API Server "192.168.56.101:6443" [discovery] Created cluster-info discovery client, requesting info from "https://192.168.56.101:6443" [discovery] Requesting info from "https://192.168.56.101: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 "192.168.56.101:6443" [discovery] Successfully established connection with API Server "192.168.56.101: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.
Run 'kubectl get nodes' on the master to see this node join the cluster.
可以看到,Node 反馈已经加入成功,我们到 Master 确认一下:
1 2 3 4
[root@localhost ~]# kubectl get nodes NAME STATUS ROLES AGE VERSION localhost.master NotReady master 23m v1.9.0 localhost.node NotReady <none> 12m v1.9.0
[root@localhost ~]# kubeadm join --token 8a82fd.05d65480b13cbc10 192.168.56.100:6443 --discovery-token-ca-cert-hash sha256:bea1c696f02db219ce561b3213556b0a098890f6485fbac6c0014012b9d214ea [preflight] Running pre-flight checks. [WARNING Hostname]: hostname "localhost.node01" could not be reached [WARNING Hostname]: hostname "localhost.node01" lookup localhost.node01 on 192.168.7.2:53: no such host [WARNING FileExisting-crictl]: crictl not found in system path [preflight] Some fatal errors occurred: [ERROR FileContent--proc-sys-net-bridge-bridge-nf-call-iptables]: /proc/sys/net/bridge/bridge-nf-call-iptables contents are not set to 1 [preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`