K8s by Example: Cluster Autoscaler
| Cluster Autoscaler automatically adjusts the number of nodes based on pending pods. It adds nodes when pods can’t be scheduled due to resource constraints, and removes underutilized nodes to save costs. Essential for handling variable workloads efficiently. |
| terminal | |
| Cluster Autoscaler triggers scale-up when pods are Pending due to insufficient resources. It analyzes why pods can’t be scheduled and adds appropriate nodes. | |
| Check autoscaler status and decisions. The | |
| cluster-autoscaler-deployment.yaml | |
| Cluster Autoscaler runs as a Deployment. Key flags: | |
| Configure scale-down behavior. | |
| terminal | |
| Debug autoscaler decisions from logs. Look for | |
| Common issues: pod requests too large for any node type, affinity rules blocking scheduling, PDB preventing node drain. | |
| pod-safe-to-evict.yaml | |
| Prevent pods from blocking scale-down with the | |
| By default, pods with local storage, not backed by a controller, or with restrictive PDBs block scale-down. Use annotations to override. | |
| nodepool-priority.yaml | |
| Use node pool priority to prefer cheaper instances. Lower priority pools are used first, falling back to higher priority (more expensive) pools when needed. | |
| Configure expander strategy to control which node pool is scaled. Options: | |
| terminal | |
| Mix spot and on-demand instances for cost savings. Spot instances are cheaper but can be terminated. Use for stateless, fault-tolerant workloads. | |
| terminal | |
| Debug why pods aren’t triggering scale-up. Check if pods have node selectors, affinities, or tolerations that can’t be satisfied by any node pool. | |
Index | Use arrow keys to navigate