This repository contains Terraform code to deploy CAST AI components on an "anywhere" (on-prem/Minikube) Kubernetes cluster. The configuration deploys two components:
- CAST AI Agent
- CAST AI Cluster Controller
- **CAST AI Evictor
- **CAST AI Pod Mutator
- **CAST AI Workload Autoscaler
Before deploying, ensure you have the following installed and configured:
- Terraform (v1.x recommended)
Download Terraform - Minikube
Start Minikube - Docker Desktop (make sure Docker is running)
Download Docker Desktop - kubectl
Install kubectl - Helm
Install Helm
You will also need:
- A valid CAST AI API Key (https://docs.cast.ai/docs/authentication)
- A unique cluster identifier (for example,
minikube-anywhere-cluster)
- main.tf
Contains the Terraform configuration to:- Start Minikube and wait until it is ready.
- Configure the Kubernetes and Helm providers (using the
minikubecontext). - Create the required namespace.
- Deploy the CAST AI Components.
- variables.tf
Defines variables for CAST AI API key, cluster identifier, and configurations. - outputs.tf
Displays outputs such as the status of the deployed components.
Clone the repository to your local machine:
git clone https://github.com/juliette-cast/castai-anywhere-terraform.git
cd castai-anywhere-terraformRun the following command to initialize Terraform and download the required providers:
terraform initEnsure the configuration is correct:
terraform validatePreview what Terraform will create:
terraform planThis will create the cluster and Deploy the CAST AI Agentand connect to the UI, then you will use the clustr ID from the console to add to your vaoraibles to deploy the other components
terraform applyterraform applyCheck the status of deployed components:
kubectl get pods -n castai-agentExpected output:
NAME READY STATUS RESTARTS AGE
castai-agent-79bf777cc8-8w88l 2/2 Running 0 22m
castai-agent-79bf777cc8-kvf2q 2/2 Running 0 22m
castai-agent-cpvpa-964fc94b6-pqfzc 1/1 Running 0 23m
castai-cluster-controller-77dffcd8f5-7jflv 2/2 Running 0 19m
castai-cluster-controller-77dffcd8f5-cpnp6 2/2 Running 0 19m
castai-evictor-64bdd9fb6c-tmxjv 1/1 Running 0 37s
castai-evictor-cpvpa-6c6bdf8f74-r2m4b 1/1 Running 0 37s
castai-pod-mutator-7556c5db85-pqrwx 1/1 Running 0 16m
castai-pod-mutator-7556c5db85-tqzsh 1/1 Running 1 16m
castai-workload-autoscaler-64655596c4-b72l7 1/1 Running 0 15m
castai-workload-autoscaler-64655596c4-x7bj8 1/1 Running 1 (15m ago) 15m- Log in to CAST AI Console
- Navigate to
Clusters - Confirm that the Minikube cluster is "Connected"
If you need to remove the deployment, run:
terraform destroyor delete the castai-agent namespace
kubectl delete ns castai-agentIf you need to delete the minikube cluster, run the below command then check on Docker if it's deleted:
minikube delete