# helm upgrade --install ca cluster-autoscaler --repo https://kubernetes.github.io/autoscaler --version 9.59.0 -n default -f values.yaml # must be installed in the same namespace as the -kubeconfig secret cloudProvider: clusterapi clusterAPIMode: kubeconfig-incluster # workload via kubeconfig, management in-cluster clusterAPIKubeconfigSecret: lab1-kubeconfig autoDiscovery: clusterName: lab1 namespace: default image: tag: v1.35.2 # chart default appVersion is 1.35.0 rbac: # CA reads the infrastructure machine template (capacity for scale-from-zero). The chart's # ClusterRole only covers cluster.x-k8s.io; without this the first main loop blocks forever on # "waiting for cache sync on infrastructure resource" and CA never scales. additionalRules: - apiGroups: [infrastructure.cluster.x-k8s.io] resources: [proxmoxmachinetemplates] verbs: [get, list, watch] extraArgs: expander: least-waste # Aggressive lab scale-down profile (CA 1.35 defaults in brackets): idle worker gone in ~3-4 min # (scan-interval 1m adds up to a minute to the 1m unneeded time). # Keep delay-after-add >= node startup (~2-3 min here) or bursts flap up/down. scale-down-unneeded-time: 1m # [10m] scale-down-delay-after-add: 2m # [10m] cluster-wide cooldown after any scale-up scale-down-delay-after-failure: 1m # [3m] unremovable-node-recheck-timeout: 1m # [5m] scale-down-utilization-threshold: "0.6" # [0.5] max-graceful-termination-sec: "60" # [600] drain wait per pod balance-similar-node-groups: true # One worker MD per PVE node. Compare groups only on this label: the generic comparator fails when # one group has a real-node template (cached, 2Gi VM = ~1.78Gi allocatable, os/arch set) and the # other a from-zero one. Disables the resource checks, so keep the MDs' capacity identical. balancing-label: node.cluster.x-k8s.io/pool # Fewer API requests instead of a higher kube-client-qps: every MD at 0 replicas costs ~3 uncached # discovery GETs per NodeGroups() call (~15x per loop). Unschedulable pods and scale-ups/downs still # trigger a loop immediately; only idle loops (scale-down evaluation) are spaced out. scan-interval: 1m # [10s] # Cilium taints new nodes NoSchedule until its agent is up. Without this, CA simulates the freshly # registered (still tainted) node, finds the pending pods don't fit and adds one node too many. startup-taint: node.cilium.io/agent-not-ready v: 2 # [chart 4] 4 logs every throttled request and MD lookup