当前位置: 首页 > news >正文

k8s-node2 NotReady 节点NotReady如何解决?

从集群中移除 k8s-node2

[root@k8s-master ~]# kubectl delete node k8s-node2
node "k8s-node2" deleted

重置 k8s-node2

登录到 k8s-node2 上,使用以下命令重置该节点,使其退出集群并恢复到初始状态:

[root@k8s-node2 ~]# sudo kubeadm reset
[reset] WARNING: Changes made to this host by 'kubeadm init' or 'kubeadm join' will be reverted.
[reset] Are you sure you want to proceed? [y/N]: y
[preflight] Running pre-flight checks
W1227 04:47:55.563584    1677 removeetcdmember.go:79] [reset] No kubeadm config, using etcd pod spec to get data directory
[reset] No etcd config found. Assuming external etcd
[reset] Please, manually reset etcd to prevent further issues
[reset] Stopping the kubelet service
[reset] Unmounting mounted directories in "/var/lib/kubelet"
[reset] Deleting contents of config directories: [/etc/kubernetes/manifests /etc/kubernetes/pki]
[reset] Deleting files: [/etc/kubernetes/admin.conf /etc/kubernetes/kubelet.conf /etc/kubernetes/bootstrap-kubelet.conf /etc/kubernetes/controller-manager.conf /etc/kubernetes/scheduler.conf]
[reset] Deleting contents of stateful directories: [/var/lib/kubelet /var/lib/dockershim /var/run/kubernetes /var/lib/cni]The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.dThe reset process does not reset or clean up iptables rules or IPVS tables.
If you wish to reset iptables, you must do so manually by using the "iptables" command.If your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)
to reset your system's IPVS tables.The reset process does not clean your kubeconfig files and you must remove them manually.
Please, check the contents of the $HOME/.kube/config file.

重新加入节点

k8s-master 上运行以下命令获取重新加入集群所需的 kubeadm join 命令:

[root@k8s-master ~]# kubeadm token create --print-join-command
kubeadm join 192.168.58.231:6443 --token dnht7t.ym4jms2ctru89j2z --discovery-token-ca-cert-hash sha256:82bc8471036711f1c3d81b733082935177e773396e8bb9a5d15f2a0bf95b137e 

 检查节点状态

[root@k8s-master ~]# kubectl get nodes
NAME         STATUS   ROLES                  AGE    VERSION
k8s-master   Ready    control-plane,master   44h    v1.21.10
k8s-node1    Ready    <none>                 44h    v1.21.10
k8s-node2    Ready    <none>                 108s   v1.21.10
[root@k8s-master ~]# kubectl get pod -A 
NAMESPACE     NAME                                       READY   STATUS    RESTARTS   AGE
kube-system   calico-kube-controllers-697d846cf4-79hpj   1/1     Running   1          44h
kube-system   calico-node-58ss2                          1/1     Running   1          44h
kube-system   calico-node-gc547                          1/1     Running   1          44h
kube-system   calico-node-hdhxf                          1/1     Running   1          44h
kube-system   coredns-6f6b8cc4f6-5nbb6                   1/1     Running   1          44h
kube-system   coredns-6f6b8cc4f6-q9rhc                   1/1     Running   1          44h
kube-system   etcd-k8s-master                            1/1     Running   1          44h
kube-system   kube-apiserver-k8s-master                  1/1     Running   1          44h
kube-system   kube-controller-manager-k8s-master         1/1     Running   1          44h
kube-system   kube-proxy-7hp6l                           1/1     Running   1          44h
kube-system   kube-proxy-ddhnb                           1/1     Running   1          44h
kube-system   kube-proxy-dwcgd                           1/1     Running   1          44h
kube-system   kube-scheduler-k8s-master                  1/1     Running   1          44h

http://www.lryc.cn/news/511618.html

相关文章:

  • Ubuntu通过mDNS实现局域网local域名和octoprint域名访问
  • 短视频矩阵账号管理技术源码搭建详解,支持OEM
  • 【源码 导入教程 文档 讲解】基于springboot校园新闻管理系统源码和论文
  • Spark SQL DML语句
  • 开发微信小程序的过程与心得
  • 【1224】数据结构(sizeof/数组的长度定义/读取字符串函数/线性表长度/左值右值/静态变量/指针与引用)
  • Android笔记(四十一):TabLayout内的tab不滚动问题
  • 基于pytorch的深度学习基础3——模型创建与nn.Module
  • Debian-linux运维-docker安装和配置
  • Docker完整技术汇总
  • 在JavaScript文件中定义方法和数据(不是在对象里定以数据和方法,不要搞错了)
  • python爬虫爬抖音小店商品数据+数据可视化
  • 关于 覆铜与导线之间间距较小需要增加间距 的解决方法
  • uniapp中Nvue白屏问题 ReferenceError: require is not defined
  • 在 Windows 上,如果忘记了 MySQL 密码 重置密码
  • 《PyTorch:从基础概念到实战应用》
  • 前端:改变鼠标点击物体的颜色
  • Java-33 深入浅出 Spring - FactoryBean 和 BeanFactory BeanPostProcessor
  • HTML4笔记
  • python报错ModuleNotFoundError: No module named ‘visdom‘
  • linux-21 目录管理(一)mkdir命令,创建空目录
  • 总结-常见缓存替换算法
  • 【Vue】如何在 Vue 3 中使用组合式 API 与 Vuex 进行状态管理的详细教程
  • VSCode 插件开发实战(十五):如何支持多语言
  • 面试241228
  • ​Python数据序列化模块pickle使用
  • Spring Boot对访问密钥加解密——HMAC-SHA256
  • HTML 元素:网页构建的基础
  • HEIC 是什么图片格式?如何把 iPhone 中的 HEIC 转为 JPG?
  • 爆肝1个月:DDR4 的信号完整性(万字长文SI)