k8s 删除 node节点
查看现有状态
[root@master ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
master NotReady control-plane 72s v1.25.0
node1 NotReady <none> 11s v1.25.0
node2 NotReady <none> 7s v1.25.0
一、驱逐节点
[root@master ~]# kubectl cordon node1
node/node1 cordoned
[root@master ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
master NotReady control-plane 7m4s v1.25.0
node1 NotReady,SchedulingDisabled <none> 6m3s v1.25.0
node2 NotReady <none> 5m59s v1.25.0
二、删除该节点
[root@master ~]# kubectl delete node node1
node "node1" deleted
[root@master ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
master NotReady control-plane 7m13s v1.25.0
node2 NotReady <none> 6m8s v1.25.0
三、若需要重新部署该节点
- 在该节点上执行kubeadm reset
[root@node1 ~]# kubeadm reset
W1123 18:03:42.930664 15464 preflight.go:55] [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
W1123 18:03:45.173129 15464 removeetcdmember.go:85] [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 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] The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d The 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.
四、设置节点为不可调度
[root@master ~]# kubectl drain 【节点名】 --ignore-daemonsets
k8s 删除 node节点的更多相关文章
- k8s集群-node节点设置不可调度或者删除node节点
在master 执行1, 不可调度 kubectl cordon k8s-node- kubectl uncordon k8s-node- #取消 2,驱逐已经运行的业务容器 kubectl drai ...
- k8s kubernetes给node节点添加标签和删除node节点标签
node节点IP 192.168.1.205 给节点添加标签的命令 添加label语法 kubectl label nodes <node-name> <label-key>= ...
- centos8平台redis cluster集群添加/删除node节点(redis5.0.7)
一,当前redis cluster的node情况: 我们的添加删除等操作都是以这个cluster作为demo cluster采用六台redis,3主3从 redis1 : ip: 172.17.0.2 ...
- raspberrypi系统在加入k8s作为node节点时遇到的问题
新买的树莓派4b到货后就迫不及待的烧录上raspberrypi系统,将新派加入我的k8s集群,期间遇到了点小挫折,好歹也一个一个解决了: 一.kubelet版本不对导致无法加入k8s集群 在执行kub ...
- 第三章 k8s的node节点配置
一.修改主机名 hostnamectl set-hostname xxx 二.修改hosts文件vim /etc/hosts 三.将写好的hosts文件拷贝到其他节点 scp /etc/hosts r ...
- k8s的node节点无法调度的问题
1.现象,创建deployment时 2.查看污点 [fedora@k8s-cluster--ycmwlao4q5wz-master- ~]$ kubectl describe node k8s-cl ...
- k8s的node节点,执行kubectl get XXX报错
报错现象: [root@localhost ~]# kubectl get nodes The connection to the server localhost:8080 was refused ...
- k8s删除一个Node并重新加入集群
k8s删除一个节点使用以下命令 删除一个节点前,先驱赶掉上面的pod kubectl drain 172.17.3.51 --delete-local-data 然后我们来删除节点 kubectl d ...
- 重置node节点
删除node节点 删除通过csr请求后产生的所有文件和证书 [root@lab1 ~]# rm -rf /etc/kubernetes/kubelet.conf [root@lab1 ~]# rm - ...
- Kubernetes移除node节点
1.kubectl delete node {{节点名称}} 2.删除node节点上由kubelet自动生成的kubelet.kubeconfig配置文件,和ssl密钥证书kubelet.key,ku ...
随机推荐
- 突如其来的&quot;中断异常&quot;,我(Java)该如何处理?
# **一.何为异常?** ## 1.生活中的实例 生活中存在许多不正常: 上班路上自行车掉链子 上厕所手机掉马桶 下班回家钥匙丢失 ....... 2.程序中的实例 我们的代码中也许存在许多纰漏,导 ...
- 轻松理解Promise.all 、Promise.then、Promise.race有什么区别以及使用方法
简单来说呢,Promse.all一般应用于某个场景需要多个接口数据合并起来才能实现 有个极大地好处我必须说一下,请求顺序和获取数据顺序是一样的哟,大可放心使用~~ const success1 = n ...
- Stream中的常用方法_count-Stream中的常用方法_limit
package A_Lian_two.D04; import java.util.stream.Stream; public class Demo06Stream_limit { public sta ...
- CSS-@规则(At-rules)常用语法使用总结
At-rules规则是目前CSS中一种常见的语法规则,它使用一个"@"符号加一个关键词定义,后面跟上语法区块,如果没有则以分号结束即可. 这种规则一般用于标识文档.引入外部样式.条 ...
- nexus私服搭建的上传和下载
下载 方法1 下载应该先在nexus中创建相关的库(宿主库.代理库.仓库组),也可以使用原有的库 随后在pom文件中增加以下代码,即可从私服中下载相关的依赖包(注:依赖包的下载首先基于本地库,本地库没 ...
- C-05\函数的底层原理
一.程序运行时内存四大区 wres(内存属性): w:write(可写) r:read(可读) e:execute(可执行) s:share(可共享) 任何操作系统(windows.liunx.安卓. ...
- Emacs单文件配置
编辑 ~/.emacs 输入以下内容 ;; 编码 (set-language-info "UTF-8" 'coding-priority '(utf-8 gb18030 gbk g ...
- Spring03-IOC-循环依赖的实现(Debug查看spring解决循环依赖的过程)
1 什么是循环依赖 如下,有类A和B,A中有一个类型为B的属性b,B中有一个类型为A的属性a,A和B相互依赖 public class A { private B b; public B getB() ...
- .net core 阿里云接口之拷贝文件
紧接上文, 1).net core 阿里云接口之获取临时访问凭证_SunshineGGB的博客-CSDN博客 2).net core 阿里云接口之将指定的OSS文件下载到流_SunshineGGB的博 ...
- 【翻译】API 链接与键:为什么应该使用链接而不是键来表示 API 中的关系
翻译自原文: https://cloud.google.com/blog/products/application-development/api-design-why-you-should-use- ...