Restarting your cluster
How to stop IBM® Cloud Private cluster node:
Important: Before stopping the kubelet
and docker
service on the node, mark the node as unschedulable. Run the following command:
kubectl cordon 9.111.255.122
Note: Marking the node as unschedulable disables scheduling new pods on the node.
-
Shut down the system by stopping the kubelet on the target node by running the following command:
sudo systemctl stop kubelet
-
Stop the docker containers or the docker runtime by running the following command:
sudo systemctl stop docker
How to start IBM Cloud Private cluster node
-
Restart the docker by running the following command:
sudo systemctl start docker
-
Restart the kubelet and ensure that it is running successfully by running the following command:
sudo systemctl start kubelet sudo systemctl status kubelet
Steps for maintenance
-
If the kubelet service is unsuccessful, view the logs for the kubelet by running the following command:
sudo journalctl -e -u kubelet
-
Mark the node as unschedulable by running the following command:
kubectl cordon 9.111.255.122
Note: Marking the node as unschedulable disables scheduling new pods on the node.
-
Drain the node in preparation for maintenance to remove pods that are running on the node by running the following command:
kubectl drain 9.111.255.122 --grace-period=300 --ignore-daemonsets=true
For additional information about draining the node, see the help for the
kubectl drain
command by entering:kubectl help drain
. Because the node was already marked as unschedulable, the pods from theReplicationController
,ReplicaSet
,Job
, andStatefulSet
deployments are not scheduled to this node. The scheduler moves all workloads to another node that is schedulable.Note: Draining the node from the
DaemonSet
deployment is not required. -
Exit maintenance by running the following command:
kubectl uncordon 9.111.255.122
Note: The alpha feature TaintNodesByCondition
for kube-controller-manager on all master nodes is enabled by default.