【发布时间】:2021-06-16 22:13:49
【问题描述】:
首先,我成功地在 Pod 上安装了我的 Linux 路径。 我使用了 azure 文件共享,并且挂载的文件夹出现在文件共享上。
volumeMounts:
- name: ads-filesharevolume
mountPath: /opt/front/arena/host
volumes:
- name: ads-filesharevolume
azureFile:
secretName: fa-fileshare-secret
shareName: faselectaksshare
readOnly: false
现在在文件共享上,我添加了一个子文件夹“windows”用于挂载,在日志中它提到它已正确挂载但我没有挂载任何东西(文件夹和文件不会像 Linux 那样出现在挂载的共享上)
args: [ "-license_file", "C:/Host/dat/license.dat",
"-key_file", "C:/Host/dat/license.key"]
volumeMounts:
- name: ads-win-filesharevolume
mountPath: "C:\\host"
volumes:
- name: ads-win-filesharevolume
azureFile:
secretName: fa-fileshare-secret
shareName: faselectaksshare\windows
readOnly: false
对于 mountPath,我尝试过:C:\\host 和 C:/host 和 /c/host
同样对于 shareName,我最初尝试使用 faselectaksshare/windows,但它引发了异常。
在 Pod describe 中,我可以看到一切正常,但来自 C:/host 的预期文件夹没有出现在 Windows 子文件夹中的 Azure 文件共享路径中。对于所有其他情况,我也会收到类似的输出。
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-nx49r (ro)
C:/host from ads-win-filesharevolume (rw)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
ads-win-filesharevolume:
Type: AzureFile (an Azure File Service mount on the host and bind mount to the pod)
SecretName: fa-fileshare-secret
ShareName: faselectaksshare\windows
ReadOnly: false
请帮忙!谢谢
更新: 我也用 subPath 尝试了这种方法,但我没有安装任何文件夹。此外,我在日志或描述 pod 命令中没有收到任何错误
volumeMounts:
- name: ads-filesharevolume
mountPath: /host
subPath: windows
volumes:
- name: ads-filesharevolume
azureFile:
secretName: fa-fileshare-secret
shareName: faselectaksshare
readOnly: false
【问题讨论】:
-
关于这个问题的任何更新?它解决了你的问题吗?如果它适合你,请接受它。
-
你解决问题了吗?我没有看到任何更新。你还在里面工作吗?
标签: docker kubernetes azure-aks kubernetes-pod docker-volume