Rate This Document
Findability
Accuracy
Completeness
Readability

Deleting a Worker Node

To delete a worker node, perform the following operations on the master node.

  1. Search for cluster information and create a configuration file.
    ./kk create config --from-cluster
    • The default name of the generated configuration file is sample.yaml. Skip this step if a configuration file (for example, config-sample.yaml) already exists on your node.
    • You need to personally set some parameters in the configuration file and delete the target node information from sections hosts and roleGroups. For details, see the configuration example in 5. Note that you need to modify SHOULD_BE_REPLACED in the configuration file based on actual requirements.
  2. Delete the node. Replace NODE_NAME in the following command with the name of the node to be deleted.
    kubectl cordon NODE_NAME 
    ./kk delete node NODE_NAME -f sample.yaml

    After running the command for deleting the node, the prompt "Are you sure to delete this node? [yes/no]:" is displayed. Type yes and press Enter.

    If execute successfully is returned, the node is successfully deleted.

  3. Run the following command on the deleted node to delete the ~/.kube directory and all its subdirectories and files:
    rm -rf ~/.kube