Uninstall Longhorn
To prevent damage to the Kubernetes cluster, we recommend deleting all Kubernetes workloads using Longhorn volumes (PersistentVolume, PersistentVolumeClaim, StorageClass, Deployment, StatefulSet, DaemonSet, etc).
Create the uninstallation job to cleanly purge CRDs from the system and wait for success:
kubectl --kubeconfig=kube_configxxx.yml create -f https://raw.githubusercontent.com/rancher/longhorn/master/uninstall/uninstall.yml
kubectl --kubeconfig=kube_configxxx.yml -n longhorn-system get job/longhorn-uninstall -w
Example output:
$ kubectl --kubeconfig=kube_configxxx.yml create -f https://raw.githubusercontent.com/rancher/longhorn/master/uninstall/uninstall.yml
job.batch/longhorn-uninstall created
$ kubectl --kubeconfig=kube_configxxx.yml -n longhorn-system get job/longhorn-uninstall -w
NAME DESIRED SUCCESSFUL AGE
longhorn-uninstall 1 0 3s
longhorn-uninstall 1 1 45s
^C
- Remove remaining components:
kubectl --kubeconfig=kube_configxxx.yml delete -f https://raw.githubusercontent.com/rancher/longhorn/master/deploy/longhorn.yml