Skip to main content

Uninstall and Teardown

Removing an OLIVE deployment is not the reverse of installing it. Deleting the deployments removes the workloads; it does not remove the data, the identities, or the configuration that lives outside the namespace. Some of what stays behind is deliberate — it is what protects you from destroying a tenant's data with a mistyped command. The rest is what makes a rebuilt tenant behave strangely.

This page covers three cases: removing one tenant, removing the whole platform, and removing the infrastructure components underneath it.

Export before you remove anything

Storage is deleted with the namespace. Export the content of every tenant with the repository editor or the import/export API, verify the exports by opening them, and keep them outside the cluster.

An OCB export is a connectivity backup. It does not contain cluster state, Vault data, or the Keycloak realm. Those need their own backup if you intend to restore them.


What deleting a deployment actually removes​

ObjectRemoved with the deployment?Notes
Deployments, StatefulSets, Services, Ingresses, ConfigMapsYes
The namespaceYes, if tenant-setup is removed tooIt renders the Namespace object, so removing that chart removes everything in the namespace
PersistentVolumeClaimsNo, when only the StatefulSet is deletedCouchDB and the other data stores set persistentVolumeClaimRetentionPolicy: Retain for both whenDeleted and whenScaled. Deleting the namespace deletes them anyway
PersistentVolumesDepends on the StorageClass reclaim policyDelete removes the volume with the claim; Retain leaves it, and it must be released manually before the capacity returns
Vault policies, Kubernetes auth roles and KV dataNoVault is a cluster-level dependency, outside the deployment
The Keycloak realm, its clients and usersNoKeycloak is a cluster-level dependency, outside the deployment
Cluster-scoped objects — the Kyverno policies, ClusterIssuer, mesh configurationNoNot owned by the tenant deployment, and generally not yours to remove — see below
DNS records pointing at the tenant subdomainNoOwned by whoever manages DNS
A PVC that survives will be re-bound

A new deployment with the same names will bind an existing claim and start with the old content in it. This looks like a successful fresh install right up until the data turns out to be from the deployment you thought you had deleted. Confirm with kubectl get pvc -A and kubectl get pv that nothing from the old deployment is left.


Removing one tenant​

  1. Export the tenant's content and verify the export.
  2. Remove the tenant entry from the infrastructure Git repository. With Argo CD configured for pruning, the tenant's Applications and their resources are removed. Without pruning, the Applications are orphaned and the resources stay — check rather than assume.
  3. Wait until the namespace is actually gone. kubectl get ns must no longer list it. A namespace stuck in Terminating normally has a resource with a finalizer that cannot complete; resolve that rather than force-removing the finalizer, which leaves the resource behind untracked.
  4. Confirm storage is released: kubectl get pvc -A and kubectl get pv. Volumes on a Retain class stay Released and hold capacity until you remove them.
  5. Clean up Vault — see below.
  6. Clean up Keycloak — see below.
  7. Rescale the shared services if the tenant's load was a significant share of them. See Platform Scaling.

Cleaning up Vault​

Per-tenant objects are created by vault-secrets-setup and named after the tenant, so they are straightforward to find and — precisely because they are not removed automatically — easy to forget.

  • KV data under secret/shared-secrets-<tenant>/ — the storage credentials, the Keycloak credentials, the OAuth2 Proxy secret, the Vault client token.
  • Policies named after the tenant: shared-secrets-<tenant>, tenant-sync-<tenant>, tenant-infra-<tenant>, keycloak-onboard-<tenant>, token-issuer-<tenant>, read-repo-secrets-<tenant>, edit-repo-secrets-<tenant>, read-couchdb-secrets-<tenant>, read-seaweedfs-secrets-<tenant>, and — on a cluster that once ran a pre-1.3 release — control-plane-<tenant>.
  • Kubernetes auth roles: shared-secrets-role-<tenant>, vso-sync-role-<tenant>, tenant-infra-role-<tenant>, keycloak-onboard-role-<tenant>, token-issuer-role-<tenant>.
vault kv list secret/shared-secrets-<tenant>
vault policy list | grep <tenant>
vault list auth/kubernetes/role | grep <tenant>

Leaving them in place is a real exposure: an auth role bound to a ServiceAccount name in a namespace that no longer exists becomes usable again the moment anyone creates a namespace and ServiceAccount with those names.

Reusing a tenant name without cleaning Vault

Vault outlives a namespace teardown. Recreating a tenant under the same name against leftover Vault state is the classic way to get a tenant that onboards halfway and then fails identically on every retry. If you intend to reuse the name, clean the tenant's Vault paths, policies and roles first — do not rely on the new deployment to overwrite them.

Cleaning up Keycloak​

Each tenant has a realm named after it, containing the tenant's four OLIVE clients, its users and their role assignments. Removing the OLIVE deployment does not touch it.

Decide deliberately: keeping the realm preserves the user accounts and their history, which may be exactly what you want if the tenant is coming back or if the accounts are subject to a retention obligation. Keeping it while the tenant is gone means credentials that grant access to nothing — inert, but still credentials. If you remove it, remove the realm rather than only the client, so nothing is left half-configured.


Removing the whole platform​

This is the path the 1.2 to 1.3 migration uses, because 1.3 is a fresh deployment rather than an upgrade.

Work outward, so that nothing is left calling something that has already gone:

  1. Export everything, from every tenant, and verify the exports.
  2. Remove the tenant deployments and wait until every namespace is gone.
  3. Confirm that no PersistentVolumeClaim or PersistentVolume from the deployment remains bound or released.
  4. Remove the shared runtime pool, if the deployment has one.
  5. Clean up Vault and Keycloak per tenant as above.
  6. Ask your cluster operator to remove the cluster-scoped objects OLIVE's example policies created, if Kyverno is not used for anything else.
  7. Remove DNS records and any certificates issued for the tenant subdomains.
# Nothing from the deployment should remain
kubectl get ns
kubectl get pvc -A
kubectl get pv

The cluster-scoped leftovers — the policy objects, the ClusterIssuer, the mesh configuration — are your cluster operator's to list and remove.

Argo CD does not delete what it never owned

Resources created by a Job rather than rendered by a chart — and anything applied by hand during troubleshooting — are invisible to pruning. If a namespace will not finish deleting, that is usually where to look.


Removing the infrastructure components​

Vault, Keycloak, Istio and Kyverno are not part of the OLIVE platform. They are shared cluster infrastructure, and other workloads may depend on them.

Before removing any of them, establish that nothing else uses them — and note that removing Vault destroys every secret it holds, for every consumer, including any that are not recoverable from elsewhere. Unsealing keys and recovery material are a separate matter again; follow HashiCorp's guidance rather than treating a Vault teardown as a Helm uninstall.

See Infrastructure Prerequisites for what OLIVE requires from each of them, and Cluster Operator → Infrastructure Charts for the charts themselves.