Following example creates AKS cluster and its supporting resources.
After AKS cluster is created it is onboarded to CAST AI.
Kvisor security agent is deployed to the cluster and security policies are enabled.
See install_security_agent and kvisor_values variables in castai.tf file.
Example configuration should be analysed in the following order:
- Create Virtual network -
vnet.tf - Create AKS cluster -
aks.tf - Create CAST AI related resources to connect AKS cluster to CAST AI -
castai.tf
- Rename
tf.vars.exampletotf.vars - Update
tf.varsfile with your cluster name, cluster region and CAST AI API token. - Initialize Terraform. Under example root folder run:
terraform init
- Run Terraform apply:
terraform apply -var-file=tf.vars
- To destroy resources created by this example:
terraform destroy -var-file=tf.vars
Please refer to this guide if you run into any issues https://docs.cast.ai/docs/terraform-troubleshooting