Shutdown one of Workload Clusters without shutting down Supervisor cluster
search cancel

Shutdown one of Workload Clusters without shutting down Supervisor cluster

book

Article ID: 445627

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

  • There are multiple Workload Clusters enabled in the same Supervisor Cluster.
  • For maintenance purposes, one of the Workload Clusters needs to be shut down.

Environment

VMware vSphere Kubernetes Service

Resolution

1. Stop workloads running within the workload cluster.

2. While in the Supervisor cluster context, mark the target cluster as paused. This prevents Cluster API (CAPI) from determining that nodes have failed and triggering remediation when they are powered off.
kubectl patch cluster <TARGET_CLUSTER_NAME> -n <NAMESPACE> --type merge -p '{"spec":{"paused":true}}'
Verify that the target cluster is paused:
kubectl get cluster <TARGET_CLUSTER_NAME> -n <NAMESPACE> -o yaml | grep -i paused
The Supervisor will now ignore health checks for this workload cluster.

3. Get VM name inside the Workload Cluster:
kubectl get vm -n <NAMESPACE> | grep <cluster_name>
Power off VM:
kubectl patch virtualmachine <VM_NAME> -n <NAMESPACE> --type merge -p '{"spec":{"powerState": "PoweredOff"}}'

Additional Information

Power on the Workload Cluster:

1. Power On VM:
kubectl patch virtualmachine <VM_NAME> -n <NAMESPACE> --type merge -p '{"spec":{"powerState": "PoweredOn"}}'

2. Remove the pause mark on target cluster:
kubectl patch cluster <TARGET_CLUSTER_NAME> -n <NAMESPACE> --type merge -p '{"spec":{"paused": false}}'
Verify that the target cluster is not paused:
kubectl get cluster <TARGET_CLUSTER_NAME> -n <NAMESPACE> -o yaml | grep -i paused

3. Start workloads running within the workload cluster.