Azure k8s 中的 Pod 出现错误(不支持卷功能)

Ole*_*leg 3 kubernetes persistent-volumes persistent-volume-claims

我在 azure k8s 集群(4Gb 标准 HDD)中创建了磁盘,我正在使用代码 PV

光伏文件

然后我正在创建 PVC:

PVC纱

将我的卷附加到 Pod:

Pod 卷附件

但是当我检查 Pod 的状态时,出现错误:

root@k8s:/home/azureuser/k8s# kubectl get describe pods mypod
error: the server doesn't have a resource type "describe"
root@k8s:/home/azureuser/k8s# kubectl describe pods mypod
Name:         mypod
Namespace:    default
Priority:     0
Node:         aks-agentpool-37412589-vmss000000/10.224.0.4
Start Time:   Wed, 03 Aug 2022 10:34:45 +0000
Labels:       <none>
Annotations:  <none>
Status:       Pending
IP:           
IPs:          <none>
Containers:
  mypod:
    Container ID:   
    Image:          mcr.microsoft.com/oss/nginx/nginx:1.15.5-alpine
    Image ID:       
    Port:           <none>
    Host Port:      <none>
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Limits:
      cpu:     250m
      memory:  256Mi
    Requests:
      cpu:        100m
      memory:     128Mi
    Environment:  <none>
    Mounts:
      /mnt/azure from azure (rw)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-nq9q2 (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  azure:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  pvc-azuredisk
    ReadOnly:   false
  kube-api-access-nq9q2:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   Burstable
Node-Selectors:              kubernetes.io/os=linux
Tolerations:                 node.kubernetes.io/memory-pressure:NoSchedule op=Exists
                             node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type     Reason              Age                 From                     Message
  ----     ------              ----                ----                     -------
  Normal   Scheduled           2m2s                default-scheduler        Successfully assigned default/mypod to aks-agentpool-36264904-vmss000000
  Warning  FailedAttachVolume  53s (x8 over 2m1s)  attachdetach-controller  AttachVolume.Attach failed for volume "pv-azuredisk" : rpc error: code = InvalidArgument desc = Volume capability not supported
Run Code Online (Sandbox Code Playgroud)

请您帮忙提供建议,我该如何解决这个问题: Warning FailedAttachVolume 53s (x8 over 2m1s) attachdetach-controller AttachVolume.Attach failed for volume "pv-azuredisk" : rpc error: code = InvalidArgument desc = Volume capability not supported

goh*_*m'c 9

...不支持批量功能

尝试更新您的 PV:

...
accessModes:
  - ReadWriteOnce  # <-- ReadWriteMany is not supported by disk.csi.azure.com
...
Run Code Online (Sandbox Code Playgroud)

file.csi.azure.com(Azure 文件)支持 ReadWriteMany。