For the complete documentation index, see llms.txt. This page is also available as Markdown.

Teardown / Uninstall

Completely uninstalling a SPAR release

helm uninstall removes the SPAR workloads, but it does not drop the PostgreSQL database and role — those live inside the shared commons-postgresql instance and are not owned by the Helm release, so they survive. A subchart Job (postgres-init) and any retained PVs also linger. The repository ships an uninstall script that cleans all of this up safely.

Script: deployment/scripts/uninstall-spar.sh

What it does

In order:

  1. helm uninstall <release> — SPAR workloads, services, Helm-owned secrets/configmaps, istio virtualservices/gateways, etc.

  2. Deletes leftover subchart Jobs and their Pods (postgres-init).

  3. Sweeps leftover Secrets/ConfigMaps labelled app.kubernetes.io/instance=<release>.

  4. Drops the Postgres database and role for this release, by kubectl exec into the Postgres pod (it terminates connections, then DROP DATABASE / DROP ROLE).

  5. Deletes PVCs labelled with the release.

  6. Deletes PVs still bound to those PVCs (typically Released PVs created with reclaimPolicy=Retain).

Database dropped

Only the database this chart's postgres-init created:

  • <release-with-underscores> — e.g. release spar → database spar, role spar_user.

It does not drop databases owned by other components.

What it preserves

Usage

Options

Flag
Default
Description

--namespace, -n

(required)

Release namespace.

--release

spar

Helm release name (determines the DB/role names).

--postgres-release

commons-postgresql

Postgres Helm release to exec into.

--postgres-namespace

same as --namespace

Namespace of the Postgres instance.

--keep-pvs

off

Delete PVCs but keep the PVs.

--dry-run

off

Print actions, change nothing.

--yes, -y

off

Skip the interactive confirmation.

Requires: kubectl (cluster admin), helm, jq, and bash 4+.

Last updated

Was this helpful?