Skip to content

Latest commit

 

History

History
105 lines (67 loc) · 2.25 KB

InstallLonghorn.md

File metadata and controls

105 lines (67 loc) · 2.25 KB

Installing Longhorn

At the end of the Lab you will have:

  • Longhorn installed and setup as the Default StorageClass for your Cluster

Prerequisites:

  • Rancher up and running
  • Target Cluster that you want to install Longhorn into
    • Longhorn uses /var/lib/longhorn on the nodes of the Cluster to store data

Installation of Longhorn

1) From a browser, go to your Rancher Cluster Explorer and make sure you have the Target Cluster selected

2) Select Apps & Marketplace from the dropdown menu

3) From the Charts Menu, select Longhorn

4) OPTIONAL - If you want to change the default path used by Longhorn click 'Customize Default Settings'

4) Click install and you are Done!

Accessing Longhorn Console

Once Longhorn is installed, you can access the console by simply Selecting it in the Upper Left hand Menu and Click on the Longhorn Icon to launch the console

1) Select Longhorn UI

Notice in the console we don't have any Volumes yet

Testing Longhorn

1) Create a test-pvc.yml

# test-pvc.yml 
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: test-pvc
spec:
  storageClassName:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi

1) Create a test-deplyment.yml

# test-deplyment.yml
kind: Pod
apiVersion: v1
metadata:
  name: test-pvc-pod
spec:
  volumes:
  - name: debug-pv
    persistentVolumeClaim:
      claimName: test-pvc
  containers:
  - name: debugger
    image: busybox
    command: ["sleep", "3600"]
    volumeMounts:
    - mountPath: "/data"
      name: debug-pv

2) Deploy the PVC and the Deployment

    kubectl apply -f test-pvc
    kubectl apply -f test-deplyment.yml

3) Look at the Longhorn Dashboard - You now see a volume created