Vault/Consul Cleanup

After completing the plugins upgrade or if you have recently migrated/installed OpenBao, and validating the functionality, it is necessary to clean up (delete) all traces of the Vault/Consul setup. Follow the steps outlined below:
Warning: Do not perform these steps if the migration from Vault to OpenBao has not been completed
  1. Remove the vault/consul and related pods using the commands below.
    helm uninstall vault -n avx
    helm uninstall consul -n avx
    kubectl delete pods vault-0 vault-1 vault-2 -n avx --force
    kubectl delete pods consul-consul-server-0 consul-consul-server-1 consul-consul-server-2 -n avx --force
  2. Delete the specified Kubernetes services (service objects) in the cluster by executing the command below.
    kubectl delete secret vault-key-0 vault-key-1 vault-key-2 -n avx --force
  3. Delete the vault/consul related PVCs by executing the commands below.
    kubectl patch pvc data-avx-consul-consul-server-0 -n avx -p '{"metadata":{"finalizers":null}}'
    kubectl patch pvc data-avx-consul-consul-server-1 -n avx -p '{"metadata":{"finalizers":null}}'
    kubectl patch pvc data-avx-consul-consul-server-2 -n avx -p '{"metadata":{"finalizers":null}}'
    kubectl delete pvc data-avx-consul-consul-server-0 data-avx-consul-consul-server-1 data-avx-consul-consul-server-2 -n avx --force
  4. Delete the configmap using the commands below.
    kubectl delete cm avx-vault-configmap -n avx