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:
- The CDC detects the deletion.
- It executes
helm uninstall. - It cleans up any extra resources it created (e.g., finalizers).
- 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:
- The Core Provider detects the deletion.
- It removes the generated CRD.
- It deletes the associated CDC deployment.
- It cleans up the scoped RBAC policies.
Troubleshooting Deletionsโ
If a resource is stuck in Terminating:
- Check the CDC logs for Helm errors:
kubectl logs -n krateo-system -l app=composition-dynamic-controller - Ensure the CDC has enough permissions to delete all resources in the chart.
- See Troubleshooting for additional error patterns.