Decommission a Kubernetes Cluster

In this guide, you will remove a Kubernetes cluster from Turbot Guardrails. This involves uninstalling the Helm agent from the cluster and then removing the cluster resource from the Guardrails console.

Prerequisites

Step 1: Uninstall the Helm Agent

Remove the Guardrails agent and all its associated Kubernetes resources:

helm uninstall guardrails-agent-kubernetes --namespace guardrails

This removes the StatefulSet, service account, secrets, and other components that were created during installation.

Step 2: Remove the Cluster from Guardrails

  1. Navigate to the Kubernetes cluster resource in the Guardrails console.
  2. Click the Actions menu (top right) and select Remove from Turbot. If you don't see this option, contact your Guardrails administrator for proper access.
  3. Copy the cluster name and paste it into the confirmation text box.
  4. Click Delete.

Guardrails will begin the delete process. The time to complete depends on the number of resources and policies that need to be removed: the more resources, the longer it takes.

[!CAUTION] While decommissioning is not irreversible (you can redeploy the agent to reconnect), it can be time-consuming and resource-intensive. Double-check that you're removing the correct cluster before confirming.

Error Handling

The deletion process involves complex database transactions. If deletion fails due to referential integrity issues or database locking:

  1. Verify that the Helm agent has been fully uninstalled.
  2. Ensure that event handler and credential policies have been cleared.
  3. Retry the deletion.

If the error persists after several hours and you have confirmed the agent is uninstalled, contact Turbot Support.