Difference between revisions of "Longhorn by Rancher"

From UVOO Tech Wiki
Jump to navigation Jump to search
 
Line 82: Line 82:
 
```
 
```
 
https://longhorn.io/docs/1.1.1/deploy/upgrade/longhorn-manager/
 
https://longhorn.io/docs/1.1.1/deploy/upgrade/longhorn-manager/
 +
```
 +
 +
Uninstall https://longhorn.io/docs/1.1.1/deploy/uninstall/
 +
```
 +
 
```
 
```

Latest revision as of 15:05, 16 July 2021

https://rancher.com/docs/k3s/latest/en/storage/

Install on Microk8s Using Helm3

sudo snap install helm
helm repo add longhorn https://charts.longhorn.io
helm repo update
kubectl create namespace longhorn-system
helm install longhorn longhorn/longhorn --namespace longhorn-system --set csi.kubeletRootDir=/var/snap/microk8s/common/var/lib/kubelet
kubectl get pods -n longhorn-system

via github source

git clone https://github.com/longhorn/longhorn && cd longhorn
kubectl create namespace longhorn-system
helm install longhorn ./longhorn/chart/ --namespace longhorn-system

View replicas on each node

ls /var/lib/longhorn/replicas/

https://longhorn.io/docs/0.8.0/users-guide/settings/

Default Replica Count
Example: 3
Description: The default number of replicas when creating the volume from Longhorn UI. For Kubernetes, update the numberOfReplicas in the StorageClass
Note: The recommended way of choosing the default replica count is: if you have more than three nodes for storage, use 3; otherwise use 2. Using a single replica on a single node cluster is also OK, but the HA functionality wouldn’t be available. You can still take snapshots/backups of the volume.

More Docs

https://longhorn.io/docs/1.0.0/concepts/

https://longhorn.io/docs/1.0.0/deploy/install/install-with-helm/

https://youtu.be/Ho4zEF8pzvE

https://youtu.be/zJY2uxLtwUk

https://medium.com/volterra-io/kubernetes-storage-performance-comparison-v2-2020-updated-1c0b69f0dcf4

https://longhorn.io/docs/1.1.1/references/longhorn-client-python/

Troubleshooting

1

kubectl get pods -n longhorn-system | grep longhorn-driver-deployer
longhorn-driver-deployer-5d45dcdc5d-w48c4   0/1     CrashLoopBackOff   6          10m
# This will be Error or CrashLoopBackOff

https://github.com/longhorn/longhorn/issues/1861

kubectl create namespace longhorn-system
# mkdir /var/lib/kubelet/plugins_registry
# helm install longhorn longhorn/longhorn --namespace longhorn-system --set csi.kubeletRootDir=/var/lib/kubelet  # https://github.com/longhorn/longhorn/issues/1861
helm install longhorn longhorn/longhorn --namespace longhorn-system --set csi.kubeletRootDir=/var/snap/microk8s/common/var/lib/kubelet
curl https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/longhorn.yaml | sed -e 's/#- name: KUBELET_ROOT_DIR/- name: KUBELET_ROOT_DIR/g' -e 's$#  value: /var/lib/rancher/k3s/agent/kubelet$  value: /var/lib/kubelet$g' | kubectl apply -f -

longhorn-csi-plugin-bkmnz                   0/2     ContainerCreating   0          3m14s
# no work ## helm install longhorn longhorn/longhorn --namespace longhorn-system --set kubelet-root-dir=/var/lib/kubelet

Upgrade

https://longhorn.io/docs/1.1.1/deploy/upgrade/longhorn-manager/

Uninstall https://longhorn.io/docs/1.1.1/deploy/uninstall/

<br />