K8

k8s-autoscaling

Configures horizontal and vertical pod autoscaling, including event-driven scaling with KEDA.

Install

mkdir -p .claude/skills/k8s-autoscaling && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3554" && unzip -o skill.zip -d .claude/skills/k8s-autoscaling && rm skill.zip

Installs to .claude/skills/k8s-autoscaling

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Configure Kubernetes autoscaling with HPA, VPA, and KEDA. Use for horizontal/vertical pod autoscaling, event-driven scaling, and capacity management.
149 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Configure HPA for CPU-based scaling
  • Implement event-driven scaling with KEDA
  • Right-size resource requests using VPA
  • Troubleshoot HPA and KEDA scaling issues
  • Manage capacity with ScaledObjects and ScaledJobs

How it works

The skill provides tools to define HPA, VPA, and KEDA resources, allowing users to apply them via kubectl to manage pod replicas based on CPU, memory, or custom event metrics.

Inputs & outputs

You give it
Kubernetes deployment name and namespace
You get back
Autoscaling configuration manifest

When to use k8s-autoscaling

  • Configure HPA for CPU-based scaling
  • Set up KEDA for event-driven scaling
  • Check VPA resource recommendations

About this skill

Kubernetes Autoscaling

Comprehensive autoscaling using HPA, VPA, and KEDA with kubectl-mcp-server tools.

When to Apply

Use this skill when:

  • User mentions: "HPA", "VPA", "KEDA", "autoscale", "scale to zero"
  • Operations: configuring autoscaling, checking scaling status
  • Keywords: "scale automatically", "event-driven", "right-size"

Priority Rules

PriorityRuleImpactTools
1Verify metrics-server for HPACRITICALget_resource_metrics
2Set resource requests before HPACRITICALdescribe_pod
3Use KEDA for scale-to-zeroHIGHkeda_scaledobjects_list_tool
4Check VPA recommendationsMEDIUMget_resource_recommendations

Quick Reference

TaskToolExample
List KEDA ScaledObjectskeda_scaledobjects_list_toolkeda_scaledobjects_list_tool(namespace)
Get ScaledObjectkeda_scaledobject_get_toolkeda_scaledobject_get_tool(name, namespace)
List ScaledJobskeda_scaledjobs_list_toolkeda_scaledjobs_list_tool(namespace)
Check KEDAkeda_detect_toolkeda_detect_tool()

HPA (Horizontal Pod Autoscaler)

Basic CPU-based scaling:

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: my-app-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: my-app
  minReplicas: 2
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 70

Apply and verify:

kubectl_apply(hpa_yaml, namespace)
get_hpa(namespace)

VPA (Vertical Pod Autoscaler)

Right-size resource requests:

apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: my-app-vpa
spec:
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: my-app
  updatePolicy:
    updateMode: "Auto"

KEDA (Event-Driven Autoscaling)

Detect KEDA Installation

keda_detect_tool()

List ScaledObjects

keda_scaledobjects_list_tool(namespace)
keda_scaledobject_get_tool(name, namespace)

List ScaledJobs

keda_scaledjobs_list_tool(namespace)

Trigger Authentication

keda_triggerauths_list_tool(namespace)
keda_triggerauth_get_tool(name, namespace)

KEDA-Managed HPAs

keda_hpa_list_tool(namespace)

See KEDA-TRIGGERS.md for trigger configurations.

Common KEDA Triggers

Queue-Based Scaling (AWS SQS)

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: sqs-scaler
spec:
  scaleTargetRef:
    name: queue-processor
  minReplicaCount: 0
  maxReplicaCount: 100
  triggers:
  - type: aws-sqs-queue
    metadata:
      queueURL: https://sqs.region.amazonaws.com/...
      queueLength: "5"

Cron-Based Scaling

triggers:
- type: cron
  metadata:
    timezone: America/New_York
    start: 0 8 * * 1-5
    end: 0 18 * * 1-5
    desiredReplicas: "10"

