Longhorn - Kubernetes persistent volume storage

Longhorn - Kubernetes persistent volume storage

Deploy

You can deploy Longhorn persistent volume storage via kubectl apply -f https://raw.githubusercontent.com/rancher/longhorn/v0.3-rc/deploy/longhorn.yaml

Destroy

Destroying is not that easy. If you run kubectl delete -f https://raw.githubusercontent.com/rancher/longhorn/v0.3-rc/deploy/longhorn.yaml command, you will stuck on infinite removing ĺonghorn-system namespace.

Solution

Run kubectl get customresourcedefinition --all-namespaces | grep long after kubectl delete command above.

You shoud get this list:

  • engineimages.longhorn.rancher.io
  • engines.longhorn.rancher.io
  • nodes.longhorn.rancher.io
  • replicas.longhorn.rancher.io
  • settings.longhorn.rancher.io
  • volumes.longhorn.rancher.io

Now you have to run kubectl --kubeconfig kube_config_cluster.yml edit customresourcedefinition engineimages.longhorn.rancher.io for every item in your list and remove finalizers key in metadata structure. Save it, close opened editor. Kubectl will apply your changes and edited resource will disappear.

Now check again kubectl --kubeconfig kube_config_cluster.yml get customresourcedefinition --all-namespaces | grep long and you should not see anything. Now longhorn-system will disappear.!

Some screenshots from my playground

longhorn-ui
longhorn-ui2