Kubernetes Skills

v1.0.0

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

1· 2.2k·7 current·7 all-time
byRohit Ghumare@rohitg00
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
medium confidence
Purpose & Capability
Name, description, and content all focus on Kubernetes autoscaling (HPA, VPA, KEDA). The examples and helper tool calls (e.g., keda_scaledobjects_list_tool, apply_manifest) are coherent for this purpose. The SKILL.md references 'kubectl-mcp-server tools' but the skill does not declare binaries — that implies it expects the agent/runtime to provide those tools.
Instruction Scope
Instructions stay within autoscaling tasks and include YAML examples and helper tool invocations. They do not instruct reading host system files or sending data to unknown external endpoints. However several examples reference secrets, connection strings, and env var names (PG_CONNECTION, MYSQL_CONNECTION, AWS credentials, amqp://user:pass@...) — these are legitimate examples for KEDA triggers but could cause sensitive data exposure if the agent/tooling has access to cluster secrets or is allowed to apply manifests without review.
Install Mechanism
No install spec and no code files — instruction-only. This is low-risk from install/execution distribution perspective (nothing will be downloaded or written by the skill itself).
Credentials
The skill declares no required env vars or credentials, which is appropriate. The documentation does show how triggers reference credentials/secrets in Kubernetes (and env var placeholders). That's expected, but you should confirm the agent won't be granted broader cluster credentials (or host env secrets) than necessary.
Persistence & Privilege
always is false and the skill does not request persistent system presence or attempt to modify other skills. The skill can be invoked autonomously by the agent (platform default) which is normal; combine that with any cluster-level permissions cautiously.
Assessment
This is an instruction-only autoscaling guide (HPA/VPA/KEDA) and appears coherent with that purpose. Before installing or enabling it: 1) Verify what runtime/tooling the agent provides (kubectl, KEDA helpers, MCP server) and whether those tools have access to your Kubernetes cluster. 2) Never grant the agent broad cluster-admin or host-level credentials just to use the skill — prefer scoped service accounts. 3) Review any manifests the agent will apply (secrets, connection strings) — replace inline credentials with Kubernetes Secrets and avoid hard-coded credentials in YAML. 4) Confirm the agent's tool wrappers do not exfiltrate cluster secrets or send data to external endpoints. 5) Because this skill is instruction-only, its safety depends on the agent and the permissions you give it; limit privileges and require manual review/apply steps if you are concerned.

Like a lobster shell, security has layers — review code before you run it.

latestvk97cbmkx8hw67ddbgb49vz6nn57zyaqe
2.2kdownloads
1stars
1versions
Updated 1mo ago
v1.0.0
MIT-0

Kubernetes Autoscaling

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

Quick Reference

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:

apply_manifest(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  # Scale to zero!
  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   # 8 AM weekdays
    end: 0 18 * * 1-5    # 6 PM weekdays
    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)
# ScaledObjects with minReplicaCount: 0 can scale to zero

Right-Size with VPA

Get recommendations and apply:

get_resource_recommendations(namespace)
# Apply VPA recommendations

Predictive Scaling

Use cron triggers for known patterns:

# Scale up before traffic spike
triggers:
- type: cron
  metadata:
    start: 0 7 * * *  # 7 AM
    end: 0 9 * * *    # 9 AM
    desiredReplicas: "20"

Multi-Cluster Autoscaling

Configure KEDA across clusters:

keda_scaledobjects_list_tool(namespace, context="production")
keda_scaledobjects_list_tool(namespace, context="staging")

Troubleshooting

HPA Not Scaling

get_hpa(namespace)
get_pod_metrics(name, namespace)  # Metrics available?
describe_pod(name, namespace)     # Resource requests set?

KEDA Not Triggering

keda_scaledobject_get_tool(name, namespace)  # Check status
get_events(namespace)                        # Check events

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
    • Use activation threshold

Related Skills

Comments

Loading comments...