Delete specific worker node when scale in vSphere with Tanzu guest cluster
search cancel

Delete specific worker node when scale in vSphere with Tanzu guest cluster

book

Article ID: 391365

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

When scale in worker node of vSphere with Tanzu guest cluster (TKC), worker nodes will be deleted randomly. The article is to provide solution how to delete specific worker node.

Environment

VMware vSphere with Tanzu

Resolution

Follow the steps to delete specific worker node when scale in:

  1. SSH one of Supervisor node with the KB Troubleshooting vSphere with Tanzu (TKGS) Supervisor Control Plane VMs
  2. Get the machine class of the TKC:

    kubectl get machine -n <namespace>

  3. Annotate the worker node:

    kubectl annotate machine -n <namespace> <tkc-worker-node-need-delete> "cluster.x-k8s.io/delete-machine"="yes"

  4. Edit the TKC: 

    kubectl edit tkc -n <namespace> <tkc-name>

  5. Scale in the workers by decreasing the replicas number:

    nodePools:
    - name: worker
      replicas: #

  6. Save the change.

Additional Information