Kubernetes-无法在Azure File Share上挂载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: faselectaksshare\windows
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: faselectaksshare\windows
ReadOnly: false
请帮助!谢谢
更新: 我也使用subPath尝试了这种方法,再次没有安装任何文件夹.另外,我在日志或describe 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: aksshare\windows
secretName: azure-secret
文件共享的每个子文件夹中存在的文件不会影响其他文件.
And the files that exist in each subfolder of the file share do not affect other ones.
这篇关于Kubernetes-无法在Azure File Share上挂载Windows路径(Linux挂载工作正常)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!