首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么 Longhorn 无法挂载 Volume?

为什么 Longhorn 无法挂载 Volume?

提问于 2026-08-13 18:14:36
回答 0关注 0查看 25

操作系统:Tencent OS 4 Linux 6.6.119-49.22.tl4.x86_64

K3S 版本:v1.33.3+k3s1

Longhorn 版本:v1.12.0 | V1 引擎


Longhorn 按照官方文档 Install with Kubectl 进行安装,安装并启用了 iSCSI 服务。

测试用清单文件:

代码语言:txt
复制
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: longhorn-persistent-volume-claim
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: longhorn
  resources:
    requests:
      storage: 2Gi
---
apiVersion: v1
kind: Pod
metadata:
  name: volume-test
  namespace: default
spec:
  containers:
  - name: volume-test
    image: nginx:stable-alpine
    imagePullPolicy: IfNotPresent
    volumeMounts:
    - name: volv
      mountPath: /data
    ports:
    - containerPort: 80
  volumes:
  - name: volv
    persistentVolumeClaim:
      claimName: longhorn-persistent-volume-claim

应用此清单之后,CSI ATTACHER 报错:

代码语言:txt
复制
I0813 09:49:02.517497       1 main.go:114] "Version" version="v4.12.0"
I0813 09:49:02.517699       1 envvar.go:195] "Feature gate default state" feature="AtomicFIFO" enabled=true
I0813 09:49:02.517719       1 envvar.go:195] "Feature gate default state" feature="ClientsAllowCARotation" enabled=true
I0813 09:49:02.517727       1 envvar.go:195] "Feature gate default state" feature="WatchListClient" enabled=true
I0813 09:49:02.517735       1 envvar.go:195] "Feature gate default state" feature="InOrderInformers" enabled=true
I0813 09:49:02.517742       1 envvar.go:195] "Feature gate default state" feature="InformerResourceVersion" enabled=true
I0813 09:49:02.517749       1 envvar.go:195] "Feature gate default state" feature="ClientsAllowCBOR" enabled=false
I0813 09:49:02.517756       1 envvar.go:195] "Feature gate default state" feature="ClientsPreferCBOR" enabled=false
I0813 09:49:02.517763       1 envvar.go:195] "Feature gate default state" feature="InOrderInformersBatchProcess" enabled=true
I0813 09:49:02.517770       1 envvar.go:195] "Feature gate default state" feature="ClientsAllowTLSCacheGC" enabled=true
I0813 09:49:02.517791       1 envvar.go:195] "Feature gate default state" feature="UnlockWhileProcessingFIFO" enabled=true
I0813 09:49:02.521099       1 common.go:143] "Probing CSI driver for readiness"
I0813 09:49:02.524015       1 main.go:173] "CSI driver name" driver="driver.longhorn.io"
I0813 09:49:02.525682       1 main.go:203] "ServeMux listening" driver="driver.longhorn.io" address=":8000" metricsPath="/metrics"
I0813 09:49:02.528133       1 main.go:257] "CSI driver supports ControllerPublishUnpublish, using real CSI handler" driver="driver.longhorn.io"
I0813 09:49:02.528669       1 leaderelection.go:258] "Attempting to acquire leader lease..." lock="longhorn-system/external-attacher-leader-driver-longhorn-io"
I0813 09:49:02.543471       1 leaderelection.go:272] "Successfully acquired lease" lock="longhorn-system/external-attacher-leader-driver-longhorn-io"
I0813 09:49:02.543662       1 leader_election.go:202] "became leader, starting"
I0813 09:49:02.543686       1 controller.go:132] "Starting CSI attacher"
I0813 09:49:02.580204       1 reflector.go:507] "Caches populated" type="*v1.PersistentVolume" reflector="k8s.io/client-go/informers/factory.go:177"
I0813 09:49:02.580984       1 reflector.go:507] "Caches populated" type="*v1.VolumeAttachment" reflector="k8s.io/client-go/informers/factory.go:177"
I0813 09:49:02.581775       1 reflector.go:507] "Caches populated" type="*v1.CSINode" reflector="k8s.io/client-go/informers/factory.go:177"
I0813 09:53:01.957413       1 csi_handler.go:264] "Attaching" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 09:54:32.385324       1 csi_handler.go:246] "Error processing" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0" err="failed to attach: rpc error: code = DeadlineExceeded desc = volume pvc-552b6a85-51f6-4574-9ca0-6538e7923766 failed to attach to node tklt with attachmentID csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 09:54:32.385506       1 csi_handler.go:264] "Attaching" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 09:56:02.412680       1 csi_handler.go:246] "Error processing" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0" err="failed to attach: rpc error: code = DeadlineExceeded desc = volume pvc-552b6a85-51f6-4574-9ca0-6538e7923766 failed to attach to node tklt with attachmentID csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 09:56:02.412756       1 csi_handler.go:264] "Attaching" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 09:56:02.420916       1 csi_handler.go:246] "Error processing" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0" err="failed to attach: rpc error: code = Aborted desc = volume pvc-552b6a85-51f6-4574-9ca0-6538e7923766 is not ready for workloads"
I0813 09:56:04.413405       1 csi_handler.go:264] "Attaching" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 09:57:34.442368       1 csi_handler.go:246] "Error processing" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0" err="failed to attach: rpc error: code = DeadlineExceeded desc = volume pvc-552b6a85-51f6-4574-9ca0-6538e7923766 failed to attach to node tklt with attachmentID csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 09:57:42.443427       1 csi_handler.go:264] "Attaching" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 09:59:13.601771       1 csi_handler.go:246] "Error processing" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0" err="failed to attach: rpc error: code = DeadlineExceeded desc = volume pvc-552b6a85-51f6-4574-9ca0-6538e7923766 failed to attach to node tklt with attachmentID csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 09:59:13.601880       1 csi_handler.go:264] "Attaching" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 10:00:43.631366       1 csi_handler.go:246] "Error processing" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0" err="failed to attach: rpc error: code = DeadlineExceeded desc = volume pvc-552b6a85-51f6-4574-9ca0-6538e7923766 failed to attach to node tklt with attachmentID csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 10:00:43.631468       1 csi_handler.go:264] "Attaching" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 10:02:13.660439       1 csi_handler.go:246] "Error processing" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0" err="failed to attach: rpc error: code = DeadlineExceeded desc = volume pvc-552b6a85-51f6-4574-9ca0-6538e7923766 failed to attach to node tklt with attachmentID csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 10:02:13.660601       1 csi_handler.go:264] "Attaching" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 10:03:43.688970       1 csi_handler.go:246] "Error processing" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0" err="failed to attach: rpc error: code = DeadlineExceeded desc = volume pvc-552b6a85-51f6-4574-9ca0-6538e7923766 failed to attach to node tklt with attachmentID csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 10:03:43.689130       1 csi_handler.go:264] "Attaching" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 10:05:13.722610       1 csi_handler.go:246] "Error processing" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0" err="failed to attach: rpc error: code = DeadlineExceeded desc = volume pvc-552b6a85-51f6-4574-9ca0-6538e7923766 failed to attach to node tklt with attachmentID csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"
I0813 10:05:51.689231       1 csi_handler.go:264] "Attaching" VolumeAttachment="csi-6356292ec4962bed0b87711ac0b912980cdbcef89a3633f403427d36056474b0"请

同样的复现操作,在 Ubuntu Server 26.04 中无法复现,Longhorn 储存类可以正常使用。问一下各路云原生大佬这是什么问题,请赐教!

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档