When mounting a AzureFile K8S volume, I get a "azureMount: SmbGlobalMapping failed" error

11/4/2018

I'm trying to mount an azureFile volume on a Windows K8S pod, but I get the error

MountVolume.SetUp failed for volume "azure-file-share" : azureMount: SmbGlobalMapping failed: fork/exec C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe: The parameter is incorrect., only SMB mount is supported now, output: ""

What is wrong?

-- Phyxx
azure
kubernetes

1 Answer

11/4/2018

The issue where was a bad azurestorageaccountkey value in the secret. You can have a secret like:

apiVersion: v1
kind: Secret
metadata:
  name: volume-azurefile-storage-secret
type: Opaque
data:
  azurestorageaccountname: <base 64 encoded account name>
  azurestorageaccountkey: <base 64 encoded account key>

What was throwing me was that Azure already base 64 encodes the account key, and it was not clear if you need to double encode it for this secret file.

The answer is yes, you do double encode it. If you do not, you get the error from the question.

-- Phyxx
Source: StackOverflow