Depending on how you used and managed CAST in a cluster, you can remove it in two distinct ways.
Run the [terraform destroy](https://developer.hashicorp.com/terraform/cli/commands/destroy) command to remove the resources. Terraform will destroy all remote objects managed by a particular configuration.
If you want to disconnect your cluster from CAST AI, click the Disconnect cluster button on the list of clusters and follow instructions on the screen.
Alternatively, run the following command in your terminal to access the cluster:
kubectl delete namespace castai-agent
Apart from that, delete the following Kubernetes objects related to the CAST AI agent:
Once the cluster is disconnected, its status will update to
Disconnected. You can remove it from the console by pressing the Delete cluster button.
The cluster will continue to run as normal as deleting the cluster in CAST AI only removes it from the console.
In the console, choose the Disconnect cluster option.
Enter the cluster name in the form and tick the checkbox to delete all the nodes CAST AI created. Please note that this might cause downtime due to reduced cluster capacity.
When the cluster disconnects from the Cast AI, it changes its status label from
Press the Remove cluster button, and you will get a script to clean up cloud resources, like Roles, Bindings, and ServiceAccounts.
Follow these steps to ensure that you remove CAST AI from your cluster altogether:
- In the CAST AI console, go to the Autoscaler page and click the Disable all policies option.
- Disconnect the cluster by clicking the Disconnect cluster button and follow instructions on the screen.
- Execute the provided offboarding script to remove CAST AI-created resources from your cloud account.
To check for CAST AI spot webhook configuration leftovers in the cluster, run the following in your terminal:
kubectl get mutatingwebhookconfigurations
If you find
castai-pod-node-lifecycle on the list, delete it by running the following:
kubectl delete mutatingwebhookconfigurations castai-pod-node-lifecycle
Updated about 1 month ago