Follow
# Dynamically create and use a persistent volume with Azure Files in Azure Kubernetes Service (AKS)
to create a new storage class in AKS:
1
2
3
4
5
6
7
8
9
10
11
12
| kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: standard-grs
provisioner: kubernetes.io/azure-disk
parameters:
cachingmode: ReadOnly
kind: Managed
skuName: Standard_GRS
reclaimPolicy: Delete
allowVolumeExpansion: true
volumeBindingMode: Immediate
|
If you create new resource by kubernetes dashboard, an error might occur:
1
2
| Deploying file has failed
the server could not find the requested resource
|
Two solutions:
- Using
kubectl apply -f command - Change kubernetes dashboard namespace to
All namespaces, then create again
Another error might happen when claming PVC:
1
| error while running "VolumeBinding" prebind plugin for pod "xxx": Failed to bind volumes: provisioning failed for PVC "xxx"
|
The error message can be found via kubectl describe pvc:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| $ kubectl.exe describe pvc xxx
Name: xxx
Namespace: xxx
StorageClass: standard-grs
Status: Pending
Volume:
Labels: app=xxx
Annotations: volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/azure-disk
Finalizers: [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode: Filesystem
Used By: xxx
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning ProvisioningFailed 13s (x9 over 3m40s) persistentvolume-controller Failed to provision volume with StorageClass "standard-grs": azureDisk - Standard_GRS is not supported sku/storageaccounttype. Supported values are [Premium_LRS Standard_LRS StandardSSD_LRS UltraSSD_LRS]
|
Specifically, the error above cannot be resolved inside this cluster. One alternative would be create another cluster which supports sku Standard_GRS.