Skip to main content
CRM and Fees guidance marked legacy on this page applies only to legacy releases that already exist. Midaz v4 deploys the unified Ledger and serves CRM and Fees on /v2.
The Helm repository retains a crm.enabled workload and the plugin-fees-helm chart for older application releases. These are legacy compatibility surfaces, not the Midaz v4 deployment model. This guide walks you through fully removing a Midaz deployment from Kubernetes. helm uninstall removes the Helm-managed resources. What happens to the database volumes depends on the bundled subcharts, so read their storage settings before you run it.
Uninstalling Midaz can permanently delete application data. Back up before running it, not after. This operation is irreversible.

What uninstall deletes and what survives


No chart resource carries a helm.sh/resource-policy: keep annotation. Do not rely on Helm to protect any volume.

Prerequisites


Before uninstalling, list the claims so that you know what exists:
Then back up your databases:
Then back up your current Helm values so you can reinstall with the same configuration if needed:
Also back up any plugin releases you run separately (plugins install into their own namespace, midaz-plugins):
CRM is a module inside the midaz-helm chart. You enable it with the crm values block. No CRM chart exists. You do not back it up or uninstall it separately.
Verify all releases that the uninstall affects:

Uninstalling the Helm release


Run the following command to uninstall the Midaz Helm release:
This removes the Kubernetes resources that the Helm chart created: Deployments, StatefulSets, Services, Ingresses, ConfigMaps, chart-managed Secrets, ServiceAccounts, RBAC resources, and bootstrap Jobs. It does not remove Secrets you created outside Helm, or the namespace. Verify that no Helm-managed pods remain:

Cleaning up persistent resources


PersistentVolumeClaims

List the claims that survived the uninstall:
Delete only the Midaz PVCs that you identified above. Do not use a namespace-wide delete when other workloads share the namespace:
Deleting these PVCs permanently destroys the volume data, the ledger’s system of record. Make sure database backups are in place before running this command.

Secrets

helm uninstall does not remove secrets created outside the Helm release lifecycle (e.g., kubectl create secret). List all secrets in the namespace and identify any that you no longer need:
Delete individual orphaned secrets:
Or delete all secrets in the namespace:

ConfigMaps

ConfigMaps created manually or by bootstrap jobs may also remain. List them:
Delete orphaned ConfigMaps:

Namespace cleanup


When no resources remain inside the namespace, delete the namespace itself:
Deleting the namespace will forcefully remove any remaining resources inside it. If a resource is stuck in Terminating state, you may need to remove its finalizers manually.
Verify the namespace is gone:

Complete cleanup


For staging, evaluation, or CI environments where a full teardown is safe, the following script automates the entire process:
Data loss is permanent. Run this only in environments where you have confirmed backups or where data loss is acceptable (staging, evaluation, CI). Do not run this in production without a full backup and team sign-off. The script assumes a namespace that holds Midaz alone. It removes every claim, Secret and ConfigMap in that namespace.
Save this as midaz-cleanup.sh, make it executable (chmod +x midaz-cleanup.sh), and run it with ./midaz-cleanup.sh.

Production considerations


In production, a full uninstall requires careful coordination. Follow these steps before running any cleanup commands:
  1. Back up all databases before helm uninstall. Export a full snapshot of PostgreSQL and MongoDB.
  2. Export critical data. If you must migrate or preserve any data, export it before uninstalling.
  3. Coordinate with your team. Notify all stakeholders of planned downtime and confirm the maintenance window.
  4. Uninstall plugins first. Remove plugin releases (Fees, Pix) before uninstalling the core Midaz release.
  5. Verify no traffic. Confirm that no active traffic reaches the services before you proceed.
Uninstall plugins before the core release:
Then proceed with the persistent resource cleanup steps described above.