First cluster comes up with ZERO workers — clusterctl overrides WORKER_MACHINE_COUNT to 0; the effective default must be 1
Symptom
Follow "Deploy your first cluster" verbatim and you get a control-plane-only cluster — no worker node, silently. clusterctl describe shows no MachineDeployment branch, and:
machinedeployment/<cluster>-md-0 DESIRED=0 CURRENT=0 READY=0
machineset/<cluster>-md-0-... DESIRED=0
The user reasonably expects a worker to appear (the base template ships a MachineDeployment). It never does, because it was created with replicas: 0.
Root cause
clusterctl generate cluster has a --worker-machine-count flag that defaults to 0 and is always injected as the WORKER_MACHINE_COUNT variable:
--control-plane-machine-count int (default 1)
--worker-machine-count int (default 0)
Our base template declares replicas: ${WORKER_MACHINE_COUNT:=1} — but that :=1 default is dead code, because clusterctl stamps WORKER_MACHINE_COUNT=0 over it whenever the flag is omitted. So unless the user explicitly passes --worker-machine-count N, they get zero workers. (--control-plane-machine-count defaults to 1, which is why the control plane looks fine and hides the asymmetry.)
Verified live this session: base-template cluster came up with 1 control-plane Machine and an md-0 MachineDeployment at replicas: 0; kubectl scale machinedeployment <cluster>-md-0 --replicas=1 immediately created the worker Machine.
Desired behaviour
A user following the getting-started guide verbatim should get 1 control plane + 1 worker, both reaching Ready. The effective default must be 1 worker, not 0.
Fix
Since clusterctl owns the value (the template default can't win), the fix is in the docs/examples, not the template :=1:
-
Every
clusterctl generate clusterexample in getting-started + guides must pass--worker-machine-count 1explicitly (or a higher number where the guide wants it). This is the real "default 1".clusterctl generate cluster my-cluster --kubernetes-version <ver> \ --infrastructure vco --worker-machine-count 1 | kubectl apply -f - -
docs/reference/templates.md: document thatWORKER_MACHINE_COUNTis effectively required — clusterctl overrides the template's:=1to0when the flag is omitted — so it belongs in the "must supply" story, not the "defaults to 1" one. Fix the current wording that claims a default of 1. -
first-cluster.mdverification: show the expectedkubectl get nodesoutput with both a control-plane and a worker node, so a missing worker is caught immediately instead of read as normal. - Optionally note the day-2 lever:
kubectl scale machinedeployment <cluster>-md-0 --replicas=N(and that--worker-machine-countseeds the initial count).
Acceptance
Running the first-cluster guide exactly as written produces a cluster with 1 control-plane and 1 worker node, both Ready — no manual scale step required.
Related: #14 (closed) (CNI never lands) and #13 (closed) (hardcoded image ids) — same "Deploy your first cluster must be smooth, nothing can go wrong" theme.