Skip to content

docs: add Layered Zero Trust uninstall procedure and script - #197

Open
p-rog wants to merge 2 commits into
validatedpatterns:mainfrom
p-rog:add-ztvp-uninstall-procedure
Open

p-rog wants to merge 2 commits into
validatedpatterns:mainfrom
p-rog:add-ztvp-uninstall-procedure

Conversation

@p-rog

@p-rog p-rog commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a public uninstall procedure covering pre-install baselines, current-inventory best-effort cleanup, safeguards for shared resources, and post-uninstall auditing.
  • Add the Python automation under scripts/ and link the guide from the documentation index and main README.
  • Keep cluster-specific findings and internal tracking details out of the public guide.

Validation

  • Checked all changed Markdown relative links.
  • Scanned the public files for internal cluster identifiers and test findings; no matches were found.
  • git diff --check passed.
  • No live cluster operations or runtime tests were run for this documentation update.

@mlorenzofr

Copy link
Copy Markdown
Collaborator

I ran scripts/ztvp_uninstall.py end-to-end on a test cluster where the pattern was deployed with Use Case 2 (secure supply chain) enabled. That means supply-chain, RHTAS, RHTPA, OpenShift Pipelines, Quay, and NooBaa MCG were installed in addition to the base Layer 0 and Layer 1 components.

There was no pre-install baseline, so I used the documented inventory plus uninstall --best-effort path. The Pattern was patterns-operator/layered-zero-trust with 21 Argo Applications, 284 tracked resources, and 492 CRDs at inventory time.

The plan and inventory checks were clean, and the script correctly protected the pre-existing Proxy/cluster with Delete=false. Execution then stalled on several operator-side finalizer defects, none of which the script currently detects or automates around:

Blocker Cause Resolution
acs-policies stuck Progressing ACS config-controller returned policy "" is not externally managed and can be deleted only from central Cleared the SecurityPolicy finalizer on the two deleting policies after checking UID and ZTVP tracking annotation
supply-chain stuck on PVC Eight completed Tekton pods still referenced qtodo-workspace-source, so pvc-protection held the PVC Deleted only those completed pods
trusted-artifact-signer RHTAS operator tried to add tas.rhtas.redhat.com to an already-deleting Securesign, which the API server forbids It completed after the operator stopped retrying
noobaa-mcg denied NooBaa admission webhook blocked deletion until spec.cleanupPolicy.allowNoobaaDeletion was true Set the field, then deleted the NooBaa CR
zero-trust-workload-identity-manager ZTWIM operator kept recreating the OIDC provider during foregroundDeletion Removed foregroundDeletion from the two ZTVP-tracked CRs
openshift-compliance namespace Two ProfileBundle finalizers remained after the Compliance Operator was removed Cleared the ocp4 and rhcos4 finalizers
acm search-postgres and the SPIRE pod were wedged in kubelet termination Force-deleted those two already-stopping pods
Root Application Argo reported NotFound for already-deleted subscriptions It recovered once the last namespaces finished

The uninstall process exited 3 because the Pattern CR disappeared before the root Application finished cascading. After the tree was gone I ran finalize, which released the temporary Delete=false protection and wrote the report. The Pattern CR and all 21 Applications are gone, but the final report still lists four pattern-tracked resources present.

Residue that remains:

  1. Cluster trust still points at ZTVP. Proxy/cluster.spec.trustedCA is ztvp-proxy-ca and Image/cluster.spec.additionalTrustedCA is ztvp-registry-cas. Both ConfigMaps still exist in openshift-config. Without a pre-install baseline the script correctly declined to restore the original values, so this needs administrator review.
  2. CertManager/cluster is orphaned. The cert-manager operator CSV and namespace are gone, but the CR remains with three stuck deployment finalizers and degraded conditions.
  3. ServiceAccount/vp-gitops/pipeline remains, still carrying argocd.argoproj.io/tracking-id: supply-chain:/ServiceAccount:vp-gitops/pipeline. The Argo cascade did not delete it.
  4. Pipelines, Quay, ACS, and RHTAS operators are still installed. Their subscriptions were removed, but OLM retained the CSVs (73 copied instances each), CRDs, and running operator deployments in openshift-operators. The openshift-pipelines namespace remains with its workloads, and TektonConfig/config still has Delete=false. This is expected OLM retention, but the stack is not fully removed.
  5. 479 CRDs remain versus 492 at inventory, so nearly all operator APIs are still present.

The script behaved as documented for ambiguous ownership: it refused to claim zero residue and returned a nonzero code. The main gap this run exposed is that known operator stalls (ACS, RHTAS, ZTWIM, NooBaa, Compliance) have no automated detection or guided recovery, so an operator has to diagnose each one manually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants