title: Kubernetes with AzureFile and other StorageEndpointSuffix
body: <p>I try to mount an azure storage account (in Azure germany) in a Kubernetes pod:</p>
  
  <pre><code>apiVersion: v1
  kind: Pod
  metadata:
   name: storagetest
  spec:
   containers:
    - image: nginx
      name: nginx
      volumeMounts:
        - name: azure
          mountPath: /mnt/azure
   volumes:
        - name: azure
          azureFile:
            secretName: azure-secret
            shareName: clusterstorage
            readOnly: false
  </code></pre>
  
  <p>I created the azure-secret with the following file</p>
  
  <pre><code>apiVersion: v1
  kind: Secret
  metadata:
    name: azure-secret
  type: Opaque
  data:
    azurestorageaccountname:base64AccoutnName
    azurestorageaccountkey: base64Key
  </code></pre>
  
  <p>When I start the pod, I get the following error message:</p>
  
  <pre><code>Mounting arguments: --description=Kubernetes transient mount for /var/lib/kubelet/pods/a8a3e443-2135-11e8-8482-0017fa10471a/volumes/kubernetes.io~azure-file/azure --scope -- mount -t cifs -o username=clusterstorage,password=***,file_mode=0755,dir_mode=0755,vers=3.0 //....file.core.windows.net/... /var/lib/kubelet/pods/...volumes/kubernetes.io~azure-file/azure
  Output: Running scope as unit run-....scope.
  mount error(13): Permission denied
  Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
  </code></pre>
  
  <p>I noticed the volume url to be xxx.file.core.windows.net and my endpoint address end with file.core.cloudapi.de. </p>
  
  <p>Then I found the source code of <a href="https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/azure_file/azure_file.go" rel="nofollow noreferrer">Azure File</a> and saw the hard coded suffix there. </p>
  
  <p>How can I change the suffix to use Kubernetes' AzureFile in Azure Germany?</p>