Kubernetes - 无法在 Azure 文件共享上安装 Windows 路径(Linux 安装工作正常) [英] Kubernetes - cannot have Windows path mounted on Azure File Share (Linux mounting works properly )
问题描述
首先我成功地挂载了我在 Pod 上的 Linux 路径.我使用了 azure 文件共享,安装的文件夹出现在文件共享上.
Firstly I succesfully mounted, my Linux path on Pod. I used azure file share and mounted folders appear on File Share.
volumeMounts:
- name: ads-filesharevolume
mountPath: /opt/front/arena/host
volumes:
- name: ads-filesharevolume
azureFile:
secretName: fa-fileshare-secret
shareName: faselectaksshare
readOnly: false
现在在文件共享上,我添加了一个子文件夹windows";对于挂载,在日志中它提到它被正确挂载,但我没有挂载任何东西(文件夹和文件没有出现在挂载的共享上,就像 Linux 的情况一样)
Now on File Share I added one subfolder "windows" for mounting, in logs it mentions it is being mounted properly but I do not have anything mounted (folders and files do not appear on mounted share like it is the case for 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: faselectakssharewindows
readOnly: false
对于 mountPath 我试过:C:\host
和 C:/host
和 /c/host
同样对于 shareName 我最初尝试使用 faselectaksshare/windows
但它抛出了异常.
For mountPath I tried with: C:\host
and C:/host
and /c/host
Also for shareName I initially tried with faselectaksshare/windows
but it threw an exception.
在 Pod 描述中,我可以看到一切似乎都正常,但是我预期的来自 C:/host 的文件夹没有出现在 Windows 子文件夹中的 Azure 文件共享路径中.对于所有其他情况,我也收到类似的输出.
In Pod describe I can see that everything seems OK, but my expected folders from C:/host do not appear in my Azure File Share path in windows subfolder. I receive similar output for all other cases as well.
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: faselectakssharewindows
ReadOnly: false
请帮忙!谢谢
更新:我也用 subPath 尝试了这种方法,但我没有安装任何文件夹.此外,我在日志或描述 pod 命令中没有收到任何错误
UPDATE: I also tried this approach with subPath and again I do not get any folders mounted. Also I do not get any error in log or in describe pod command
volumeMounts:
- name: ads-filesharevolume
mountPath: /host
subPath: windows
volumes:
- name: ads-filesharevolume
azureFile:
secretName: fa-fileshare-secret
shareName: faselectaksshare
readOnly: false
推荐答案
Windows 和 Linux 容器同时运行:
Both Windows and Linux containers run at the same time:
Linux 安装:
volumeMounts:
- name: azure
mountPath: /mnt/azure
volumes:
- name: azure
azureFile:
shareName: aksshare/linux
secretName: azure-secret
Windows 安装:
Mount for Windows:
volumeMounts:
- name: azure
mountPath: "C:\fileshare"
volumes:
- name: azure
azureFile:
shareName: akssharewindows
secretName: azure-secret
并且文件共享的每个子文件夹中存在的文件不影响其他文件.
And the files that exist in each subfolder of the file share do not affect other ones.
这篇关于Kubernetes - 无法在 Azure 文件共享上安装 Windows 路径(Linux 安装工作正常)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!