Creating Azure File Share (private endpoint) Mount Point on AKS pods

Ankit Rathod 371 Reputation points
2021-08-23T08:27:46.103+00:00

Hi team.,

I have created Private AKS cluster and want to add a mount point as PV - Azure File Share(with private endpoint) to pods in the AKS.

I'm seeing the error as

125546-pv-storage-privateendpoint.png

Document(https://learn.microsoft.com/en-us/azure/aks/azure-files-dynamic-pv) does not help much with private endpoint option.

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,754 questions
Azure Private Link
Azure Private Link
An Azure service that provides private connectivity from a virtual network to Azure platform as a service, customer-owned, or Microsoft partner services.
472 questions
Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,893 questions
0 comments No comments
{count} votes

Accepted answer
  1. @IamCoder 391 Reputation points
    2021-08-23T13:53:11.707+00:00

    @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.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Ankit Rathod 371 Reputation points
    2021-08-23T15:01:56.19+00:00

    @@IamCoder ,

    Thanks for the response,

    I want to also mount the single file share on multiple pods, also my Storage account is accessed using private link and aks is also private cluster, so in this scenario will the above solution work ?