Contents
- kubernetes-autoscaling-horizontal-pod-autoscaler
- kubernetes-autoscaling-vertical-pod-autoscaler
- kubernetes-autoscaling-cluster-autoscaling
Roadmap info from roadmap website
Autoscaling
Autoscaling in Kubernetes involves adjusting the resources allocated to a deployment or set of pods based on demand. It includes Horizontal Pod Autoscaling (HPA) and Vertical Pod Autoscaling (VPA), which increase or decrease replicas or adjust resource requests and limits, respectively. Autoscaling can be used with Cluster Autoscaling to efficiently allocate resources and ensure application responsiveness. Itβs useful for handling variable workloads or sudden spikes in traffic.
Resources
Horizontal Pod Autoscaling vs Vertical Pod Autoscaling
Feature/Aspect | Horizontal Pod Autoscaling (HPA) | Vertical Pod Autoscaling (VPA) |
---|---|---|
Scaling Method | Adds or removes pods based on workload | Adjusts the resource requests/limits of pods |
Primary Use Case | Handle varying traffic load by increasing or decreasing the number of pods | Optimize resource allocation (CPU, memory) for long-running or varying workload applications |
Trigger | CPU, memory, or custom metrics thresholds | Podβs resource usage (CPU, memory) over time |
Granularity | Scales the number of replicas | Modifies individual pod resource requests and limits |
Best For | High traffic and fluctuating demand scenarios | Applications with unpredictable or evolving resource requirements |
Resource Efficiency | Ensures workload is balanced across multiple pods | Ensures each pod gets the right amount of resources without wasting or starving |
Impact on Cluster | Can increase the number of pods in the cluster | Can change resource limits within the existing number of pods |
Supported Metrics | CPU, memory, custom metrics | CPU, memory |
Downsides | Might lead to over-provisioning if not configured well | May cause pod restarts when resource limits are adjusted |
Example Use Case | Web servers with fluctuating traffic | Databases or backend services with varying CPU/memory needs |