Provision a CAPI management cluster
In this workshop we are going to use kind
to create a cluster to run
CAPI (Cluster API) controllers and the Liquid Metal CAPMVM (Cluster API Provider MicroVM)
controllers.
We can then apply yaml manifests to the management cluster, which the CAPI and CAPMVM controllers will act on to create child workload clusters in Microvms.
Kindâ
First install kind
.
Next, use kind
to create a cluster:
kind create cluster --name lm-management
Output
Clusterctlâ
Install the CAPI CLI tool, clusterctl
.
We will use this tool to install both the CAPI and CAPMVM controllers on the management cluster.
CAPMVMâ
We install CAPMVM by configuring clusterctl
to use our custom provider.
Create a cluster-api
directory under home:
mkdir -p ~/.cluster-api
Set the CAPMVM version you wish to use in your environment. First check for the
version which is compatible with the version of flintlockd
you are running.
In my case I am using Flintlock v0.3.0
, so the compatible CAPMVM version is v0.7.0
.
If you ran the provisioning step without configuring the flintlock version, then
the latest will have been installed.
export CAPMVM_VERSION=v0.7.0
Write the installation information to a clusterctl
config file in the cluster-api
repo:
cat << EOF >>~/.cluster-api/clusterctl.yaml
providers:
- name: "microvm"
url: "https://github.com/liquidmetal-dev/cluster-api-provider-microvm/releases/$CAPMVM_VERSION/infrastructure-components.yaml"
type: "InfrastructureProvider"
EOF
CAPIâ
Use clusterctl
to initialise the management cluster. This command will install all
required controllers.
export EXP_CLUSTER_RESOURCE_SET=true # required for the MicroVM clusters we want to create later
clusterctl init --infrastructure microvm
Output
If you see an error containing the words "401 Bad Credentials"
, make sure you don't
have any Github auth methods set in your environment. GITHUB_TOKEN
is a common
culprit and can be removed with unset GITHUB_TOKEN
.
We are now ready to create a workload cluster with MicroVMs!