kubernetes - Cannot install Longhorn in Rancher running using Docker - Stack Overflow

I installed Rancher as outlined in their github Quick Start:sudo docker run -d --restart=unless-stoppe

I installed Rancher as outlined in their github Quick Start:

sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 --privileged rancher/rancher

I then went ahead and tried to install Longhorn, however I'm unable to install it and keep getting this error.

helm upgrade --install=true --labels=catalog.cattle.io/cluster-repo-name=rancher-charts --namespace=longhorn-system --timeout=10m0s --values=/home/shell/helm/values-longhorn-crd-105.1.0-up1.7.2.yaml --version=105.1.0+up1.7.2 --wait=true longhorn-crd /home/shell/helm/longhorn-crd-105.1.0-up1.7.2.tgz
Release "longhorn-crd" does not exist. Installing it now.
NAME: longhorn-crd
LAST DEPLOYED: Tue Mar  4 00:18:14 2025
NAMESPACE: longhorn-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
---------------------------------------------------------------------
SUCCESS: helm upgrade --install=true --labels=catalog.cattle.io/cluster-repo-name=rancher-charts --namespace=longhorn-system --timeout=10m0s --values=/home/shell/helm/values-longhorn-crd-105.1.0-up1.7.2.yaml --version=105.1.0+up1.7.2 --wait=true longhorn-crd /home/shell/helm/longhorn-crd-105.1.0-up1.7.2.tgz
---------------------------------------------------------------------
helm upgrade --install=true --labels=catalog.cattle.io/cluster-repo-name=rancher-charts --namespace=longhorn-system --timeout=10m0s --values=/home/shell/helm/values-longhorn-105.1.0-up1.7.2.yaml --version=105.1.0+up1.7.2 --wait=true longhorn /home/shell/helm/longhorn-105.1.0-up1.7.2.tgz
Release "longhorn" does not exist. Installing it now.
Error: context deadline exceeded

I cannot run the longhorn CLI checker that longhorn has either since the instructions does not bind the /boot/config/ to the docker container so I keep getting this error:

> ./longhornctl check preflight
INFO[2025-03-04T00:39:42Z] Initializing preflight checker               
INFO[2025-03-04T00:39:42Z] Cleaning up preflight checker                
INFO[2025-03-04T00:39:42Z] Running preflight checker                    
ERRO[2025-03-04T00:40:09Z] Failed to run preflight checker: failed DaemonSet condition check: pod container is in crash loop. View the logs using "kubectl -n default logs longhorn-preflight-checker-gldg9 -c init-longhornctl"

I have already satisfied all the requirements mentioned in Longhorn prerequisites, please note that it says Rancher already has Mount Propagation enabled by default.

Versions:

Rancher: 2.10.2
Kubernetes: v1.31.1+k3s1

I installed Rancher as outlined in their github Quick Start:

sudo docker run -d --restart=unless-stopped -p 80:80 -p 443:443 --privileged rancher/rancher

I then went ahead and tried to install Longhorn, however I'm unable to install it and keep getting this error.

helm upgrade --install=true --labels=catalog.cattle.io/cluster-repo-name=rancher-charts --namespace=longhorn-system --timeout=10m0s --values=/home/shell/helm/values-longhorn-crd-105.1.0-up1.7.2.yaml --version=105.1.0+up1.7.2 --wait=true longhorn-crd /home/shell/helm/longhorn-crd-105.1.0-up1.7.2.tgz
Release "longhorn-crd" does not exist. Installing it now.
NAME: longhorn-crd
LAST DEPLOYED: Tue Mar  4 00:18:14 2025
NAMESPACE: longhorn-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
---------------------------------------------------------------------
SUCCESS: helm upgrade --install=true --labels=catalog.cattle.io/cluster-repo-name=rancher-charts --namespace=longhorn-system --timeout=10m0s --values=/home/shell/helm/values-longhorn-crd-105.1.0-up1.7.2.yaml --version=105.1.0+up1.7.2 --wait=true longhorn-crd /home/shell/helm/longhorn-crd-105.1.0-up1.7.2.tgz
---------------------------------------------------------------------
helm upgrade --install=true --labels=catalog.cattle.io/cluster-repo-name=rancher-charts --namespace=longhorn-system --timeout=10m0s --values=/home/shell/helm/values-longhorn-105.1.0-up1.7.2.yaml --version=105.1.0+up1.7.2 --wait=true longhorn /home/shell/helm/longhorn-105.1.0-up1.7.2.tgz
Release "longhorn" does not exist. Installing it now.
Error: context deadline exceeded

I cannot run the longhorn CLI checker that longhorn has either since the instructions does not bind the /boot/config/ to the docker container so I keep getting this error:

> ./longhornctl check preflight
INFO[2025-03-04T00:39:42Z] Initializing preflight checker               
INFO[2025-03-04T00:39:42Z] Cleaning up preflight checker                
INFO[2025-03-04T00:39:42Z] Running preflight checker                    
ERRO[2025-03-04T00:40:09Z] Failed to run preflight checker: failed DaemonSet condition check: pod container is in crash loop. View the logs using "kubectl -n default logs longhorn-preflight-checker-gldg9 -c init-longhornctl"

I have already satisfied all the requirements mentioned in Longhorn prerequisites, please note that it says Rancher already has Mount Propagation enabled by default.

Versions:

Rancher: 2.10.2
Kubernetes: v1.31.1+k3s1
Share Improve this question asked Mar 4 at 0:45 rrlamichhanerrlamichhane 1,7052 gold badges22 silver badges39 bronze badges 1
  • check in which namespace you want to install longhorn. – MikiBelavista Commented Mar 4 at 5:55
Add a comment  | 

2 Answers 2

Reset to default 0

Try

helm repo add longhorn https://charts.longhorn.io
helm repo update

then

kubectl create namespace longhorn-system
helm install longhorn longhorn/longhorn --namespace longhorn-system

Verify

kubectl -n longhorn-system get pod

This is kind of embarrassing but apparently I failed to read the documentation properly. The issue was that rancher is for testing/development purposes only in docker container mode. Once I installed a local k3s cluster and added rancher on top of that, I was able to install longhorn easily as specified in the docs.

  1. Install k3s
    • https://docs.k3s.io/quick-start#install-script
  2. Install rancher
    • https://ranchermanager.docs.rancher/getting-started/installation-and-upgrade/install-upgrade-on-a-kubernetes-cluster
  3. Install longhorn (make sure you have met the pre-requisites)
    • https://longhorn.io/docs/1.8.0/deploy/install/install-with-rancher/

Here's the note on docker installation:

  • https://ranchermanager.docs.rancher/getting-started/installation-and-upgrade/other-installation-methods
    • The Docker installation is for development and testing environments only.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745066027a4609260.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信