Documentation menu

Managing clusters

The everyday cluster verbs. klimax cluster creates, lists, switches, labels, verifies, and deletes individual kind clusters. To stamp out several clusters at once from one file, see Fleet management.

Create a cluster

Provision a kind cluster inside the running VM. klimax installs MetalLB with a dedicated IP-pool slice, wires CoreDNS forwarding, and (by default) merges the new context into ~/.kube/config:

$ klimax cluster create dev

Each cluster is auto-assigned a num (the lowest free 1–99 slot) that determines its API-server port, service/pod subnets, and MetalLB pool. Tune the rest with flags:

FlagDescription
--region <r>topology.kubernetes.io/region label (default europe-west<N>).
--zone <z>topology.kubernetes.io/zone label (default europe-west<N>-b).
-l, --label <k=v>Extra node label; repeatable.

Need to pin a specific num? Declare it in a Fleet manifest's per-cluster num: field.

$ klimax cluster create dev
$ klimax cluster create dev --region us-east1 --zone us-east1-a
$ klimax cluster create dev -l team=search -l env=dev

List, switch, merge

cluster list shows every cluster in the VM; add -o json or -o yaml for machine-readable output, or -l / --selector to filter by a node-label selector. Point kubectl at one with the klimax kubeconfig family:

$ klimax cluster list
$ klimax cluster list -o json
$ klimax cluster list -l env=dev                # filter by label selector

# KUBECONFIG for just this shell
$ eval $(klimax kubeconfig env dev)

# or merge the context into ~/.kube/config and switch to it
$ klimax kubeconfig use dev

Node labels

Every cluster klimax creates gets its nodes labelled: managed-by=klimax always, plus topology.kubernetes.io/region and …/zone from the flags above. Add your own with repeatable -l flags — handy for testing nodeSelector and affinity rules:

$ klimax cluster create dev -l disktype=ssd -l tier=frontend

Already created the cluster? Relabel it in place with klimax cluster label — no recreate. It sets/overwrites labels (--overwrite by default) and removes them with the trailing key- form:

$ klimax cluster label dev -l tier=frontend -l disktype=ssd
$ klimax cluster label dev -l disktype-              # remove a label
🏷️

Declaring a whole fleet? The same labels are set per-cluster in the manifest — see Fleet management → Node labels.

Verify the routing

The built-in smoke test deploys an nginx Deployment and a LoadBalancer Service against your current kubectl context, then waits for MetalLB to assign a VIP you can curl from your Mac:

$ klimax cluster e2e-test-nginx
$ klimax cluster e2e-test-nginx --cleanup   # remove the test workload

Delete a cluster

Pass a name to delete one cluster, run it bare for an interactive multi-select picker (Space toggles), or match several with -l / --selector (confirms unless -y):

$ klimax cluster delete staging
$ klimax cluster delete                    # interactive picker
$ klimax cluster delete -l env=test --yes   # delete every match
🚢

Deleting a cluster leaves the VM and other clusters running. To tear down a whole set at once, use klimax fleet delete <name> or klimax fleet delete -f fleet.yaml (Fleet management); to reclaim everything including the VM, use klimax destroy (Reset).

See also