Skip to main content
Version Next

Uninstallation

This guide explains how to remove TDP Kubernetes components in an organized and safe way.

Before you begin

Clarify what is being removed:

  • components installed directly with Helm
  • Applications managed by Argo CD
  • Argo CD itself, when it is also part of the removal

This document keeps each scenario clearly separated.

Attention

Removing Kubernetes resources does not automatically remove persisted data. PVCs, PVs, snapshots, and the namespace must be considered separately.

Before you run any removal, identify how the component or environment was deployed.

1. Check whether the component was installed with Helm

Use this command to list existing Helm releases in the namespace:

Terminal input
helm list -n <namespace>
Figure 1 - Existing Helm releases
Figure 1 - Existing Helm releases

If the component appears in this list, the primary removal path is helm uninstall.

2. Check whether the component is managed by Argo CD

Use this command to list Applications managed by Argo CD:

Terminal input
argocd app list
Figure 2 - Applications managed by Argo CD
Figure 2 - Applications managed by Argo CD

If the component appears as an Argo CD Application, the primary removal path is argocd app delete.

Practical rule

Do not mix flows unnecessarily. If the component is managed by Argo CD, the primary path is to delete the Application. If it was installed directly with Helm, the primary path is to remove the Helm release.

Preparation before removal

Back up data

Before removing any stateful component, back up anything that must be preserved.

Common examples:

  • PostgreSQL: database dump
  • ClickHouse: export tables and schemas
  • Airflow: DAGs, variables, and connections
  • OpenMetadata: metadata and lineage
  • Ranger: policies and relevant configuration

Export the Helm release configuration

When the component was installed with Helm, export the values currently applied:

Terminal input
helm get values <release> -n <namespace> -o yaml > <release>-values-backup.yaml
Figure 3 - Exporting the Helm release configuration
Figure 3 - Exporting the Helm release configuration
Note

This file usually contains the values overridden during install or upgrade.
To see every parameter accepted by the chart, use helm show values on the corresponding chart.

To export values for all releases in the namespace in one go:

Terminal input
for release in $(helm list -n <namespace> -q); do
helm get values "$release" -n <namespace> -o yaml > "${release}-values-backup.yaml"
echo "Backup of $release completed"
done

Identify associated PVCs

Before removing the component, check whether persistent volumes are associated with it:

Terminal input
kubectl get pvc -n <namespace>
Figure 4 - PVCs associated with the release
Figure 4 - PVCs associated with the release

To narrow the query to a specific Helm release:

Terminal input
kubectl get pvc -n <namespace> -l app.kubernetes.io/instance=<release>

Create persistent volume snapshots when supported

If the cluster supports CSI snapshots and a VolumeSnapshotClass is available, create snapshots of critical PVCs before removal.

Check whether the cluster supports snapshots:

Terminal input
kubectl get volumesnapshotclass

Create the snapshot:

Terminal input
kubectl apply -f - <<EOT
apiVersion: snapshot.storage.k8s.io/v1
kind: VolumeSnapshot
metadata:
name: <pvc-name>-final-snapshot
namespace: <namespace>
spec:
volumeSnapshotClassName: <snapshot-class>
source:
persistentVolumeClaimName: <pvc-name>
EOT

Verify the result:

Terminal input
kubectl get volumesnapshot -n <namespace>

Removing components

Uninstall a single component

Use this flow when the component was installed directly as a Helm release.

Uninstall the release

Terminal input
helm uninstall <release> -n <namespace>
Figure 5 - Uninstalling a component with Helm
Figure 5 - Uninstalling a component with Helm

Verify that the release resources were removed

Terminal input
kubectl get all -n <namespace> -l app.kubernetes.io/instance=<release>
Figure 6 - Resources still tied to the release after uninstall
Figure 6 - Resources still tied to the release after uninstall
note

This command shows what is still associated with the release after helm uninstall. If the output is empty, the resources were removed successfully.

Check remaining PVCs

Terminal input
kubectl get pvc -n <namespace> -l app.kubernetes.io/instance=<release>
Figure 7 - Remaining PVCs
Figure 7 - Remaining PVCs
Note

