KaaS – Bootstrap cluster deletion

In order to reduce the number of clusters used, it is possible to transfer Cluster API objects (Cluster, MachineDeployment, etc.) from one management cluster to another.


This allows for the movement of Cluster API objects currently located in the bootstrap cluster to your management cluster.


As a result, you will have only one management cluster that will handle both your work clusters and itself.

Prerequisites

Before proceeding with the procedure, you must ensure that:

  1. The target management cluster is properly installed and functional.
  2. No scaling or update operations are currently in progress.
  3. The versions must be identical on both the source and target clusters, whether it’s the Cluster API version and the Provider CAPVCD version.
    • Provider VCD version: kubectl get pod -n capvcd-system -l cluster.x-k8s.io/provider=infrastructure-vcd -o=jsonpath='{range .items[*]}{.status.containerStatuses[0].image}{"\r\n"}{end}'
    • Cluster API provider version: kubectl get pod -n capi-system -l cluster.x-k8s.io/provider=cluster-api -o=jsonpath='{range .items[*]}{.status.containerStatuses[0].image}{"\r\n"}{end}'

For additional information, you can refer to the official Cluster API procedure: HERE

Cluster move

Firstly please connect to the bootstrap cluster:


You can verify your connection to the bootstrap cluster by running the command kubectl get nodes.


Additionally, if you run the command kubectl get cluster, you should see your management cluster. This is one of the objects that will be moved.

#kubectl get nodes

#kubectl get cluster

The CAPVCD provider uses a secret (capi-user-credentials) located in the default namespace, which is not migrated by the clusterctl command.


Therefore, we will copy this secret to the destination cluster.


Please modify the DST variable to point to the kubeconfig file of the destination management cluster.

Locate the kubeconfig file for connecting to your management cluster (destination cluster), and then run the following command:


clusterctl move --to-kubeconfig=/path/to/target/kubeconfig

After running this command, you should no longer have any Cluster objects on your bootstrap cluster.


However, you should see the Cluster object corresponding to your management cluster on your management cluster.