在master2上查看token
[root@master2 flannel]# kubeadm token list TOKEN TTL EXPIRES USAGES DESCRIPTION EXTRA GROUPS cjqgba.30wm6rmr5sug6avq 23h 2021-06-15T11:00:32+08:00 authentication,signing <none> system:bootstrappers:kubeadm:default-node-token rijbv2.50zq7e6zkpixxcg4 21h 2021-06-15T09:21:44+08:00 authentication,signing <none> system:bootstrappers:kubeadm:default-node-token rwnmlr.06ncpu0wtko1q50v 23h 2021-06-15T11:12:10+08:00 authentication,signing <none> system:bootstrappers:kubeadm:default-node-token集群网络重新安装,因为添加了新的node节点,这里的操作相当于在我的master2节点的操作
检查状态
kubectl get node kubectl get pods --all-namespaces 测试kubernetes集群在Kubernetes集群中创建一个pod,验证是否正常运行:(相当于在master2节点中进行这些操作)
$ kubectl create deployment nginx --image=nginx $ kubectl expose deployment nginx --port=80 --type=NodePort $ kubectl get pod,svc这里还可以通过虚拟ip进行访问
访问地址::Port
B站学习网址:k8s教程由浅入深-尚硅谷_哔哩哔哩_bilibili