<p>Can someone please let me know what are the steps that needs to be followed to mount an Azure fileshare that has files in it, and will need to mount it on a pod in Kubernetes.</p>

<p>As I see in the <a href="https://learn.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-linux" rel="nofollow noreferrer">documentation</a>, Azure using SMB protocol for access a data:</p>

<blockquote>
  <p>Azure Files can be mounted either via SMB 2.1 and SMB 3.0. For connections coming from clients on-premises or in other Azure regions, Azure Files will reject SMB 2.1 (or SMB 3.0 without encryption). If secure transfer required is enabled for a storage account, Azure Files will only allow connections using SMB 3.0 with encryption.</p>
</blockquote>

<p>Kubernetes do not support SMB directly, but has support of special type of volumes - <code>AzureFile</code>, which will provide a SMB configuration automatically for you.</p>

<p>Next, for mount a storage, you need <a href="https://github.com/kubernetes/examples/blob/master/staging/volumes/azure_file/README.md" rel="nofollow noreferrer">to</a>:</p>

<ol>
<li><p>Install packages to your nodes: <code>yum -y install cifs-utils</code>. If you using Debian-like distribs like Ubuntu, check how to install that packages in your OS (probably, they have same names).</p></li>
<li><p>No, you need to:</p>

<blockquote>
  <p>Obtain an Microsoft Azure storage account and create a secret that contains the base64 encoded Azure Storage account name and key. In the secret file, base64-encode Azure Storage account name and pair it with name azurestorageaccountname, and base64-encode Azure Storage access key and pair it with name azurestorageaccountkey.</p>
</blockquote>

<p>After that, you can create a Kubernetes secret with that file:</p></li>
</ol>

<p><code>apiVersion: v1
kind: Secret
metadata:
  name: azure-secret
type: Opaque
data:
  azurestorageaccountname: azhzdGVzdA==
  azurestorageaccountkey: eElGMXpKYm5ub2pGTE1Ta0JwNTBteDAyckhzTUsyc2pVN21GdDRMMTNob0I3ZHJBYUo4akQ2K0E0NDNqSm9nVjd5MkZVT2hRQ1dQbU02WWFOSHk3cWc9PQ==
</code></p>

<ol start="3">
<li>Now you can mount a share into your pod:</li>
</ol>

<p><code>apiVersion: v1
kind: Pod
metadata:
 name: azure
spec:
 containers:
  - image: kubernetes/pause
    name: azure
    volumeMounts:
      - name: azure
        mountPath: /mnt/azure
 volumes:
      - name: azure
        azureFile:
          secretName: azure-secret
          shareName: k8stest
          readOnly: false
</code></p>
