Provision Azure NetApp Files dual-protocol volumes for Azure Kubernetes Service

After you configure Azure NetApp Files for Azure Kubernetes Service, you can provision Azure NetApp Files volumes for Azure Kubernetes Service.

Azure NetApp Files supports volumes using NFS (NFSv3 or NFSv4.1), SMB, and dual-protocol (NFSv3 and SMB, or NFSv4.1 and SMB).

Before you begin

Provision a dual-protocol volume in Azure Kubernetes Service

This section describes how to expose an Azure NetApp Files dual-protocol volume statically to Kubernetes. Instructions are provided for both SMB and NFS protocols. You can expose the same volume via SMB to Windows worker nodes and via NFS to Linux worker nodes.

Create the persistent volume for NFS

  1. Define variables for later usage. Replace myresourcegroup, myaccountname, mypool1, myvolname with an appropriate value from your dual-protocol volume.

  2. List the details of your volume using az netappfiles volume show command.

    az netappfiles volume show \
        --resource-group $RESOURCE_GROUP \
        --account-name $ANF_ACCOUNT_NAME \
        --pool-name $POOL_NAME \
        --volume-name $VOLUME_NAME -o JSON

    The following output is an example of the above command executed with real values.

      "creationToken": "myfilepath2",
      "mountTargets": [
          "ipAddress": "",
  3. Create a file named pv-nfs.yaml and copy in the following YAML. Make sure the server matches the output IP address from the previous step, and the path matches the output from creationToken above. The capacity must also match the volume size from Step 2.

    apiVersion: v1
    kind: PersistentVolume
      name: pv-nfs
        storage: 100Gi
        - ReadWriteMany
        - vers=3
        path: /myfilepath2
  4. Create the persistent volume using the kubectl apply command:

    kubectl apply -f pv-nfs.yaml
  5. Verify the status of the persistent volume is Available by using the kubectl describe command:

    kubectl describe pv pv-nfs

Create a persistent volume claim for NFS

  1. Create a file named pvc-nfs.yaml and copy in the following YAML. This manifest creates a PVC named pvc-nfs for 100Gi storage and ReadWriteMany access mode, matching the PV you created.

    apiVersion: v1
    kind: PersistentVolumeClaim
      name: pvc-nfs
        - ReadWriteMany
      storageClassName: ""
          storage: 100Gi
  2. Create the persistent volume claim using the kubectl apply command:

    kubectl apply -f pvc-nfs.yaml
  3. Verify the Status of the persistent volume claim is Bound by using the kubectl describe command:

    kubectl describe pvc pvc-nfs

Mount within a pod using NFS

  1. Create a file named nginx-nfs.yaml and copy in the following YAML. This manifest defines a nginx pod that uses the persistent volume claim.

    kind: Pod
    apiVersion: v1
      name: nginx-nfs
      - image:
        name: nginx-nfs
        - "/bin/sh"
        - "-c"
        - while true; do echo $(date) >> /mnt/azure/outfile; sleep 1; done
        - name: disk01
          mountPath: /mnt/azure
      - name: disk01
          claimName: pvc-nfs
  2. Create the pod using the kubectl apply command:

    kubectl apply -f nginx-nfs.yaml
  3. Verify the pod is Running by using the kubectl apply command:

    kubectl describe pod nginx-nfs
  4. Verify your volume has been mounted on the pod by using kubectl exec to connect to the pod, and then use df -h to check if the volume is mounted.

    kubectl exec -it nginx-nfs -- sh
    / # df -h
    Filesystem             Size  Used Avail Use% Mounted on
    ...  100T  384K  100T   1% /mnt/azure

Next steps

Astra Trident supports many features with Azure NetApp Files. For more information, see: