Uninstall Consul
You can uninstall Consul using Helm commands or the Consul K8s CLI.
Helm commands
Run the helm uninstall
and manually remove resources that Helm does not delete.
(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
.Run the
helm uninstall <release-name>
command and specify the release name you've installed Consul with, e.g.,:After deleting the Helm release, you need to delete the
PersistentVolumeClaim
's for the persistent volumes that store Consul's data. A bug in Helm prevents PVCs from being deleted. Issue the following commands:NOTE: This will delete all data stored in Consul and it can't be recovered unless you've taken other backups.
If installing with ACLs enabled, you will need to then delete the ACL secrets:
Ensure that the secrets you're about to delete are all created by Consul and not created by another user with the word
consul
.If installing with
tls.enabled
then, run the following commands to delete theServiceAccount
left behind:
Consul K8s CLI
Issue the consul-k8s uninstall
command to remove Consul on Kubernetes. You can specify the installation name, namespace, and data retention behavior using the applicable options. By default, the uninstallation preserves the secrets and PVCs that are provisioned by Consul on Kubernetes.
In the following example, Consul will be uninstalled and the data removed without prompting you to verify the operations:
Refer to the Consul K8s CLI reference topic for details.