Cluster API Provider for cloudscale.ch

Kubernetes Cluster API infrastructure provider for cloudscale.ch.
Features
- CloudscaleCluster: Network, Subnet, Load Balancer management
- CloudscaleMachine: Server provisioning with cloud-init
- CloudscaleMachineTemplate: Immutable machine templates for KubeadmControlPlane/MachineDeployment
Prerequisites
Quickstart
Initialize the management cluster
export CLOUDSCALE_API_TOKEN=<your-api-token>
clusterctl init --infrastructure cloudscale
Generate and apply a workload cluster
Set the required environment variables, then generate and apply the cluster manifest:
clusterctl generate cluster my-cluster \
--kubernetes-version v1.32.0 \
--control-plane-machine-count 1 \
--worker-machine-count 2 \
| kubectl apply -f -
Watch the cluster come up:
clusterctl describe cluster my-cluster
Environment Variables
| Variable |
Description |
Example |
CLOUDSCALE_API_TOKEN |
cloudscale.ch API token |
abc123... |
CLOUDSCALE_SSH_PUBLIC_KEY |
SSH public key added to nodes |
ssh-ed25519 AAAA... |
CLOUDSCALE_REGION |
cloudscale.ch region |
lpg or rma |
CLOUDSCALE_MACHINE_IMAGE |
Server image for nodes |
custom:ubuntu-2404-kube-v1.32.0 |
CLOUDSCALE_CONTROL_PLANE_MACHINE_FLAVOR |
Flavor for control plane nodes |
flex-4-2 |
CLOUDSCALE_WORKER_MACHINE_FLAVOR |
Flavor for worker nodes |
flex-4-2 |
CLOUDSCALE_ROOT_VOLUME_SIZE |
Root volume size in GB |
50 |
Development
This is a kubebuilder-scaffolded project. For new APIs, Webhooks, etc. kubebuilder
commands should be used.
# Run tests
make test
# Generate manifests
make manifests
# Generate code
make generate
# Run E2E tests (requires CLOUDSCALE_API_TOKEN)
make test-e2e
Tilt
The easiest way to work on this provider is by using the
Tilt setup of Cluster-API.
Refer to the linked documentation on how to set up your local tilt. This requires cloning
Cluster-API core to your host. The necessary commands need to be executed in the
Cluster-API core repository (not in this repository).
An example tilt-settings.yaml, which should also be placed in the Cluster-API core repository, is provided here:
default_registry: "" # change if you use a remote image registry
provider_repos:
# This refers to your provider directory and loads settings
# from `tilt-provider.yaml`
- path/to/local/clone/cluster-api-provider-cloudscale
enable_providers:
- cloudscale
- kubeadm-bootstrap
- kubeadm-control-plane
deploy_cert_manager: true
kustomize_substitutions:
CLOUDSCALE_API_TOKEN: "INSERT_TOKEN_HERE"
CLOUDSCALE_SSH_PUBLIC_KEY: "INSERT_SSH_PUBLIC_KEY_HERE"
CLOUDSCALE_REGION: "lpg"
CLOUDSCALE_CONTROL_PLANE_MACHINE_FLAVOR: "flex-4-2"
CLOUDSCALE_WORKER_MACHINE_FLAVOR: "flex-4-2"
CLOUDSCALE_MACHINE_IMAGE: "IMAGE_NAME"
CLOUDSCALE_ROOT_VOLUME_SIZE: "50"
extra_args:
cloudscale:
- "--zap-log-level=5"
template_dirs:
docker:
- ./test/infrastructure/docker/templates
cloudscale:
- path/to/local/clone/cluster-api-provider-cloudscale/templates
License
Apache License 2.0