This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.10.2.2. 在 CLI 中将节点设置为维护模式
通过将节点标记为不可调度,并使用 oc adm drain 命令从节点驱除或删除 pod,将节点设置为维护模式。
流程
将节点标记为不可调度。节点状态变为
NotReady,SchedulingDisabled。oc adm cordon <node1>
$ oc adm cordon <node1>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 排空节点以准备进行维护。节点实时迁移
LiveMigratable条件设置为True,spec:evictionStrategy字段设置为LiveMigrate的虚拟机实例。该节点上的所有其他 pod 和虚拟机均被删除,并会在另一节点上重新创建。oc adm drain <node1> --delete-emptydir-data --ignore-daemonsets=true --force
$ oc adm drain <node1> --delete-emptydir-data --ignore-daemonsets=true --forceCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
--delete-emptydir-data标志会删除节点上使用emptyDir卷的任何虚拟机实例。这些卷中的数据是临时的,在终止后可以被安全地删除。 -
--ignore-daemonsets=true标志确保守护进程集被忽略,pod 驱除可以成功继续。 -
需要
--force标志来删除不是由副本集或守护进程设置控制器管理的 pod。
-