Azure ACS:Azure文件卷无法正常工作

时间:2017-05-04 15:47:07

标签: azure-container-service

我已按照github上的说明设置了天蓝色文件卷。

apiVersion: v1
kind: Secret
metadata:
name: azure-files-secret
type: Opaque
data:
  azurestorageaccountname: Yn...redacted...=
  azurestorageaccountkey: 3+w52/...redacted...MKeiiJyg==

然后我在我的pod配置中有:

...stuff
volumeMounts:
  - mountPath: /var/ccd
  name: openvpn-ccd
...more stuff
volumes:
    - name: openvpn-ccd
      azureFile:
        secretName: azure-files-secret
        shareName: az-files
        readOnly: false

然后创建容器失败:

 MountVolume.SetUp failed for volume "kubernetes.io/azure-file/007adb39-30df-11e7-b61e-000d3ab6ece2-openvpn-ccd" (spec.Name: "openvpn-ccd") pod "007adb39-30df-11e7-b61e-000d3ab6ece2" (UID: "007adb39-30df-11e7-b61e-000d3ab6ece2") with: mount failed: exit status 32 Mounting command: mount Mounting arguments: //xxx.file.core.windows.net/az-files /var/lib/kubelet/pods/007adb39-30df-11e7-b61e-000d3ab6ece2/volumes/kubernetes.io~azure-file/openvpn-ccd cifs [vers=3.0,username=xxx,password=xxx,dir_mode=0777,file_mode=0777] Output: mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

我以前收到密码错误,因为我没有base64编码帐户密钥,但现在已经解决,我得到更通用的Permission denied错误,我怀疑可能是挂载点,而不是比文件存储。在任何情况下,我都需要有关如何进一步排除故障的建议吗?

1 个答案:

答案 0 :(得分:0)

这似乎是您的存储帐户的身份验证错误。取消base64密码,然后使用与存储帐户相同的区域中的ubuntu映像进行验证

以下是验证Azure文件共享正确安装的示例脚本:

if [ $# -ne 3 ]
then
 echo "you must pass arguments STORAGEACCOUNT STORAGEACCOUNTKEY SHARE"
 exit 1
fi

ACCOUNT=$1
ACCOUNTKEY=$2
SHARE=$3
MOUNTSHARE=/mnt/${SHARE}

apt-get update && apt-get install -y cifs-utils

mkdir -p /mnt/$SHARE
mount -t cifs //${ACCOUNT}.file.core.windows.net/${SHARE} ${MOUNTSHARE} -o vers=2.1,username=${ACCOUNT},password=${ACCOUNTKEY}