Warning FailedAttachVolume 49s (x15 over 15m) attachdetach-controller AttachVolume.Attach failed for volume "test" : rpc error: code = InvalidArgument desc = Volume capability not supported.
directly I am creating azure disk in resource group level. when pods are running with replicas. the existing disk is not using . i am getting error (Volume capability not supported).
if i place ReadWriteOnce only pod is getting attached to disk and its running another pod in another node is pending state.
can we mount the disk for multi nodes.
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: manual
provisioner: disk.csi.azure.com
parameters:
skuname: StandardSSD_LRS
kind: managed
maxShares: "3"
cachingMode: None
reclaimPolicy: Delete
volumeBindingMode: Immediate
allowVolumeExpansion: true
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: test
spec:
capacity:
storage: 256Gi
volumeMode: Block
accessModes:
- ReadWriteMany
persistentVolumeReclaimPolicy: Retain
storageClassName: manual
azureDisk:
kind: Managed
diskURI: /subscriptions/b3446H73N3933/resourceGroups/PPFD-RG-STG/providers/Microsoft.Compute/disks/test
diskName: test
cachingMode: None
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 2
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
nodeSelector:
app: test
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
volumeDevices:
- name: test
devicePath: /data
volumes:
- name: test
persistentVolumeClaim:
claimName: pod-claim
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pod-claim
spec:
resources:
requests:
storage: 256Gi
volumeMode: Block
storageClassName: "manual"
volumeName: test
accessModes:
- ReadWriteMany