Hello Kirrane, Desmond (Dessie)
If it is an AKS-managed StorageClass, it is not recommended to change it.
To identify an AKS-managed StorageClass, you can generate its yaml (kubectl get sc <sc-name> -o yaml) and look for label "addonmanager.kubernetes.io/mode"
To modify your existing StorageClass to use ZRS, you can use the below:
parameters:
skuName: Standard_ZRS
You can also create a new StorageClass with ZRS.
You can refer to the below example and adapt it as needed:
allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: azurefile-csi-zrs
mountOptions:
- mfsymlinks
- actimeo=30
- nosharesock
parameters:
skuName: Standard_ZRS
provisioner: file.csi.azure.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
creationTimestamp: "2023-03-07T08:28:21Z"
labels:
addonmanager.kubernetes.io/mode: EnsureExists
name: azurefile-csi
resourceVersion: "361"
uid: d37b01e9-c284-405a-8539-1fab044571a6
mountOptions:
- mfsymlinks
- actimeo=30
- nosharesock
parameters:
skuName: Standard_LRS
provisioner: file.csi.azure.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: azurefile-csi-zrs
mountOptions:
- mfsymlinks
- actimeo=30
- nosharesock
parameters:
skuName: Standard_ZRS
provisioner: file.csi.azure.com
reclaimPolicy: Delete
volumeBindingMode: Immediate
Note there is also the Premium_ZRS option
To migrate, you may want to use the snapshot feature. Reference links for Azure Disk and Azure File:
https://learn.microsoft.com/en-us/azure/aks/azure-files-csi#create-a-custom-storage-class
https://learn.microsoft.com/en-us/azure/aks/azure-disk-csi#volume-snapshots
Please make sure to test on some test resources as I personally didn't implement this scenario, but it is possible to be achievable using volume snapshots.
I hope this is helpful. If any clarification needed, let me know and I will do my best to answer.
Please "Accept as Answer" and Upvote if it helped, so that it can help others in the community looking for help on similar topics.
Thank you!