Managing cluster worker nodes
    • PDF

    Managing cluster worker nodes

    • PDF

    Article Summary

    Available in VPC

    You can view the list of worker nodes in a cluster and manage each worker node. In case a graceful termination is required, the kubectl command can be used to safely evict pods from a worker node.

    View worker node list

    The following describes how to view the worker node list in a cluster.

    1. From the VPC environment of NAVER Cloud Platform console, click the Services > Containers > Ncloud Kubernetes Service menus, in order.
    2. Click the individual cluster row from the cluster list.
    3. Click the [View worker node] button under the node pool area in the Cluster Details tab.
      • Click on cluster names to view other clusters' node lists.
      • A normal node's status is shown as Ready. For nodes with malfunctioning Kubelet or nodes that don't function properly for other reasons, the node status is shown as Not Ready.
      • This list can also be checked by clicking Services > Containers > Ncloud Kubernetes Service > Nodes on console.

    View worker node details

    To view the details for each worker node in a cluster, click the name of the node you want to see from the worker node list.

    Worker node maintenance through Kubectl

    If an intervention is required for stable service operation, then you can use Kubectl to safely evict pods from a worker node and end the containers within the pod through graceful termination.

    Check worker node status

    Run the command shown below to check the worker node status.

    $ kubectl --kubeconfig $KUBE_CONFIG describe node $NODENAME
    

    See below for an example of a node in the normal state.

    "conditions": [
      {
        "type": "Ready",
        "status": "True",
        "reason": "KubeletReady",
        "message": "kubelet is posting ready status",
        "lastHeartbeatTime": "2019-06-05T18:38:35Z",
        "lastTransitionTime": "2019-06-05T11:41:27Z"
      }
    ]
    
    • The node's status is returned as a JSON object.
    • In cases where the status value among the node conditions maintains the Unknown or False state for at least 5 minutes, all the pods on the node are scheduled to be deleted by the node controller.
      (In the Ncloud Kubernetes Service for NAVER Cloud Platform, pod-eviction-timeout is set to 5 minutes.)

    Evict pods from worker node

    You can use the kubectl drain command to safely evict pods from a node before performing various tasks, such as node kernel update, infrastructure maintenance, etc. Safely evicted pod containers can be terminated gracefully.

    Caution

    Certain system pods in a node can't be removed with the kubectl drain command.
    For more information about unremovable pods, see kubectl drain.

    The following describes how to evict pods from a worker node using the kubectl drain command.

    1. Run the command shown below to check the node from which you want to evict pods.
    $ kubectl --kubeconfig $KUBE_CONFIG get nodes
    
    1. Among the nodes shown, enter the name of the target worker node you want to evict pods from, and then run the command shown below.
    $ kubectl --kubeconfig $KUBE_CONFIG drain $NODENAME
    
    1. Perform the cluster maintenance task, and use the command shown below to enable pod scheduling for the worker node again.
    $ kubectl --kubeconfig $KUBE_CONFIG uncordon $NODENAME
    

    Was this article helpful?

    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.