Skip to main content
Version: Next ๐Ÿšง

How to: Delete Safely

Removing Krateo resources should be done in a specific order to ensure Helm releases are uninstalled and Kubernetes resources are cleaned up without leaving orphaned objects.

Concepts: Lifecycle Workflow ยท Security by Design


1. Delete a Compositionโ€‹

Deleting a Composition resource triggers the helm uninstall of the associated release.

kubectl delete composition <name> --namespace <namespace>

What happens:

  1. The CDC detects the deletion.
  2. It executes helm uninstall.
  3. It cleans up any extra resources it created (e.g., finalizers).
  4. Once the uninstall succeeds, the Composition resource is removed.

2. Delete a CompositionDefinitionโ€‹

Only delete a CompositionDefinition after all its managed Compositions have been removed.

kubectl delete compositiondefinition <name> --namespace <namespace>

What happens:

  1. The Core Provider detects the deletion.
  2. It removes the generated CRD.
  3. It deletes the associated CDC deployment.
  4. It cleans up the scoped RBAC policies.

Troubleshooting Deletionsโ€‹

If a resource is stuck in Terminating:

  1. Check the CDC logs for Helm errors:
    kubectl logs -n krateo-system -l app=composition-dynamic-controller
  2. Ensure the CDC has enough permissions to delete all resources in the chart.
  3. See Troubleshooting for additional error patterns.

Next stepsโ€‹