k8s-autoscaling

2
0
Source

Configure Kubernetes autoscaling with HPA, VPA, and KEDA. Use for horizontal/vertical pod autoscaling, event-driven scaling, and capacity management.

Install

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

Installs to .claude/skills/k8s-autoscaling

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

More by rohitg00

View all →

motion-graphics

rohitg00

Kinetic typography, logo animations, and stylized motion design skill. **Triggers when:** - User wants text animations or kinetic typography - Request involves logo reveals or title sequences - Content focuses on visual impact over education - User mentions "title", "intro", "logo", "text animation", "kinetic" **Capabilities:** - Kinetic typography with dynamic text effects - Logo reveals and brand animations - Particle effects and visual flourishes - Modern motion design patterns - Attention-grabbing title sequences

61

k8s-kind

rohitg00

Manage kind (Kubernetes IN Docker) local clusters. Use when creating, testing, or developing with local Kubernetes clusters in Docker containers.

10

k8s-storage

rohitg00

Kubernetes storage management for PVCs, storage classes, and persistent volumes. Use when provisioning storage, managing volumes, or troubleshooting storage issues.

20

k8s-multicluster

rohitg00

Manage multiple Kubernetes clusters, switch contexts, and perform cross-cluster operations. Use when working with multiple clusters, comparing environments, or managing cluster lifecycle.

30

k8s-networking

rohitg00

Kubernetes networking management for services, ingresses, endpoints, and network policies. Use when configuring connectivity, load balancing, or network isolation.

20

k8s-operations

rohitg00

kubectl operations for applying, patching, deleting, and executing commands on Kubernetes resources. Use when modifying resources, running commands in pods, or managing resource lifecycle.

00

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

225765

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

177399

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

159268

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

192225

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

152185

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

126166

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.