Prometheus Metrics

triggers:
- type: prometheus
  metadata:
    serverAddress: http://prometheus:9090
    metricName: http_requests_total
    query: sum(rate(http_requests_total{app="myapp"}[2m]))
    threshold: "100"

Scaling Strategies

StrategyToolUse Case
CPU/MemoryHPASteady traffic patterns
Custom metricsHPA v2Business metrics
Event-drivenKEDAQueue processing, cron
VerticalVPARight-size requests
Scale to zeroKEDACost savings, idle workloads

Cost-Optimized Autoscaling

Scale to Zero with KEDA

Reduce costs for idle workloads:

keda_scaledobjects_list_tool(namespace)

Right-Size with VPA

Get recommendations and apply:

get_resource_recommendations(namespace)

Troubleshooting

HPA Not Scaling

get_hpa(namespace)
get_pod_metrics(name, namespace)
describe_pod(name, namespace)

KEDA Not Triggering

keda_scaledobject_get_tool(name, namespace)
get_events(namespace)

Common Issues

SymptomCheckResolution
HPA unknownMetrics serverInstall metrics-server
KEDA no scaleTrigger authCheck TriggerAuthentication
VPA not updatingUpdate modeSet updateMode: Auto
Scale down slowStabilizationAdjust stabilizationWindowSeconds

Best Practices

  1. Always Set Resource Requests - HPA requires requests to calculate utilization
  2. Use Multiple Metrics - Combine CPU + custom metrics for accuracy
  3. Stabilization Windows - Prevent flapping with scaleDown stabilization
  4. Scale to Zero Carefully - Consider cold start time

Related Skills

When not to use it

  • When metrics-server is missing for HPA
  • When stabilization windows are not configured for flapping workloads

Prerequisites

metrics-serverkubectl

Limitations

  • HPA requires resource requests to be set
  • Scale-down stabilization may be slow

How it compares

Unlike manual YAML editing, this skill provides specific tools to verify metrics, list KEDA objects, and check VPA recommendations to ensure accurate scaling.

Compared to similar skills

k8s-autoscaling side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
k8s-autoscaling (this skill)16moNo flagsIntermediate
linkerd-patterns65moReviewAdvanced
storage-networking67moReviewAdvanced
k8s-helm86moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by rohitg00

View all by rohitg00

You might also like

linkerd-patterns

wshobson

Implement Linkerd service mesh patterns for lightweight, security-focused service mesh deployments. Use when setting up Linkerd, configuring traffic policies, or implementing zero-trust networking with minimal overhead.

672

storage-networking

pluginagentmarketplace

Master Kubernetes storage management and networking architecture. Learn persistent storage, network policies, service discovery, and ingress routing.

663

k8s-helm

rohitg00

Manage Helm charts, releases, and repositories. Use for Helm installations, upgrades, rollbacks, chart development, and release management.

857

kubernetes-architect

sickn33

Expert Kubernetes architect specializing in cloud-native infrastructure, advanced GitOps workflows (ArgoCD/Flux), and enterprise container orchestration. Masters EKS/AKS/GKE, service mesh (Istio/Linkerd), progressive delivery, multi-tenancy, and platform engineering. Handles security, observability, cost optimization, and developer experience. Use PROACTIVELY for K8s architecture, GitOps implementation, or cloud-native platform design.

636

gitops-workflow

sickn33

Implement GitOps workflows with ArgoCD and Flux for automated, declarative Kubernetes deployments with continuous reconciliation. Use when implementing GitOps practices, automating Kubernetes deployments, or setting up declarative infrastructure management.

521

devops-iac-engineer

davila7

Implements infrastructure as code using Terraform, Kubernetes, and cloud platforms. Designs scalable architectures, CI/CD pipelines, and observability solutions. Provides security-first DevOps practices and site reliability engineering guidance.

223

Search skills

Search the agent skills registry