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.

  1. Shut down the system by stopping the kubelet on the target node by running the following command:

    sudo systemctl stop kubelet
    
  2. 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

  1. Restart the docker by running the following command:

    sudo systemctl start docker
    
  2. 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

  1. If the kubelet service is unsuccessful, view the logs for the kubelet by running the following command:

    sudo journalctl -e -u kubelet
    
  2. 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.

  3. 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 the ReplicationController, ReplicaSet, Job, and StatefulSet 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.

  4. 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.