@Ankit Rathod , if you want to mount Azure File Share with AKS POD, you don't need to create PV.
- Create Azure File Share
- Create the Secret for underlyimng storage account
kubectl create secret generic test-secret --namespace my-dev --from-literal=azurestorageaccountname=[name of storage account] --from-literal=azurestorageaccountkey=[storage account key]
- Then define POD YAML like below,
apiVersion: apps/v1
kind: Deployment
metadata:
name: test-pod
namespace: my-dev
spec:
selector:
matchLabels:
app: test-pod
template:
metadata:
labels:
app: test-pod
spec:
containers:
- image: test-image
name: test-pod
volumeMounts:
- name: file-share
mountPath: /app/files
volumes:
- name: file-share
azureFile:
secretName: test-secret
shareName: share-name
readOnly: true
Please make sure secret name and file share name should be same. Do let me know this this works for you.