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:
helm uninstall <release>— SPAR workloads, services, Helm-owned secrets/configmaps, istio virtualservices/gateways, etc.Deletes leftover subchart Jobs and their Pods (
postgres-init).Sweeps leftover Secrets/ConfigMaps labelled
app.kubernetes.io/instance=<release>.Drops the Postgres database and role for this release, by
kubectl execinto the Postgres pod (it terminates connections, thenDROP DATABASE/DROP ROLE).Deletes PVCs labelled with the release.
Deletes PVs still bound to those PVCs (typically
ReleasedPVs created withreclaimPolicy=Retain).
Database dropped
Only the database this chart's postgres-init created:
<release-with-underscores>— e.g. releasespar→ databasespar, rolespar_user.
It does not drop databases owned by other components.
What it preserves
The script never deletes the PostgreSQL pod/instance (commons-postgresql). It only kubectl execs into it to drop SPAR's own database and role. Other databases and all other components are left untouched.
Usage
Options
--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?