k8-autoscalingConfigure Kubernetes autoscaling with HPA, VPA, and KEDA. Use for horizontal/vertical pod autoscaling, event-driven scaling, and capacity management.
Install via ClawdBot CLI:
clawdbot install rohitg00/k8-autoscalingComprehensive autoscaling using HPA, VPA, and KEDA with kubectl-mcp-server tools.
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)
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_detect_tool()
keda_scaledobjects_list_tool(namespace)
keda_scaledobject_get_tool(name, namespace)
keda_scaledjobs_list_tool(namespace)
keda_triggerauths_list_tool(namespace)
keda_triggerauth_get_tool(name, namespace)
keda_hpa_list_tool(namespace)
See KEDA-TRIGGERS.md for trigger configurations.
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"
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"
triggers:
- type: prometheus
metadata:
serverAddress: http://prometheus:9090
metricName: http_requests_total
query: sum(rate(http_requests_total{app="myapp"}[2m]))
threshold: "100"
| Strategy | Tool | Use Case |
|----------|------|----------|
| CPU/Memory | HPA | Steady traffic patterns |
| Custom metrics | HPA v2 | Business metrics |
| Event-driven | KEDA | Queue processing, cron |
| Vertical | VPA | Right-size requests |
| Scale to zero | KEDA | Cost savings, idle workloads |
Reduce costs for idle workloads:
keda_scaledobjects_list_tool(namespace)
# ScaledObjects with minReplicaCount: 0 can scale to zero
Get recommendations and apply:
get_resource_recommendations(namespace)
# Apply VPA recommendations
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"
Configure KEDA across clusters:
keda_scaledobjects_list_tool(namespace, context="production")
keda_scaledobjects_list_tool(namespace, context="staging")
get_hpa(namespace)
get_pod_metrics(name, namespace) # Metrics available?
describe_pod(name, namespace) # Resource requests set?
keda_scaledobject_get_tool(name, namespace) # Check status
get_events(namespace) # Check events
| Symptom | Check | Resolution |
|---------|-------|------------|
| HPA unknown | Metrics server | Install metrics-server |
| KEDA no scale | Trigger auth | Check TriggerAuthentication |
| VPA not updating | Update mode | Set updateMode: Auto |
| Scale down slow | Stabilization | Adjust stabilizationWindowSeconds |
Generated Mar 1, 2026
Automatically scale web application pods horizontally using HPA based on CPU utilization during flash sales or seasonal peaks, ensuring high availability and performance. Use KEDA cron triggers to pre-scale before anticipated traffic spikes, such as Black Friday, to handle increased load seamlessly.
Leverage KEDA with queue-based triggers (e.g., AWS SQS) to scale event-driven microservices that process incoming sensor data from IoT devices. Scale to zero during off-peak hours to optimize costs while maintaining rapid scalability during data influx events.
Implement VPA to automatically adjust pod CPU and memory requests based on usage patterns, right-sizing resources for multi-tenant applications. Combine with HPA for custom metrics scaling to handle user concurrency spikes, improving resource efficiency and reducing cloud spend.
Use KEDA with Prometheus metrics to scale video encoding or transcoding pods based on real-time viewer count or queue length. Enable scale-to-zero capabilities for non-peak hours, reducing infrastructure costs while ensuring low-latency streaming during live events.
Schedule cron-based scaling with KEDA to automatically increase compute resources for nightly batch jobs, such as risk calculations or report generation, and scale down afterward. Utilize HPA for steady-state processing during business hours with CPU-based autoscaling.
Offer autoscaling as a managed service feature, providing clients with optimized HPA, VPA, and KEDA configurations for their applications. Charge based on usage tiers or a percentage of cost savings achieved through efficient scaling, attracting enterprises seeking operational simplicity.
Provide expert consulting services to design and implement custom autoscaling solutions tailored to client needs, such as multi-cluster setups or complex trigger configurations. Revenue comes from project-based fees and ongoing support contracts, targeting organizations with specific scaling challenges.
Develop a SaaS platform that integrates these autoscaling tools to offer automated scaling insights, recommendations, and management dashboards. Monetize through monthly subscriptions based on cluster size or number of applications managed, appealing to DevOps teams and SMBs.
💬 Integration Tip
Integrate with existing CI/CD pipelines to automate deployment of autoscaling manifests, and use tools like Prometheus for custom metrics to enhance scaling accuracy based on business logic.
Automatically update Clawdbot and all installed skills once daily. Runs via cron, checks for updates, applies them, and messages the user with a summary of what changed.
Full desktop computer use for headless Linux servers. Xvfb + XFCE virtual desktop with xdotool automation. 17 actions (click, type, scroll, screenshot, drag,...
Essential Docker commands and workflows for container management, image operations, and debugging.
Tool discovery and shell one-liner reference for sysadmin, DevOps, and security tasks. AUTO-CONSULT this skill when the user is: troubleshooting network issues, debugging processes, analyzing logs, working with SSL/TLS, managing DNS, testing HTTP endpoints, auditing security, working with containers, writing shell scripts, or asks 'what tool should I use for X'. Source: github.com/trimstray/the-book-of-secret-knowledge
Deploy applications and manage projects with complete CLI reference. Commands for deployments, projects, domains, environment variables, and live documentation access.
Monitor topics of interest and proactively alert when important developments occur. Use when user wants automated monitoring of specific subjects (e.g., product releases, price changes, news topics, technology updates). Supports scheduled web searches, AI-powered importance scoring, smart alerts vs weekly digests, and memory-aware contextual summaries.