Configuring Auto-Scaling Policies
Overview
Configure auto-scaling policies for cloud workloads across AWS Auto Scaling Groups, GCP Managed Instance Groups, Azure VMSS, and Kubernetes Horizontal Pod Autoscaler (HPA). Generate scaling configurations based on CPU, memory, request rate, or custom metrics with appropriate thresholds, cooldown periods, and scale-in protection.
Prerequisites
- Cloud provider CLI installed and authenticated (
aws, gcloud, or az)
- For Kubernetes HPA:
kubectl configured with cluster access and metrics-server deployed
- Baseline performance data for the target workload (average CPU, memory, request rate)
- Understanding of traffic patterns (steady, bursty, scheduled)
- IAM permissions to create/modify scaling policies and CloudWatch/Stackdriver alarms
Instructions
- Identify the scaling target: EC2 Auto Scaling Group, GCP MIG, Azure VMSS, or Kubernetes Deployment
- Analyze current workload metrics to establish baseline utilization and peak patterns
- Define scaling boundaries: minimum instances/pods, maximum instances/pods, desired count
- Select scaling metric(s): CPU utilization, memory, request count, queue depth, or custom metrics
- Set target thresholds: scale-out trigger (e.g., CPU > 70%), scale-in trigger (e.g., CPU < 30%)
- Configure cooldown periods to prevent flapping (typically 300s scale-out, 600s scale-in)
- Add scale-in protection for stateful workloads or leader nodes if needed
- Generate the scaling policy configuration in the appropriate format (Terraform, YAML, or CLI commands)
- Validate by simulating load and confirming scaling events fire correctly
Output
- Terraform HCL for AWS ASG scaling policies with CloudWatch alarms
- Kubernetes HPA manifests (YAML) with resource or custom metric targets
- GCP autoscaler configurations for Managed Instance Groups
- Scaling policy JSON/YAML for Azure VMSS
- CloudWatch or Stackdriver alarm definitions tied to scaling actions
Error Handling
| Error |
Cause |
Solution |
No scaling activity despite high load |
Metric not reaching threshold or cooldown active |
Verify metric source in CloudWatch/Stackdriver; check cooldown timer with describe-scaling-activities |
Scaling too aggressively (flapping) |
Cooldown too short or threshold too sensitive |
Increase cooldown period and widen the gap between scale-out and scale-in thresholds |
Max capacity reached |
Instance/pod limit hit during traffic spike |
Raise max_size or implement request queuing as a backpressure mechanism |
HPA unable to compute replica count |
Metrics server not deployed or metric unavailable |
Install metrics-server and verify kubectl top pods returns data |
FailedScaleUp: insufficient capacity |
Cloud provider out of capacity in selected AZ/region |
Add multiple AZs to the ASG or use mixed instance types with allocation strategy |
Examples
- "Configure an AWS ASG with target tracking at 65% CPU, min 2 / max 20 instances, and 5-minute cooldown."
- "Create a Kubernetes HPA for a deployment that scales from 3 to 50 pods based on requests-per-second using a custom Prometheus metric."
- "Set up scheduled scaling for a GCP MIG: scale to 10 instances at 8am UTC and back to 2 at 10pm."
Resources
Source: jeremylongshore/claude-code-plugins-plus-skills → skills/.curated/configuring-auto-scaling-policies/SKILL.md
Also appears in: jeremylongshore/claude-code-plugins-plus-skills/plugins/devops/auto-scaling-configurator/skills/configuring-auto-scaling-policies/SKILL.md
1---
2name: configuring-auto-scaling-policies
3description: "'Configure use when you need to work with auto-scaling. This skill provides auto-scaling configuration with comprehensive guidance and automation. Trigger with phrases like \"configure auto-scaling\", \"set up elastic scaling\", or \"implement scaling\". '"
4allowed-tools: "Read, Write, Edit, Grep, Glob, Bash(cmd:*)"
5category: general-purpose
6source_repo: jeremylongshore/claude-code-plugins-plus-skills
7source_path: "skills/.curated/configuring-auto-scaling-policies/SKILL.md"
8source_url: https://github.com/jeremylongshore/claude-code-plugins-plus-skills/blob/HEAD/skills/.curated/configuring-auto-scaling-policies/SKILL.md
9metadata:
10 source: https://skillmd.com/skills/thedixitjain/configuring-auto-scaling-policies
11---
12
13# Configuring Auto-Scaling Policies
14
15## Overview
16
17Configure auto-scaling policies for cloud workloads across AWS Auto Scaling Groups, GCP Managed Instance Groups, Azure VMSS, and Kubernetes Horizontal Pod Autoscaler (HPA). Generate scaling configurations based on CPU, memory, request rate, or custom metrics with appropriate thresholds, cooldown periods, and scale-in protection.
18
19## Prerequisites
20
21- Cloud provider CLI installed and authenticated (`aws`, `gcloud`, or `az`)
22- For Kubernetes HPA: `kubectl` configured with cluster access and metrics-server deployed
23- Baseline performance data for the target workload (average CPU, memory, request rate)
24- Understanding of traffic patterns (steady, bursty, scheduled)
25- IAM permissions to create/modify scaling policies and CloudWatch/Stackdriver alarms
26
27## Instructions
28
291. Identify the scaling target: EC2 Auto Scaling Group, GCP MIG, Azure VMSS, or Kubernetes Deployment
302. Analyze current workload metrics to establish baseline utilization and peak patterns
313. Define scaling boundaries: minimum instances/pods, maximum instances/pods, desired count
324. Select scaling metric(s): CPU utilization, memory, request count, queue depth, or custom metrics
335. Set target thresholds: scale-out trigger (e.g., CPU > 70%), scale-in trigger (e.g., CPU < 30%)
346. Configure cooldown periods to prevent flapping (typically 300s scale-out, 600s scale-in)
357. Add scale-in protection for stateful workloads or leader nodes if needed
368. Generate the scaling policy configuration in the appropriate format (Terraform, YAML, or CLI commands)
379. Validate by simulating load and confirming scaling events fire correctly
38
39## Output
40
41- Terraform HCL for AWS ASG scaling policies with CloudWatch alarms
42- Kubernetes HPA manifests (YAML) with resource or custom metric targets
43- GCP autoscaler configurations for Managed Instance Groups
44- Scaling policy JSON/YAML for Azure VMSS
45- CloudWatch or Stackdriver alarm definitions tied to scaling actions
46
47## Error Handling
48
49| Error | Cause | Solution |
50|-------|-------|---------|
51| `No scaling activity despite high load` | Metric not reaching threshold or cooldown active | Verify metric source in CloudWatch/Stackdriver; check cooldown timer with `describe-scaling-activities` |
52| `Scaling too aggressively (flapping)` | Cooldown too short or threshold too sensitive | Increase cooldown period and widen the gap between scale-out and scale-in thresholds |
53| `Max capacity reached` | Instance/pod limit hit during traffic spike | Raise `max_size` or implement request queuing as a backpressure mechanism |
54| `HPA unable to compute replica count` | Metrics server not deployed or metric unavailable | Install metrics-server and verify `kubectl top pods` returns data |
55| `FailedScaleUp: insufficient capacity` | Cloud provider out of capacity in selected AZ/region | Add multiple AZs to the ASG or use mixed instance types with allocation strategy |
56
57## Examples
58
59- "Configure an AWS ASG with target tracking at 65% CPU, min 2 / max 20 instances, and 5-minute cooldown."
60- "Create a Kubernetes HPA for a deployment that scales from 3 to 50 pods based on requests-per-second using a custom Prometheus metric."
61- "Set up scheduled scaling for a GCP MIG: scale to 10 instances at 8am UTC and back to 2 at 10pm."
62
63## Resources
64
65- AWS Auto Scaling: https://docs.aws.amazon.com/autoscaling/ec2/userguide/
66- Kubernetes HPA: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
67- GCP Autoscaler: https://cloud.google.com/compute/docs/autoscaler
68- Azure VMSS Autoscale: https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-autoscale-overview
69
70---
71
72**Source:** [`jeremylongshore/claude-code-plugins-plus-skills`](https://github.com/jeremylongshore/claude-code-plugins-plus-skills) → `skills/.curated/configuring-auto-scaling-policies/SKILL.md`
73
74**Also appears in:** `jeremylongshore/claude-code-plugins-plus-skills/plugins/devops/auto-scaling-configurator/skills/configuring-auto-scaling-policies/SKILL.md`