节点加入没成功

来源:2-8 Kubeadm节点加入

KimStorm

2024-06-08


root@ubuntu:~# kubectl get nodes
NAME     STATUS     ROLES                  AGE   VERSION
master   NotReady   control-plane,master   63m   v1.23.9
ubuntu   NotReady   <none>                 61m   v1.23.9
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~#
root@ubuntu:~# kubectl get nodes
NAME     STATUS     ROLES                  AGE   VERSION
master   NotReady   control-plane,master   66m   v1.23.9
ubuntu   NotReady   <none>                 64m   v1.23.9


Your Kubernetes control-plane has initialized successfully!

To start using your cluster, you need to run the following as a regular user:

  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

Alternatively, if you are the root user, you can run:

  export KUBECONFIG=/etc/kubernetes/admin.conf

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
  https://kubernetes.io/docs/concepts/cluster-administration/addons/

Then you can join any number of worker nodes by running the following on each as root:

kubeadm join 192.168.137.135:6443 --token abcdef.0123456789abcdef \
        --discovery-token-ca-cert-hash sha256:92b160a90ef52d9e75741414ff84a084c7c4705af9ffcb7705aa344e2e304fbe
root@ubuntu:~/k8s_install_pkg# mkdir -p $HOME/.kube
root@ubuntu:~/k8s_install_pkg# sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
root@ubuntu:~/k8s_install_pkg# sudo chown $(id -u):$(id -g) $HOME/.kube/config
root@ubuntu:~/k8s_install_pkg#
root@ubuntu:~/k8s_install_pkg#
root@ubuntu:~/k8s_install_pkg# ll

master节点初始化成功后:

  mkdir -p $HOME/.kube
  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  sudo chown $(id -u):$(id -g) $HOME/.kube/config

这三个步骤需要操作么,需要再node节点做一遍么?

写回答

1回答

暮闲

2024-06-11

安装网络插件之后 节点就Ready了

0
0

Kubernetes系统精讲 Go语言实战K8S集群可视化

核心知识+高阶应用+原理剖析+二次开发 全方位打通K8S生产实践

399 学习 · 265 问题

查看课程