Claude Code skill pack for Cast AI (18 skills)
Installation
Open Claude Code and run this command:
/plugin install castai-pack@claude-code-plugins-plus
Use --global to install for all projects, or --project for current project only.
Skills (18)
Integrate CAST AI policy validation and cost checks into CI/CD pipelines.
CAST AI CI Integration
Overview
Add CAST AI cost validation to CI/CD pipelines: verify savings thresholds, validate Terraform plans before apply, and gate deployments on autoscaler health.
Prerequisites
- GitHub Actions enabled
- CAST AI API key stored as repository secret
- Terraform state accessible from CI (if using Terraform)
Instructions
Step 1: GitHub Actions -- Savings Gate
# .github/workflows/castai-check.yml
name: CAST AI Cost Check
on:
pull_request:
paths: ["terraform/**", "k8s/**"]
schedule:
- cron: "0 8 * * 1" # Weekly Monday report
jobs:
cost-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check CAST AI Savings
env:
CASTAI_API_KEY: ${{ secrets.CASTAI_API_KEY }}
CASTAI_CLUSTER_ID: ${{ secrets.CASTAI_CLUSTER_ID }}
run: |
SAVINGS=$(curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/savings")
PERCENT=$(echo "$SAVINGS" | jq -r '.savingsPercentage')
MONTHLY=$(echo "$SAVINGS" | jq -r '.monthlySavings')
echo "### CAST AI Savings Report" >> $GITHUB_STEP_SUMMARY
echo "- Monthly savings: \$${MONTHLY}" >> $GITHUB_STEP_SUMMARY
echo "- Savings percentage: ${PERCENT}%" >> $GITHUB_STEP_SUMMARY
# Fail if savings drop below threshold
if (( $(echo "$PERCENT < 10" | bc -l) )); then
echo "WARNING: Savings below 10% threshold"
exit 1
fi
- name: Verify Agent Health
env:
CASTAI_API_KEY: ${{ secrets.CASTAI_API_KEY }}
CASTAI_CLUSTER_ID: ${{ secrets.CASTAI_CLUSTER_ID }}
run: |
STATUS=$(curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/kubernetes/external-clusters/${CASTAI_CLUSTER_ID}" \
| jq -r '.agentStatus')
if [ "$STATUS" != "online" ]; then
echo "CAST AI agent is ${STATUS}, expected online"
exit 1
fi
Step 2: Terraform Plan Validation
terraform-plan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
- name: Terraform Init & Plan
working-directory: terraform/
env:
CASTAI_API_TOKEN: ${{ secrets.CASTAI_API_KEY }}
run: |
terraform init
terraform plan -var-file=environments/prod.tfvars \
-out=plan.tfplan -no-color | tee plan-output.txt
- name: Check for Destructive Changes
run: |
if grep -q "will be dDiagnose and fix CAST AI agent, API, and autoscaler errors.
CAST AI Common Errors
Overview
Diagnostic guide for the 10 most common CAST AI issues, covering agent connectivity, API errors, autoscaler failures, and node provisioning problems.
Prerequisites
kubectlaccess to the clusterCASTAIAPIKEYconfigured- Access to CAST AI console for log correlation
Error Reference
1. Agent Pod CrashLoopBackOff
kubectl get pods -n castai-agent
kubectl logs -n castai-agent deployment/castai-agent --tail=50
Causes and fixes:
- Invalid API key: Regenerate at console.cast.ai > API
- Wrong provider: Set
--set provider=eks|gke|akscorrectly in Helm - RBAC missing: Apply the required ClusterRole and ClusterRoleBinding
- Network blocked: Ensure outbound HTTPS to
api.cast.aiis allowed
2. Agent Shows "Disconnected" in Console
# Check agent heartbeat
kubectl logs -n castai-agent deployment/castai-agent | grep -i "heartbeat\|connect\|error"
# Verify network connectivity from inside the cluster
kubectl run castai-debug --image=curlimages/curl --rm -it --restart=Never -- \
curl -s -o /dev/null -w "%{http_code}" https://api.cast.ai/v1/kubernetes/external-clusters
Fix: Restart the agent pod: kubectl rollout restart deployment/castai-agent -n castai-agent
3. API Returns 401 Unauthorized
# Test API key
curl -s -o /dev/null -w "%{http_code}" \
-H "X-API-Key: ${CASTAI_API_KEY}" \
https://api.cast.ai/v1/kubernetes/external-clusters
# Should return 200, not 401
Fix: Generate a new API key at console.cast.ai > API > API Access Keys.
4. Nodes Not Scaling Up (Unschedulable Pods)
# Check for pending pods
kubectl get pods --all-namespaces --field-selector=status.phase=Pending
# Verify unschedulable pods policy is enabled
curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/policies" \
| jq '.unschedulablePods'
Causes:
unschedulablePods.enabledisfalse-- enable it- Cluster limits reached -- increase
clusterLimits.cpu.maxCores - No matching node template -- check constraints match pod requirements
5. Nodes Not Scaling Down (Empty Nodes)
# Check node downscaler configuration
curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/policies" \
| jq '.nodeDownscaler'Configure CAST AI autoscaler policies and node templates for cost optimization.
CAST AI Core Workflow: Autoscaler & Policies
Overview
Primary workflow for CAST AI: configure autoscaler policies to optimize cluster costs. Covers enabling spot instances, configuring the node downscaler and evictor, setting cluster CPU/memory limits, and creating node templates for workload-specific requirements.
Prerequisites
- Completed
castai-install-authwith Phase 2 (cluster controller + evictor) CASTAIAPIKEYandCASTAICLUSTERIDset- Cluster in "ready" status
Instructions
Step 1: Read Current Policies
curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/policies" \
| jq .
Step 2: Enable Cost-Optimized Autoscaling
curl -X PUT -H "X-API-Key: ${CASTAI_API_KEY}" \
-H "Content-Type: application/json" \
"https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/policies" \
-d '{
"enabled": true,
"unschedulablePods": {
"enabled": true,
"headroom": {
"cpuPercentage": 10,
"memoryPercentage": 10,
"enabled": true
}
},
"nodeDownscaler": {
"enabled": true,
"emptyNodes": {
"enabled": true,
"delaySeconds": 180
}
},
"spotInstances": {
"enabled": true,
"clouds": ["aws"],
"spotDiversityEnabled": true,
"spotDiversityPriceIncreaseLimitPercent": 20
},
"clusterLimits": {
"enabled": true,
"cpu": {
"minCores": 4,
"maxCores": 100
}
}
}'
Step 3: Configure Node Templates via Terraform
resource "castai_node_template" "spot_workers" {
cluster_id = castai_eks_cluster.this.id
name = "spot-workers"
is_default = false
is_enabled = true
constraints {
min_cpu = 2
max_cpu = 16
min_memory = 4096
max_memory = 65536
spot = true
use_spot_fallbacks = true
fallback_restore_rate_seconds = 600
instance_families {
include = ["m5", "m6i", "c5", "c6i", "r5", "r6i"]
}
architectures = ["amd64"]
}
custom_labels = {
"workload-type" = "batch"
}
}
resource "castai_node_template" "gpu_ondemand" {
cluster_id = castai_eks_cluster.this.id
name = "gpu-ondemand"
is_default = false
is_enabled = true
Configure CAST AI Workload Autoscaler for pod-level right-sizing and VPA.
CAST AI Core Workflow: Workload Autoscaler
Overview
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.
Prerequisites
- Completed
castai-core-workflow-a(cluster-level policies) - CAST AI agent v1.60+ installed
- Workload Autoscaler enabled in CAST AI console
Instructions
Step 1: Install Workload Autoscaler Components
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}"
Step 2: Query Workload Recommendations
# 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
}'
Step 3: Configure Per-Workload Policies via Annotations
# 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
Step 4: Create a Scaling Policy via API
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",
&Maximize Kubernetes cost savings with CAST AI spot strategies and right-sizing.
CAST AI Cost Tuning
Overview
Maximize Kubernetes cost savings through CAST AI: spot instance strategies, workload right-sizing, cluster hibernation, and savings tracking. Typical savings: 50-70% on cloud compute costs.
Prerequisites
- CAST AI Phase 2 enabled with full automation
- Savings report available (requires 24h+ of data)
- Understanding of workload criticality tiers
Instructions
Step 1: Analyze Current Savings
# Get savings breakdown
curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/savings" \
| jq '{
currentMonthlyCost: .currentMonthlyCost,
optimizedMonthlyCost: .optimizedMonthlyCost,
monthlySavings: .monthlySavings,
savingsPercentage: .savingsPercentage,
spotSavings: .spotSavings,
rightSizingSavings: .rightSizingSavings
}'
Step 2: Maximize Spot Usage
# Enable aggressive spot with diversity and fallbacks
curl -X PUT -H "X-API-Key: ${CASTAI_API_KEY}" \
-H "Content-Type: application/json" \
"https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/policies" \
-d '{
"enabled": true,
"spotInstances": {
"enabled": true,
"clouds": ["aws"],
"spotDiversityEnabled": true,
"spotDiversityPriceIncreaseLimitPercent": 20,
"spotBackups": {
"enabled": true,
"spotBackupRestoreRateSeconds": 600
}
}
}'
Spot allocation strategy by workload tier:
| Workload Type | Spot % | Rationale |
|---|---|---|
| Batch jobs, CI runners | 100% spot | Interruptible, restartable |
| Stateless APIs (behind LB) | 80% spot | Can handle brief interruptions |
| Stateful services, databases | 0% spot | Use on-demand or reserved |
| ML training | 80-100% spot | Checkpointing handles interrupts |
Step 3: Workload Right-Sizing
# Get resource waste analysis
curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/workload-autoscaling/clusters/${CASTAI_CLUSTER_ID}/workloads" \
| jq '[.items[] | select(.estimatedSavingsPercent > 20) | {
name: .workloadName,
namespace: .namespace,
wastedCpu: (.currentCpuRequest - .recommendedCpuRequest),
wastedMemory: (.currentMemoryRequest - .recommendedMemoryRequest),
savingsPercent: .estimatedSavingsPercent
}] | sort_by(-.savingsPercent) | .[0:10]'
Step 4: Cluster Hibernation (Dev/Staging)
Collect CAST AI diagnostic bundle for support tickets and troubleshooting.
CAST AI Debug Bundle
Overview
Collect all CAST AI component logs, cluster state, and configuration into a single archive for troubleshooting or support tickets. The bundle captures agent status, Helm releases, autoscaler policies, node inventory, and recent events.
Prerequisites
kubectlaccess to the cluster running CAST AICASTAIAPIKEYandCASTAICLUSTERIDconfiguredhelminstalled
Instructions
Step 1: Run the Debug Bundle Script
#!/bin/bash
# castai-debug-bundle.sh
set -euo pipefail
BUNDLE_DIR="castai-debug-$(date +%Y%m%d-%H%M%S)"
mkdir -p "$BUNDLE_DIR"
echo "=== CAST AI Debug Bundle ===" | tee "$BUNDLE_DIR/summary.txt"
echo "Generated: $(date -u)" | tee -a "$BUNDLE_DIR/summary.txt"
echo "Cluster ID: ${CASTAI_CLUSTER_ID:-unknown}" | tee -a "$BUNDLE_DIR/summary.txt"
# 1. Helm releases
echo "--- Helm Releases ---" >> "$BUNDLE_DIR/summary.txt"
helm list -n castai-agent -o yaml > "$BUNDLE_DIR/helm-releases.yaml" 2>&1
# 2. Pod status
echo "--- Pod Status ---" >> "$BUNDLE_DIR/summary.txt"
kubectl get pods -n castai-agent -o wide > "$BUNDLE_DIR/pod-status.txt" 2>&1
# 3. Agent logs (last 200 lines each)
for deploy in castai-agent cluster-controller castai-evictor castai-spot-handler castai-workload-autoscaler; do
kubectl logs -n castai-agent "deployment/$deploy" --tail=200 \
> "$BUNDLE_DIR/${deploy}-logs.txt" 2>&1 || echo "Not found: $deploy" >> "$BUNDLE_DIR/summary.txt"
done
# 4. Cluster events (CAST AI related)
kubectl get events -n castai-agent --sort-by='.lastTimestamp' \
> "$BUNDLE_DIR/events.txt" 2>&1
# 5. Node inventory
kubectl get nodes -o wide > "$BUNDLE_DIR/nodes.txt" 2>&1
# 6. API cluster status (redact API key from output)
if [ -n "${CASTAI_API_KEY:-}" ] && [ -n "${CASTAI_CLUSTER_ID:-}" ]; then
curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/kubernetes/external-clusters/${CASTAI_CLUSTER_ID}" \
| jq '{name, status, agentStatus, providerType, createdAt}' \
> "$BUNDLE_DIR/cluster-status.json" 2>&1
curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/policies" \
> "$BUNDLE_DIR/policies.json" 2>&1
fi
# 7. RBAC check
kubectl get clusterrole -l app.kubernetes.io/managed-by=castai \
> "$BUNDLE_DIR/rbac.txt" 2>&1
# 8. Package bundle
tar -czf "$BUNDLE_DIR.tar.gz" "$BUNDLE_DIR"
rm -rf "$BUNDLE_DIR"
echo "BundlDeploy CAST AI across multi-cloud Kubernetes clusters with Terraform modules.
CAST AI Deploy Integration
Overview
Deploy CAST AI to EKS, GKE, and AKS clusters using official Terraform modules. Each cloud provider has a dedicated CAST AI module that handles IAM roles, node configuration, and autoscaler setup.
Prerequisites
- Terraform 1.0+
- CAST AI Full Access API key
- Cloud provider credentials configured
- Existing Kubernetes cluster
Instructions
EKS Deployment
# main.tf -- EKS cluster onboarding
module "castai_eks" {
source = "castai/eks-cluster/castai"
version = "~> 3.0"
api_token = var.castai_api_token
aws_account_id = data.aws_caller_identity.current.account_id
aws_cluster_region = var.region
aws_cluster_name = var.cluster_name
# IAM role for CAST AI to manage nodes
aws_instance_profile_arn = aws_iam_instance_profile.castai.arn
# Autoscaler configuration
autoscaler_policies_json = jsonencode({
enabled = true
unschedulablePods = { enabled = true }
nodeDownscaler = {
enabled = true
emptyNodes = { enabled = true, delaySeconds = 300 }
}
spotInstances = {
enabled = true
spotDiversityEnabled = true
}
clusterLimits = {
enabled = true
cpu = { minCores = 4, maxCores = 200 }
}
})
# Node templates
default_node_configuration = module.castai_eks.castai_node_configurations["default"]
}
GKE Deployment
module "castai_gke" {
source = "castai/gke-cluster/castai"
version = "~> 2.0"
api_token = var.castai_api_token
project_id = var.gcp_project_id
gke_cluster_name = var.cluster_name
gke_cluster_location = var.region
gke_credentials = base64decode(
google_container_cluster.this.master_auth[0].cluster_ca_certificate
)
autoscaler_policies_json = jsonencode({
enabled = true
unschedulablePods = { enabled = true }
nodeDownscaler = {
enabled = true
emptyNodes = { enabled = true, delaySeconds = 300 }
}
})
}
AKS Deployment
module "castai_aks" {
source = "castai/aks/castai"
version = "~> 1.0"
api_token = var.castai_api_token
aks_cluster_name = var.cluster_name
aks_cluster_region = var.region
node_resource_group = azurerm_kubernetes_cluster.this.node_resource_group
azure_subscription_id = data.azurerm_subscription.current.subscription_id
azure_tenant_id = data.azurerm_client_config.current.tenant_id
autoscaler_policies_json = jsonencode({
enabled = true
unschedulablePods = { enabled = true }
spotInstances = { enabled = true }
})
}
Multi-Cluster Deployment Pattern
# Deploy CAST AI across all clusters with a for_Query CAST AI cluster savings report and node inventory.
CAST AI Hello World
Overview
First API calls against the CAST AI REST API: list connected clusters, retrieve the savings report, and inspect node inventory. All examples use curl with the X-API-Key header -- no SDK required.
Prerequisites
- Completed
castai-install-authsetup CASTAIAPIKEYenvironment variable set- At least one cluster connected to CAST AI
Instructions
Step 1: List Connected Clusters
curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
https://api.cast.ai/v1/kubernetes/external-clusters \
| jq '.items[] | {id, name, status, providerType}'
Expected output:
{
"id": "abc123-def456",
"name": "production-eks",
"status": "ready",
"providerType": "eks"
}
Step 2: Get Cluster Savings Report
export CASTAI_CLUSTER_ID="your-cluster-id"
# Current month savings
curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/savings" \
| jq '{
monthlySavings: .monthlySavings,
savingsPercentage: .savingsPercentage,
currentCost: .currentMonthlyCost,
optimizedCost: .optimizedMonthlyCost
}'
Step 3: List Cluster Nodes
curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/kubernetes/external-clusters/${CASTAI_CLUSTER_ID}/nodes" \
| jq '.items[] | {
name: .name,
instanceType: .instanceType,
lifecycle: .lifecycle,
cpu: .allocatableCpu,
memory: .allocatableMemory,
zone: .zone
}'
Step 4: Check Autoscaler Policies
curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/policies" \
| jq '{
enabled: .enabled,
unschedulablePods: .unschedulablePods.enabled,
nodeDownscaler: .nodeDownscaler.enabled,
spotInstances: .spotInstances.enabled
}'
Output
- List of connected clusters with IDs and status
- Monthly savings report with before/after cost
- Node inventory with instance types and lifecycle (spot vs on-demand)
- Autoscaler policy status
Error Handling
| Error | Cause | Solution | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
401 Unauthorized |
Bad API key | Regenerate at console.cast.ai | ||||||||||
404 Not Found |
Wrong cluster ID | List clusters first to get correct ID | ||||||||||
Empty items array |
No clusters connected |
Install and configure CAST AI agent on a Kubernetes cluster with API key authentication.
ReadWriteEditBash(helm:*)Bash(kubectl:*)Bash(terraform:*)Grep
CAST AI Install & AuthOverviewConnect a Kubernetes cluster (EKS, GKE, AKS, or KOPS) to CAST AI for cost optimization, autoscaling, and security scanning. Covers API key generation, Helm chart installation of the CAST AI agent, and Terraform provider setup. Prerequisites
InstructionsStep 1: Generate an API KeyLog in to https://console.cast.ai and navigate to API > API Access Keys. Create a Full Access key for Terraform-managed clusters, or Read-Only for monitoring-only.
Step 2: Install the CAST AI Agent via Helm
Step 3: Enable Full Automation (Phase 2)
Step 4: Terraform Provider (Alternative)Set up a local Kubernetes development loop with CAST AI cost monitoring.
ReadWriteEditBash(kubectl:*)Bash(helm:*)Bash(terraform:*)Grep
CAST AI Local Dev LoopOverviewFast 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. Prerequisites
InstructionsStep 1: Project Structure
Step 2: Dev Cluster with Relaxed Policies
Step 3: Quick Savings Check Script
Step 4: Terraform Plan-Apply LoopOptimize CAST AI autoscaler performance, node provisioning speed, and API efficiency.
ReadWriteEditBash(curl:*)Bash(kubectl:*)
CAST AI Performance TuningOverviewTune CAST AI for faster node provisioning, more responsive autoscaling, and efficient API usage. Covers headroom configuration, instance family selection, and API caching for multi-cluster dashboards. Prerequisites
InstructionsStep 1: Optimize Node Provisioning Speed
Headroom pre-provisions spare capacity so pods schedule immediately instead of waiting 2-5 minutes for new nodes. Step 2: Instance Family Optimization
Step 3: Evictor Tuning for Faster Consolidation
Step 4: API Performance for Multi-Cluster DashboardsProduction readiness checklist for CAST AI cluster onboarding.
ReadBash(kubectl:*)Bash(curl:*)Bash(helm:*)Grep
CAST AI Production ChecklistOverviewComplete checklist for enabling CAST AI cost optimization on a production Kubernetes cluster. Covers Phase 1 (monitoring) through Phase 2 (full automation) with validation steps at each stage. Prerequisites
Phase 1: Monitoring Only
Phase 2: Autoscaling Enabled
Workload Autoscaler
Security
Monitoring and Alerting
Rollback ProcedureHandle CAST AI API rate limits with backoff and request queuing.
ReadWriteEdit
CAST AI Rate LimitsOverviewThe CAST AI REST API enforces rate limits per API key. The autoscaler agent communicates cluster state at 15-second intervals. For custom API integrations, implement exponential backoff and request queuing to avoid hitting limits. Prerequisites
Rate Limit Behavior
InstructionsStep 1: Detect Rate Limits from Response Headers
Step 2: Exponential Backoff with Jitter
Step 3: Request Queue for Batch OperationsCAST AI reference architecture for multi-cluster Kubernetes cost optimization.
ReadWriteEditGrep
CAST AI Reference ArchitectureOverviewProduction-grade architecture for managing CAST AI across multiple Kubernetes clusters. Covers Terraform module layout, per-environment policies, API key management, and observability integration. Prerequisites
Terraform Module Structure
Reusable ModuleProduction-ready CAST AI REST API wrapper patterns in TypeScript and Python.
ReadWriteEdit
CAST AI SDK PatternsOverviewCAST AI uses a REST API with Prerequisites
InstructionsStep 1: TypeScript API ClientSecure CAST AI API keys, RBAC configuration, and Kvisor security agent.
ReadWriteEditBash(kubectl:*)Bash(helm:*)Grep
CAST AI Security BasicsOverviewSecure your CAST AI integration: API key management, RBAC least-privilege, Kvisor runtime security agent, and network policy configuration. Prerequisites
InstructionsStep 1: API Key Management
Step 2: RBAC Least-Privilege Review
Step 3: Enable Kvisor Security Agent
Step 4: Network Policies
Step 5: Security Checklist
Upgrade CAST AI Helm charts, Terraform provider, and agent components.
ReadWriteEditBash(helm:*)Bash(terraform:*)Bash(kubectl:*)
CAST AI Upgrade & MigrationOverviewUpgrade CAST AI components: Helm charts for the agent/controller/evictor, Terraform provider version, and workload autoscaler. Includes rollback procedures for each component. Prerequisites
InstructionsStep 1: Check Current Versions
Step 2: Review Changelog
Step 3: Upgrade on Staging First
Step 4: Upgrade Terraform Provider
Step 5: Validate After Upgrade
Rollback ProcedureConfigure CAST AI webhook notifications for cluster events and audit logs.
ReadWriteEditBash(curl:*)
CAST AI Webhooks & EventsOverviewCAST AI emits events for node lifecycle changes, autoscaler decisions, and security findings. Configure webhook endpoints or use the audit log API to track all cluster operations. Integrates with Slack, PagerDuty, and custom HTTP endpoints. Prerequisites
InstructionsStep 1: Configure Notification Channels in ConsoleNavigate to console.cast.ai > your cluster > Notifications. Available channels:
Step 2: Query Audit Log via API
Step 3: Build a Custom Notification HandlerReady to use castai-pack?Related Pluginsai-ethics-validatorAI ethics and fairness validation ai-experiment-loggerTrack and analyze AI experiments with a web dashboard and MCP tools ai-ml-engineering-packProfessional AI/ML Engineering toolkit: Prompt engineering, LLM integration, RAG systems, AI safety with 12 expert plugins ai-sdk-agentsMulti-agent orchestration with AI SDK v5 - handoffs, routing, and coordination for any AI provider (OpenAI, Anthropic, Google) anomaly-detection-systemDetect anomalies and outliers in data automl-pipeline-builderBuild AutoML pipelines
Tags
castaicast aisaassdkintegration
|