Reputation: 181
I created disk in azure k8s cluster (4Gb standard HDD) I am using code PV
Then I am creating PVC:
Attach my volume to Pod:
But when I checked the status of my Pod, I got an error:
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
Could you please help with advice, how I can solve this issue: Warning FailedAttachVolume 53s (x8 over 2m1s) attachdetach-controller AttachVolume.Attach failed for volume "pv-azuredisk" : rpc error: code = InvalidArgument desc = Volume capability not supported
Upvotes: 4
Views: 5948
Reputation: 15568
...Volume capability not supported
Try update your PV:
...
accessModes:
- ReadWriteOnce # <-- ReadWriteMany is not supported by disk.csi.azure.com
...
ReadWriteMany is supported by file.csi.azure.com (Azure Files).
Upvotes: 10