Install with ArgoCD

Prerequisites

  • Your workstation: Install the Argo CD CLI.
  • Kubernetes cluster:

    • Ensure that each node fulfills the installation requirements.

    • Install Argo CD.

      1. kubectl create namespace argocd
      2. kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/core-install.yaml

      Allow some time for the deployment of Argo CD components in the argocd namespace.

Use this script to check the Longhorn environment for potential issues.

Installing Longhorn

  1. Log in to Argo CD.

    1. argocd login --core
  2. Set the current namespace to argocd.

    1. kubectl config set-context --current --namespace=argocd
  3. Create the Longhorn Application custom resource.

    1. cat > longhorn-application.yaml <<EOF
    2. apiVersion: argoproj.io/v1alpha1
    3. kind: Application
    4. metadata:
    5. name: longhorn
    6. namespace: argocd
    7. spec:
    8. syncPolicy:
    9. syncOptions:
    10. - CreateNamespace=true
    11. project: default
    12. sources:
    13. - chart: longhorn
    14. repoURL: https://charts.longhorn.io/
    15. targetRevision: v1.7.2 # Replace with the Longhorn version you'd like to install or upgrade to
    16. helm:
    17. values: |
    18. preUpgradeChecker:
    19. jobEnabled: false
    20. destination:
    21. server: https://kubernetes.default.svc
    22. namespace: longhorn-system
    23. EOF
    24. kubectl apply -f longhorn-application.yaml
  4. Deploy Longhorn with the configured settings.

    1. argocd app sync longhorn
  5. Verify that Longhorn was installed successfully.

    1. kubectl -n longhorn-system get pod

    Example of a successful Longhorn installation:

    1. NAME READY STATUS RESTARTS AGE
    2. longhorn-ui-b7c844b49-w25g5 1/1 Running 0 2m41s
    3. longhorn-manager-pzgsp 1/1 Running 0 2m41s
    4. longhorn-driver-deployer-6bd59c9f76-lqczw 1/1 Running 0 2m41s
    5. longhorn-csi-plugin-mbwqz 2/2 Running 0 100s
    6. csi-snapshotter-588457fcdf-22bqp 1/1 Running 0 100s
    7. csi-snapshotter-588457fcdf-2wd6g 1/1 Running 0 100s
    8. csi-provisioner-869bdc4b79-mzrwf 1/1 Running 0 101s
    9. csi-provisioner-869bdc4b79-klgfm 1/1 Running 0 101s
    10. csi-resizer-6d8cf5f99f-fd2ck 1/1 Running 0 101s
    11. csi-provisioner-869bdc4b79-j46rx 1/1 Running 0 101s
    12. csi-snapshotter-588457fcdf-bvjdt 1/1 Running 0 100s
    13. csi-resizer-6d8cf5f99f-68cw7 1/1 Running 0 101s
    14. csi-attacher-7bf4b7f996-df8v6 1/1 Running 0 101s
    15. csi-attacher-7bf4b7f996-g9cwc 1/1 Running 0 101s
    16. csi-attacher-7bf4b7f996-8l9sw 1/1 Running 0 101s
    17. csi-resizer-6d8cf5f99f-smdjw 1/1 Running 0 101s
    18. instance-manager-b34d5db1fe1e2d52bcfb308be3166cfc 1/1 Running 0 114s
    19. engine-image-ei-df38d2e5-cv6nc 1/1 Running 0 114s
  6. Create an NGINX Ingress controller with basic authentication to access the Longhorn UI. Authentication to the Longhorn UI is not enabled by default.

  7. Access the Longhorn UI.