From castai-pack
Sets up local Kubernetes dev loop with CAST AI cost monitoring for testing autoscaler policies and iterating Terraform configs.
How this skill is triggered — by the user, by Claude, or both
Slash command
/castai-pack:castai-local-dev-loopThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Fast iteration workflow for CAST AI integrations: test autoscaler policies in a dev cluster, validate Terraform modules before applying to production, and use the CAST AI API to measure savings impact during development.
Fast iteration workflow for CAST AI integrations: test autoscaler policies in a dev cluster, validate Terraform modules before applying to production, and use the CAST AI API to measure savings impact during development.
castai-install-auth setupkubectl, helm, and optionally terraform installedmy-castai-infra/
├── terraform/
│ ├── environments/
│ │ ├── dev.tfvars
│ │ ├── staging.tfvars
│ │ └── prod.tfvars
│ ├── modules/
│ │ └── castai-cluster/
│ │ ├── main.tf
│ │ ├── variables.tf
│ │ └── outputs.tf
│ └── main.tf
├── policies/
│ ├── dev-policy.json
│ └── prod-policy.json
├── scripts/
│ ├── check-savings.sh
│ └── validate-policies.sh
├── .env.dev # Dev API key (git-ignored)
└── .env.example
# Connect your dev cluster (read-only first)
helm upgrade --install castai-agent castai-helm/castai-agent \
-n castai-agent --create-namespace \
--set apiKey="${CASTAI_API_KEY_DEV}" \
--set provider="eks"
# Apply development-safe autoscaler policy
curl -X PUT -H "X-API-Key: ${CASTAI_API_KEY_DEV}" \
-H "Content-Type: application/json" \
"https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/policies" \
-d '{
"enabled": true,
"unschedulablePods": { "enabled": true },
"nodeDownscaler": {
"enabled": true,
"emptyNodes": { "enabled": true, "delaySeconds": 300 }
},
"clusterLimits": {
"enabled": true,
"cpu": { "minCores": 2, "maxCores": 16 }
}
}'
#!/bin/bash
# scripts/check-savings.sh
set -euo pipefail
API_KEY="${CASTAI_API_KEY_DEV}"
CLUSTER_ID="${CASTAI_CLUSTER_ID}"
echo "=== CAST AI Dev Cluster Savings ==="
curl -s -H "X-API-Key: ${API_KEY}" \
"https://api.cast.ai/v1/kubernetes/clusters/${CLUSTER_ID}/savings" \
| jq '{
monthlySavings: .monthlySavings,
percentage: .savingsPercentage,
spotNodes: [.nodes[] | select(.lifecycle == "spot")] | length,
totalNodes: [.nodes[]] | length
}'
# Plan with dev variables
cd terraform/
terraform plan -var-file=environments/dev.tfvars -out=plan.tfplan
# Apply and check CAST AI result
terraform apply plan.tfplan
# Verify policies took effect
curl -s -H "X-API-Key: ${CASTAI_API_KEY_DEV}" \
"https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/policies" \
| jq .
# Terminal 1: Watch CAST AI node operations
watch -n 15 'curl -s -H "X-API-Key: ${CASTAI_API_KEY_DEV}" \
"https://api.cast.ai/v1/kubernetes/external-clusters/${CASTAI_CLUSTER_ID}/nodes" \
| jq "[.items[] | {name, instanceType, lifecycle, age: .createdAt}] | length"'
# Terminal 2: Watch kubectl node status
kubectl get nodes -w
| Error | Cause | Solution |
|---|---|---|
| Dev cluster not found | Wrong cluster ID | List clusters with API first |
| Policy rejected | Invalid JSON | Validate with jq . < policy.json |
| Terraform drift | Manual console changes | Run terraform refresh |
| Agent offline after restart | Helm release stale | helm upgrade --install again |
See castai-sdk-patterns for reusable API wrapper patterns.
npx claudepluginhub jeremylongshore/claude-code-plugins-plus-skills --plugin castai-packInstalls CAST AI agent on Kubernetes clusters via Helm charts or Terraform with API key auth. For EKS/GKE/AKS onboarding, cost optimization, autoscaling.
Creates a local Kubernetes development environment with kind, k3d, or minikube for fast inner-loop development. Includes cluster creation, ingress, local registry, and Skaffold/Tilt integration.
Reviews OVHcloud Managed Kubernetes cluster lifecycle, node pool sizing, autoscaling, version upgrades, workload placement, network policies, RBAC, and Terraform IaC for ovh_cloud_project_kube resources.