Prerequisite :
Before deploy longhorn to kubernetes, must ensure that open-iscsi & nfsv4 client has been installed on each worker node
To install longhorn on kubernetes, follow these steps:
-
Change this parameter and adjust to your nodes count on longhorn/deploy.yaml file:
parameters: numberOfReplicas: "2"
-
Deploy longhorn with kubectl:
kubectl apply -f longhorn/deploy.yaml
-
Create a persistent volume claim for the application:
kubectl apply -f test-app/pvc.yaml
Note : Make sure the storageClassName to longhorn
-
Deploy the basic nginx application:
kubectl apply -f test-app/deploy.yaml