From castai-pack
Configure CAST AI Workload Autoscaler for pod-level right-sizing and VPA. Use when enabling workload autoscaling, configuring resource recommendations, or tuning pod CPU and memory requests with CAST AI. Trigger with phrases like "cast ai workload autoscaler", "cast ai pod sizing", "cast ai resource recommendations", "cast ai VPA".
npx claudepluginhub flight505/skill-forge --plugin castai-packThis skill is limited to using the following tools:
CAST AI Workload Autoscaler right-sizes pod resource requests based on actual usage, reducing over-provisioning without manual VPA tuning. This skill covers enabling the workload autoscaler, configuring scaling policies per workload, and using annotations for fine-grained control.
Guides Next.js Cache Components and Partial Prerendering (PPR): 'use cache' directives, cacheLife(), cacheTag(), revalidateTag() for caching, invalidation, static/dynamic optimization. Auto-activates on cacheComponents: true.
Guides building MCP servers enabling LLMs to interact with external services via tools. Covers best practices, TypeScript/Node (MCP SDK), Python (FastMCP).
Share bugs, ideas, or general feedback.
CAST AI Workload Autoscaler right-sizes pod resource requests based on actual usage, reducing over-provisioning without manual VPA tuning. This skill covers enabling the workload autoscaler, configuring scaling policies per workload, and using annotations for fine-grained control.
castai-core-workflow-a (cluster-level policies)helm upgrade --install castai-workload-autoscaler \
castai-helm/castai-workload-autoscaler \
-n castai-agent \
--set castai.apiKey="${CASTAI_API_KEY}" \
--set castai.clusterID="${CASTAI_CLUSTER_ID}"
# Get resource recommendations for a specific workload
curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/workload-autoscaling/clusters/${CASTAI_CLUSTER_ID}/workloads" \
| jq '.items[] | {
name: .workloadName,
namespace: .namespace,
currentCpu: .currentCpuRequest,
recommendedCpu: .recommendedCpuRequest,
currentMemory: .currentMemoryRequest,
recommendedMemory: .recommendedMemoryRequest,
savingsPercent: .estimatedSavingsPercent
}'
# Add annotations to deployments for CAST AI workload autoscaler
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-api
annotations:
# Enable workload autoscaling
autoscaling.cast.ai/enabled: "true"
# CPU configuration
autoscaling.cast.ai/cpu-min: "100m"
autoscaling.cast.ai/cpu-max: "4000m"
autoscaling.cast.ai/cpu-headroom: "15"
# Memory configuration
autoscaling.cast.ai/memory-min: "128Mi"
autoscaling.cast.ai/memory-max: "8Gi"
autoscaling.cast.ai/memory-headroom: "20"
# Apply changes automatically vs recommendation-only
autoscaling.cast.ai/apply-type: "immediate"
spec:
template:
spec:
containers:
- name: api
resources:
requests:
cpu: "500m" # Will be auto-adjusted by CAST AI
memory: "512Mi" # Will be auto-adjusted by CAST AI
curl -X POST -H "X-API-Key: ${CASTAI_API_KEY}" \
-H "Content-Type: application/json" \
"https://api.cast.ai/v1/workload-autoscaling/clusters/${CASTAI_CLUSTER_ID}/policies" \
-d '{
"name": "cost-optimized",
"applyType": "IMMEDIATE",
"management": {
"cpu": {
"function": "QUANTILE",
"args": { "quantile": 0.95 },
"overhead": 0.15,
"min": 50,
"max": 8000
},
"memory": {
"function": "MAX",
"overhead": 0.20,
"min": 64,
"max": 16384
}
},
"antiShrink": {
"enabled": true,
"cooldownSeconds": 300
}
}'
# Check scaling events
kubectl get events -n default --field-selector reason=CastAIWorkloadAutoscaled
# View current vs recommended via API
curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/workload-autoscaling/clusters/${CASTAI_CLUSTER_ID}/workloads/${WORKLOAD_ID}" \
| jq '.scalingEvents[-5:]'
| Error | Cause | Solution |
|---|---|---|
| Workload not appearing | Missing annotation | Add autoscaling.cast.ai/enabled: "true" |
| OOMKilled after scaling | Memory headroom too low | Increase memory-headroom to 25+ |
| CPU throttling | CPU recommendation too aggressive | Increase cpu-headroom or set higher min |
| No recommendations yet | Insufficient data | Wait 24h for usage data collection |
For troubleshooting CAST AI errors, see castai-common-errors.