Cluster API with Docker Provider: Declarative Workload Cluster Lifecycle
Expert · 60 minutes · 5 tasks, checked automatically · 100 points
In this expert-level lab you will bootstrap Cluster API (CAPI) with the Docker infrastructure provider (CAPD) onto your existing kind management cluster, then use CAPI's declarative API to create a workload cluster entirely from YAML manifests. Your LearnXops kind cluster does not hand the host's Docker socket to the pods running inside it, so instead of starting real node containers you will use CAPD's in-memory backend: CAPD simulates each machine, its kubeadm bootstrap, etcd and the workload cluster's API server inside the CAPD controller. Every Cluster API object and step is the same as with real infrastructure — you will provision a cluster from a ClusterClass, scale its MachineDeployment, inspect the resulting objects, and finally tear the workload cluster down cleanly. This lab covers the full CAPI lifecycle: initialization, provisioning, scaling, and deletion.
What you’ll learn
- Install clusterctl and initialize the management cluster with the Docker (CAPD) infrastructure provider
- Create a CAPI workload cluster declaratively using Cluster, DockerCluster, KubeadmControlPlane, and MachineDeployment manifests
- Scale the MachineDeployment to add worker nodes, then delete the workload cluster and verify clean-up
How this lab works
- Start the lab: One click starts a real Kubernetes cluster on your computer (kind), with kubectl ready in a toolbox terminal.
- Work through 5 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work reads your live cluster and says, task by task, what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Cluster: A real Kubernetes cluster on your computer (kind)
- Kubernetes: 1.34.8
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
- A kind cluster created in the Kubernetes Playground
Topics: cluster-api, capi, capd, docker-provider, kind, workload-cluster, clusterctl, machinedeployment, kubeadm, infrastructure-as-code
Create a free account to start this lab.