无法将 EBS 卷附加到有状态集 pod。错误的文件系统类型、错误的选项、/dev/XXX 上的错误超级块、缺少代码页或帮助程序或其他错误

问题描述 投票:0回答:0

错误:

  Warning  FailedMount             108s                kubelet                  Unable to attach or mount volumes: unmounted volumes=[nexus], unattached volumes=[nexus kube-api-access-4p4gw nexus-pvc]: timed out waiting for the condition
  Warning  FailedMount             76s (x18 over 21m)  kubelet                  MountVolume.MountDevice failed for volume "nexus" : rpc error: code = Internal desc = could not format "/dev/nvme1n1" and mount it at "/var/lib/kubelet/plugins/kubernetes.io/csi/pv/nexus/globalmount": mount failed: exit status 32
Mounting command: mount
Mounting arguments: -t xfs -o nouuid,defaults /dev/nvme1n1 /var/lib/kubelet/plugins/kubernetes.io/csi/pv/nexus/globalmount
Output: mount: /var/lib/kubelet/plugins/kubernetes.io/csi/pv/nexus/globalmount: wrong fs type, bad option, bad superblock on /dev/nvme1n1, missing codepage or helper program, or other error.

我在K8s中的资源: 聚氯乙烯:

$ kubectl describe pvc -n nexus nexus
Name:          nexus
Namespace:     nexus
StorageClass:  io2
Status:        Bound
Volume:        nexus
Labels:        <none>
Annotations:   pv.kubernetes.io/bind-completed: yes
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      10000Gi
Access Modes:  RWO
VolumeMode:    Filesystem
Used By:       nexus-0
Events:        <none>

PV:

kubectl describe pv nexus
Name:            nexus
Labels:          <none>
Annotations:     pv.kubernetes.io/bound-by-controller: yes
Finalizers:      [kubernetes.io/pv-protection external-attacher/ebs-csi-aws-com]
StorageClass:    io2
Status:          Bound
Claim:           nexus/nexus
Reclaim Policy:  Retain
Access Modes:    RWO
VolumeMode:      Filesystem
Capacity:        10000Gi
Node Affinity:   <none>
Message:
Source:
    Type:              CSI (a Container Storage Interface (CSI) volume source)
    Driver:            ebs.csi.aws.com
    FSType:            xfs
    VolumeHandle:      vol-XXXXXXXXXXXXX
    ReadOnly:          false
    VolumeAttributes:  <none>
Events:                <none>

有状态集卷部分:

      volumes:
      - name: nexus
        persistentVolumeClaim:
          claimName: nexus
  volumeClaimTemplates:
  - apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      creationTimestamp: null
      name: nexus-pvc
    spec:
      accessModes:
      - ReadWriteOnce
      resources:
        requests:
          storage: 20Gi
      storageClassName: aws-efs
      volumeMode: Filesystem



        volumeMounts:
        - mountPath: /nexus-data-efs
          name: nexus-pvc
        - mountPath: /nexus-data
          name: nexus

值得一提的是,当我删除 EBS 卷并保留 EFS 时,一切都按预期运行。

还有:

  • 我可以在基本 ec2 实例上附加卷,但我也收到此错误: 文件系统类型错误、选项错误、/dev/nvme1n1 上的超级块错误、缺少代码页或帮助程序或其他错误。 但这个选项:“-o nouuid”解决了这个问题。

  • 我能够将 efs 安装到 statefulset

  • EBS 是手动创建的,格式化为 xfs 类型,因此 ext4 文件系统类型不是问题。 已安装的 EBS 上的文件 -s 显示:“SGI XFS”

  • 我正在使用 ebs csi 驱动程序

  • 我向节点添加了 IAM 角色(EBS CSI 驱动程序角色)

  • EKS 版本 1.21

kubernetes amazon-ec2 storage amazon-eks
© www.soinside.com 2019 - 2024. All rights reserved.