From 733526a0125d9be1f13ff8bae36e1d3168efe6db Mon Sep 17 00:00:00 2001 From: David Yu Date: Tue, 11 Jan 2022 12:53:39 -0800 Subject: [PATCH] docs: Update uninstall to ensure CRDs are deleted (#12021) * docs: Update uninstall to ensure CRDs are deleted * Update website/content/docs/k8s/operations/uninstall.mdx Co-authored-by: Blake Covarrubias * add more details around CRD deletion * move around crd deletion to before unsintall * slight wording * move deletion of CRDs to first line Co-authored-by: Blake Covarrubias --- website/content/docs/k8s/operations/uninstall.mdx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/website/content/docs/k8s/operations/uninstall.mdx b/website/content/docs/k8s/operations/uninstall.mdx index 2d2ebddf4..b37cabaf3 100644 --- a/website/content/docs/k8s/operations/uninstall.mdx +++ b/website/content/docs/k8s/operations/uninstall.mdx @@ -29,12 +29,18 @@ Refer to the [Consul K8s CLI reference](/docs/k8s/k8s-cli#uninstall) topic for d Run the `helm uninstall` **and** manually remove resources that Helm does not delete. +1. Although the Helm chart automates the deletion of CRDs upon the uninstallation of the Helm chart, sometimes the finalizers tied to those CRDs may not complete because the deletion of the CRDs rely on the Consul K8s controller running. Ensure that previously created CRDs for Consul on Kubernetes are deleted, so subsequent installs of Consul on Kubernetes on the same Kubernetes cluster do not get blocked. + + ```shell-session + $ kubectl delete crd --selector app=consul + ``` 1. (Optional) If Consul is installed in a dedicated namespace, set the kubeConfig context to the `consul` namespace. Otherwise, subsequent commands will need to include `-n consul`. ``` kubectl config set-context --current --namespace=consul ``` + 1. Run the `helm uninstall ` command and specify the release name you've installed Consul with, e.g.,: @@ -42,6 +48,7 @@ Run the `helm uninstall` **and** manually remove resources that Helm does not de $ helm uninstall consul release "consul" uninstalled ``` + 1. After deleting the Helm release, you need to delete the `PersistentVolumeClaim`'s for the persistent volumes that store Consul's data. A [bug](https://github.com/helm/helm/issues/5156) in Helm prevents PVCs from being deleted. Issue the following commands: @@ -102,3 +109,9 @@ Run the `helm uninstall` **and** manually remove resources that Helm does not de $ kubectl delete serviceaccount consul-tls-init serviceaccount "consul-tls-init" deleted ``` + +1. (Optional) Delete the namespace (i.e. `consul` in the following example) that you have dedicated for installing Consul on Kubernetes. + + ```shell-session + $ kubectl delete ns consul + ```