helm uninstall removes the release and its associated Kubernetes resources — Deployments, StatefulSets, Services, ConfigMaps, and Secrets. PVCs are usually not removed automatically.

Remove the full environment with Helm

Use this flow when the entire environment was deployed directly with Helm, without Applications managed by Argo CD.

Remove releases in reverse dependency order

Terminal input
helm uninstall tdp-superset -n <namespace>
helm uninstall tdp-openmetadata -n <namespace>
helm uninstall tdp-cloudbeaver -n <namespace>
helm uninstall tdp-jupyter -n <namespace>
helm uninstall tdp-airflow -n <namespace>
helm uninstall tdp-clickhouse -n <namespace>
helm uninstall tdp-trino -n <namespace>
helm uninstall tdp-spark -n <namespace>
helm uninstall tdp-nifi -n <namespace>
helm uninstall tdp-ranger -n <namespace>
helm uninstall tdp-iceberg -n <namespace>
helm uninstall tdp-deltalake -n <namespace>
helm uninstall tdp-hive-metastore -n <namespace>
helm uninstall tdp-kafka -n <namespace>
helm uninstall tdp-postgresql -n <namespace>
helm uninstall tdp-argo -n <namespace>
helm uninstall tdp-argo-crds -n <namespace>

Check remaining PVCs

Terminal input
kubectl get pvc -n <namespace>

Remove PVCs if the teardown is definitive

Terminal input
kubectl delete pvc --all -n <namespace>
Figure 8 - Definitive removal of PVCs
Figure 8 - Definitive removal of PVCs
Data loss

Deleting PVCs permanently removes persisted data. Do this only when the teardown is definitive and backups are complete.

Additional cleanup

Check for orphaned PersistentVolumes

After removing PVCs, check for PVs in Released state:

Terminal input
kubectl get pv | grep <namespace>
Figure 13 - Checking for orphaned PersistentVolumes
Figure 13 - Checking for orphaned PersistentVolumes

If there are orphaned PVs and you no longer need them:

Terminal input
kubectl delete pv <pv-name>
Figure 14 - Deleting PVs
Figure 14 - Deleting PVs

Remove the namespace, when applicable

Delete the namespace only when it is dedicated exclusively to the environment being torn down.

Terminal input
kubectl delete namespace <namespace>
Attention

Deleting the namespace removes all namespaced resources still in it, including PVCs, ConfigMaps, Secrets, and ServiceAccounts.

If the namespace is stuck in Terminating, check finalizers:

Terminal input
kubectl get namespace <namespace> -o json | jq '.spec.finalizers'

To force finalization:

Terminal input
kubectl get namespace <namespace> -o json | jq '.spec.finalizers = []' | \
kubectl replace --raw "/api/v1/namespaces/<namespace>/finalize" -f -

Final verification

After removal, confirm nothing unexpected remains.

Check remaining resources in the namespace

Terminal input
kubectl get all -n <namespace>

Check remaining Helm releases

Terminal input
helm list -n <namespace>

Check remaining Applications in Argo CD

Terminal input
argocd app list

Check remaining PVCs

Terminal input
kubectl get pvc -n <namespace>

Check remaining PVs

Terminal input
kubectl get pv | grep <namespace>

Summary

SituationPrimary pathNote
Component installed directly with Helmhelm uninstall <release> -n <namespace>Use when a real Helm release exists
Component managed by Argo CDargocd app delete <application-name> --cascadeDeletes the Application and managed resources
Full removal of environment managed by Argo CDargocd app delete ... --cascade in reverse order, or delete the root appPVCs and PVs may need manual cleanup
Removing Argo CD itselfhelm uninstall tdp-argo -n <namespace>Should happen after Applications are removed
Full removal of environment installed with Helmsequence of helm uninstall in reverse orderSeparate flow from the Argo CD model
Cleaning up persistent datakubectl delete pvc ... and, if needed, kubectl delete pv ...Manual, destructive step
Namespace cleanupkubectl delete namespace <namespace>Only when the namespace is dedicated to the removed environment