lab1: autoscaler min/max and capacity annotations on lab1-workers (Step 5)

kubectl diff against the live cluster shows only the six annotations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-27 11:26:55 +02:00
co-authored by Claude Opus 5.5
parent 9fb8a8dcc1
commit 1d0b669d07
2 changed files with 21 additions and 1 deletions
+9
View File
@@ -15,6 +15,7 @@
# 4. `vlan: 4` on net0 of both ProxmoxMachineTemplates
# 5. lab1-worker: 1 socket x 4 cores, 4096 MiB (owner's choice; runbook said 8192)
# 6. MachineDeployment lab1-workers: `replicas` removed (the autoscaler owns it)
# 7. MachineDeployment lab1-workers: autoscaler min/max + capacity annotations (runbook Step 5)
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
@@ -223,6 +224,14 @@ spec:
apiVersion: cluster.x-k8s.io/v1beta2
kind: MachineDeployment
metadata:
annotations:
cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: "0"
cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: "5"
# scale-from-zero: CAPMOX publishes no status.capacity; must match ProxmoxMachineTemplate/lab1-worker
capacity.cluster-autoscaler.kubernetes.io/cpu: "4" # numSockets 1 × numCores 4
capacity.cluster-autoscaler.kubernetes.io/memory: "4Gi" # memoryMiB 4096
capacity.cluster-autoscaler.kubernetes.io/ephemeral-disk: "40Gi" # bootVolume sizeGb 40
capacity.cluster-autoscaler.kubernetes.io/maximum-pods: "110"
labels:
cluster.x-k8s.io/cluster-name: lab1
name: lab1-workers
+12 -1
View File
@@ -159,9 +159,20 @@ metadata:
capacity.cluster-autoscaler.kubernetes.io/maximum-pods: "110"
```
They are part of `MachineDeployment/lab1-workers` in [configs/capi/lab1.yaml](../configs/capi/lab1.yaml);
re-apply the file (the only diff is these annotations; `replicas` isn't in the manifest, so it
stays as is):
```bash
export KUBECONFIG=~/.kube/lab-mgmt.kubeconfig
kubectl diff -f configs/capi/lab1.yaml # expect only the six annotations on lab1-workers
kubectl apply -f configs/capi/lab1.yaml
```
Capacity annotations are required for scale-from-zero because CAPMOX does not publish
`status.capacity`. They must match the `ProxmoxMachineTemplate`; add `.../labels` and `.../taints`
annotations if pods target the group by selector/toleration.
annotations if pods target the group by selector/toleration. They have no effect until
cluster-autoscaler runs (Step 6).
## Step 6 — cluster-autoscaler