Documentation
Delete Workload Clusters ¶
To delete a workload cluster, run the tanzu cluster delete
command.
To list all of the workload clusters that a management cluster is managing, run the
tanzu cluster list
command.tanzu cluster list
(Optional) Depending on the cluster contents and cloud infrastructure, you may need to delete in-cluster volumes and services before you delete the workload cluster. For more information, see the following sections below:
Delete in-cluster volumes and services
To delete a workload cluster, run:
tanzu cluster delete <WORKLOAD-CLUSTER>
If the cluster is running in a namespace other than the
default
namespace, you must specify the--namespace
option to delete that cluster.tanzu cluster delete my-cluster --namespace=my-namespace
Delete in-cluster volumes and services ¶
If the cluster you want to delete contains persistent volumes or services such as load balancers and databases, you may need to manually delete them before you delete the cluster itself. What you need to pre-delete depends on your cloud infrastructure:
vSphere
- Load Balancer: see Delete Service type LoadBalancer below.
- Persistent Volumes and Persistent Volume Claims: see Delete Persistent Volume Claims and Persistent Volumes, below.
AWS
- Load Balancers: Application or Network Load Balancers (ALBs or NLBs) in the cluster’s VPC, but not Classic Load Balancers (ELB v1).
- Other Services: Any subnet/EC2 backed service in cluster’s VPC, such as an RDS.
- Persistent Volumes and Persistent Volume Claims: see Delete Persistent Volume Claims and Persistent Volumes, below.
Azure
- No action required. Deleting a workload cluster deletes everything that was created in the cluster’s resource group.
Delete Service Type LoadBalancer ¶
To delete Service type LoadBalancer (Service) in a cluster:
Set
kubectl
to the cluster’s context.kubectl config set-context my-cluster@user
Retrieve the cluster’s list of services.
kubectl get service
Delete each Service type
LoadBalancer
.kubectl delete service <my-svc>
Delete Persistent Volume (PV) and Persistent Volume Claim (PVC) objects in a cluster ¶
Run
kubectl config set-context my-cluster@user
to setkubectl
to the cluster’s context.Run
kubectl get pvc
to retrieve the cluster’s Persistent Volume Claims (PVCs).For each PVC:
To identify the PV it is bound to, run the following command, the PV is listed in the command output as Volume, after Status: Bound:
kubectl describe pvc <my-pvc>
To determine if its bound PV
Reclaim Policy
isRetain
orDelete
, run.kubectl describe pv <my-pv>
To delete the PVC, run:
kubectl delete pvc <my-pvc>
If the PV reclaim policy is
Retain
, run the following command and then log into your cloud portal and delete the PV object there:kubectl delete pv <my-pvc>
IMPORTANT: Do not change context or edit the .kube-tkg/config
file while Tanzu operations are running.