Uninstall Longhorn

  1. To prevent damage to the Kubernetes cluster, we recommend deleting all Kubernetes workloads using Longhorn volumes (PersistentVolume, PersistentVolumeClaim, StorageClass, Deployment, StatefulSet, DaemonSet, etc).

  2. Create the uninstallation job to cleanly purge CRDs from the system and wait for success:

  1. kubectl --kubeconfig=kube_configxxx.yml create -f https://raw.githubusercontent.com/rancher/longhorn/master/uninstall/uninstall.yml
  2. kubectl --kubeconfig=kube_configxxx.yml -n longhorn-system get job/longhorn-uninstall -w

Example output:

  1. $ kubectl --kubeconfig=kube_configxxx.yml create -f https://raw.githubusercontent.com/rancher/longhorn/master/uninstall/uninstall.yml
  2. job.batch/longhorn-uninstall created
  3. $ kubectl --kubeconfig=kube_configxxx.yml -n longhorn-system get job/longhorn-uninstall -w
  4. NAME DESIRED SUCCESSFUL AGE
  5. longhorn-uninstall 1 0 3s
  6. longhorn-uninstall 1 1 45s
  7. ^C
  1. Remove remaining components:
  1. kubectl --kubeconfig=kube_configxxx.yml delete -f https://raw.githubusercontent.com/rancher/longhorn/master/deploy/longhorn.yml