Make the new Kubernetes cluster manage itself

Konvoy deploys all cluster lifecycle services to a bootstrap cluster, which then deploys a workload cluster. When the workload cluster is ready, move the cluster lifecycle services to the workload cluster, which is now self-managed. This guide describes how to make a workload cluster self-managed.

Before you start, make sure you have created a workload cluster, as described in Create the Cluster.

Make the new Kubernetes cluster manage itself

If you have not already retrieved the kubeconfig after creating the cluster, use this command before proceeding: dkp get kubeconfig -c ${CLUSTER_NAME} > ${CLUSTER_NAME}.conf

  1. Deploy cluster lifecycle services on the workload cluster:

    dkp create capi-components --kubeconfig ${CLUSTER_NAME}.conf
    CODE

    ✓ Initializing new CAPI components 
    CODE
  2. Move the Cluster API objects from the bootstrap to the workload cluster:

    The cluster lifecycle services on the workload cluster are ready, but the workload cluster configuration is on the bootstrap cluster. The move command moves the configuration, which takes the form of Cluster API Custom Resource objects, from the bootstrap to the workload cluster. This process is also called a Pivot. First unset the kubeconfig and then move the CAPI:

    unset KUBECONFIG
    CODE

    dkp move capi-resources --to-kubeconfig ${CLUSTER_NAME}.conf
    CODE

    Output:

    ✓ Moving cluster resources
    You can now view resources in the moved cluster by using the --kubeconfig flag with kubectl. For example: kubectl --kubeconfig=preprovisioned-example.conf get nodes
    CODE

    NOTE: To ensure only one set of cluster lifecycle services manages the workload cluster, Konvoy first pauses reconciliation of the objects on the bootstrap cluster, then creates the objects on the workload cluster. As Konvoy copies the objects, the cluster lifecycle services on the workload cluster reconcile the objects. The workload cluster becomes self-managed after Konvoy creates all the objects. If it fails, the move command can be safely retried.

  3. Wait for the cluster control-plane to be ready:

    kubectl --kubeconfig ${CLUSTER_NAME}.conf wait --for=condition=ControlPlaneReady "clusters/${CLUSTER_NAME}" --timeout=20m
    CODE

    cluster.cluster.x-k8s.io preprovisioned-example condition met
    CODE
  4. Use the cluster lifecycle services on the workload cluster to check the workload cluster status:

    NOTE: After moving the cluster lifecycle services to the workload cluster, remember to use Konvoy with the workload cluster kubeconfig.

    dkp describe cluster --kubeconfig ${CLUSTER_NAME}.conf -c ${CLUSTER_NAME}
    CODE

    NAME                                                                       READY  SEVERITY  REASON  SINCE  MESSAGE
    Cluster/preprovisioned-example                                             True                     2m31s         
    ├─ClusterInfrastructure - PreprovisionedCluster/preprovisioned-example                                            
    ├─ControlPlane - KubeadmControlPlane/preprovisioned-example-control-plane  True                     2m31s         
    │ ├─Machine/preprovisioned-example-control-plane-6g6nr                     True                     2m33s         
    │ ├─Machine/preprovisioned-example-control-plane-8lhcv                     True                     2m33s         
    │ └─Machine/preprovisioned-example-control-plane-kk2kg                     True                     2m33s         
    └─Workers                                                                                                
      └─MachineDeployment/preprovisioned-example-md-0                          True                     2m34s         
        └─Machine/preprovisioned-example-md-0-77f667cd9-tnctd                  True                     2m33s  
    CODE
  5. Remove the bootstrap cluster, as the workload cluster is now self-managed:

    dkp delete bootstrap 
    CODE

    ✓ Deleting bootstrap cluster
    CODE

Known limitations

Be aware of these limitations in the current release of Konvoy.

  • DKP supports moving only one set of cluster objects from the bootstrap cluster to the workload cluster, or vice-versa.

  • DKP only supports moving all namespaces in the cluster; DKP does not support migration of individual namespaces.