< img height="1" width="1" style="display:none;" alt="" src="https://px.ads.linkedin.com/collect/?pid=3131724&fmt=gif" />

Delete Kubernetes Nodes

Cordon a Kubernetes Node

Marking a node as unschedulable prevents the scheduler from placing new Pods onto that node while not affecting existing Pods on the node. This is useful as a preparatory step before a node reboot or other maintenance.

Log in to the console as admin and go to the Cluster Management page. To mark a node unschedulable, choose Cluster Nodes under Nodes from the left menu, find a node you want to remove from the cluster, and click Cordon. Alternatively, you can run the command kubectl cordon $NODENAME directly. See Kubernetes Nodes for more details.

Note

Pods that are part of a DaemonSet tolerate being run on an unschedulable node. DaemonSets typically provide node-local services that should run on the node even if it is being drained of workload applications.

Delete a Kubernetes Node

  1. To delete a node, you need to prepare the configuration file of your cluster first, which is the one created when you set up your cluster. If you do not have it, use KubeKey to retrieve cluster information (a file sample.yaml will be created by default).

    ./kk create config --from-cluster
    
  2. Make sure you provide all the information of your hosts in the configuration file and run the following command to delete a node.

    ./kk delete node <nodeName> -f sample.yaml
    

Note

Deleting the Master node is not supported.

Receive the latest news, articles and updates from KubeSphere


Thanks for the feedback. If you have a specific question about how to use KubeSphere, ask it on Slack. Open an issue in the GitHub repo if you want to report a problem or suggest an improvement.