Disconnect your cluster

Remove CAST resources from a cluster

Based on the way how CAST was used on a cluster there are two options to remove CAST resources.

Disconnect a cluster

In order to disconnect your cluster from CAST AI click Disconnect cluster button in Clusters list and follow the guidance. Alternatively run following command from your terminal used to access the cluster:

kubectl delete namespace castai-agent

On top of that, also delete following kubernetes objects related to castai-agent:

  • serviceaccount and secret
  • clusterrole and clusterrolebinding
  • role and rolebinding
  • resourcequota
  • configmap

Once cluster is disconnected its Status will change to Disconnected and you can choose to remove it from console by pressing Delete cluster button.

📘

Cluster will continue to run as normal, since Delete cluster action only removes it from CAST AI console.

Removing CAST AI credentials and other resources

In order to remove CAST AI follow these steps:

  • Go to CAST AI console → Autoscaler page → Disable all policies
  • Disconnect the cluster by clicking Disconnect cluster button and following the guidance

With above mentioned pre-requisites completed, go to the cloud provider's console and remove CAST AI resources (e.g. AWS Security group, GKE Service account or AKS application).

Potential Spot Webhook leftovers

Check if there is CAST AI spot webhook configuration leftover in the cluster by executing the following in the Terminal:

kubectl get mutatingwebhookconfigurations

If you can find castai-pod-node-lifecycle in the list, you should delete it by executing the following:

kubectl delete mutatingwebhookconfigurations castai-pod-node-lifecycle