Getting started with CAPL
Prerequisites
- A Linode account
- A Personal Access Token (PAT) created via the Linode Cloud Manager.
Make sure to create the token with at least the following read/write permissions (or "all"):
- Linodes
- NodeBalancers
- Images
- Volumes
- VPCs
- IPs
- Object Storage
- clusterctl is installed
- Cluster API management cluster is created
For more information please see the Linode Guide.
Setting up your cluster environment variables
Once you have provisioned your PAT, save it in an environment variable along with other required settings:
export LINODE_REGION=us-ord
export LINODE_TOKEN=<your linode PAT>
export LINODE_CONTROL_PLANE_MACHINE_TYPE=g6-standard-2
export LINODE_MACHINE_TYPE=g6-standard-2
This project uses linodego for Linode API interaction. Please refer to it for more details on environment variables used for client configuration.
For Regions and Images that do not yet support Akamai's cloud-init datasource CAPL will automatically use a stackscript shim to provision the node. If you are using a custom image ensure the cloud_init flag is set correctly on it
By default, clusters are provisioned within VPC with disk encryption enabled. For Regions which do not have VPC support yet, use the VPCLess flavor to have clusters provisioned. For disabling disk encryption, set spec.template.spec.diskEncryption=disabled
in your generated LinodeMachineTemplate resources when creating a CAPL cluster.
Install CAPL on your management cluster
Install CAPL and enable the helm addon provider which is used by the majority of the CAPL flavorsclusterctl init --infrastructure linode-linode --addon helm
# Fetching providers
# Installing cert-manager Version="v1.14.5"
# Waiting for cert-manager to be available...
# Installing Provider="cluster-api" Version="v1.7.3" TargetNamespace="capi-system"
# Installing Provider="bootstrap-kubeadm" Version="v1.7.3" TargetNamespace="capi-kubeadm-bootstrap-system"
# Installing Provider="control-plane-kubeadm" Version="v1.7.3" TargetNamespace="capi-kubeadm-control-plane-system"
# Installing Provider="infrastructure-linode-linode" Version="v0.4.0" TargetNamespace="capl-system"
# Installing Provider="addon-helm" Version="v0.2.4" TargetNamespace="caaph-system"
Deploying your first cluster
Please refer to the default flavor section for creating your first Kubernetes cluster on Linode using Cluster API.