Optimize Kubernetes Autoscaling Configuration
Expert guidance for configuring Kubernetes HPA, VPA, and Cluster Autoscaler with production-ready YAML examples, scaling policies, and multi-tier optimization
Why it matters
Master Kubernetes autoscaling by expertly configuring Horizontal Pod Autoscaler (HPA), Vertical Pod Autoscaler (VPA), and Cluster Autoscaler for efficient resource management and application stability.
Outcomes
What it gets done
Configure HPA with resource and custom metrics.
Implement VPA for resource request and limit adjustments.
Tune Cluster Autoscaler for optimal node pool sizing.
Apply best practices for scaling stability and resource requests.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-kubernetes-autoscaler-config | bash Overview
Kubernetes Autoscaler Configuration Expert
This skill provides expert guidance on configuring Kubernetes autoscaling technologies including HPA for pod-level scaling based on CPU, memory, or custom metrics, VPA for automatic resource request and limit adjustments, and Cluster Autoscaler for node pool management. It delivers production-ready YAML configurations with stabilization windows, scaling policies, and resource boundaries to prevent flapping and maintain application stability. Use this skill when implementing autoscaling for production Kubernetes workloads, optimizing resource utilization and cost efficiency, configuring custom metrics-based scaling for queue workers or event-driven applications, or designing multi-tier autoscaling strategies that combine HPA, VPA, and Cluster Autoscaler for comprehensive resource management.
What it does
This skill provides comprehensive expertise in Kubernetes autoscaling technologies: Horizontal Pod Autoscaler (HPA), Vertical Pod Autoscaler (VPA), and Cluster Autoscaler. It delivers production-ready configuration guidance, optimization strategies, and best practices for implementing efficient autoscaling in Kubernetes environments. The skill covers resource-based scaling, custom metrics integration, stabilization policies, and multi-tier autoscaling architectures.
When to use - and when NOT to
Use this skill when configuring autoscaling for production workloads, optimizing resource utilization across pod and cluster levels, implementing custom metrics-based scaling for queue workers or event-driven applications, or troubleshooting scaling behavior and flapping issues. Use it when designing multi-tier autoscaling strategies that combine HPA for immediate traffic response, VPA for long-term resource optimization, and Cluster Autoscaler for node capacity management.
Do NOT use this skill for static workloads with predictable resource requirements where manual scaling is sufficient. Avoid using VPA in Auto mode for stateful applications like databases where pod restarts could cause service disruption - use recommendation mode instead.
Inputs and outputs
You provide details about your workload type (web application, queue worker, database, batch job), current resource usage patterns, scaling requirements (min/max replicas, target utilization), and metrics you want to scale on (CPU, memory, custom metrics like queue depth). You receive production-ready YAML configurations for HPA, VPA, and Cluster Autoscaler, complete with stabilization windows, scaling policies, resource boundaries, and monitoring setup.
Here's a complete HPA configuration example with CPU and memory metrics:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: web-app-hpa
namespace: production
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: web-app
minReplicas: 3
maxReplicas: 100
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80
behavior:
scaleDown:
stabilizationWindowSeconds: 300
policies:
- type: Percent
value: 50
periodSeconds: 60
- type: Pods
value: 2
periodSeconds: 60
selectPolicy: Min
scaleUp:
stabilizationWindowSeconds: 60
policies:
- type: Percent
value: 100
periodSeconds: 15
- type: Pods
value: 4
periodSeconds: 15
selectPolicy: Max
Integrations
The skill covers configuration for GKE (Google Kubernetes Engine) with Cluster Autoscaler node pool auto-discovery, Prometheus with ServiceMonitor for metrics collection and alerting, kube-state-metrics for HPA metrics exposure, custom metrics adapters for external metrics like SQS queue length, and metrics server for resource-based autoscaling. It includes PodDisruptionBudgets to maintain availability during scaling operations.
Who it's for
Kubernetes platform engineers designing autoscaling strategies for production clusters, DevOps teams optimizing resource utilization and cost efficiency, SREs troubleshooting scaling behavior and preventing flapping, and application developers implementing custom metrics-based autoscaling for microservices, queue workers, or event-driven architectures. The skill provides pattern-specific guidance: CPU-based HPA with 70-80% target utilization for web applications, custom metrics HPA based on queue depth for queue workers, VPA in recommendation mode with manual tuning for databases, and Cluster Autoscaler with job-specific node pools for batch jobs.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.