我注意到当我创建和挂载一个包含一些文本文件的配置映射时,容器会将这些文件视为符号链接指向../data/myfile.txt
。
例如,如果我的配置映射名称为tc-configs,其中包含2个名为stripe1.xml和stripe2.xml的xml文件,如果我将此配置映射挂载到容器中的/configs目录中,则在我的容器中将有:
bash-4.4# ls -al /configs/
total 12
drwxrwxrwx 3 root root 4096 Jun 4 14:47 .
drwxr-xr-x 1 root root 4096 Jun 4 14:47 ..
drwxr-xr-x 2 root root 4096 Jun 4 14:47 ..2018_06_04_14_47_03.291041453
lrwxrwxrwx 1 root root 31 Jun 4 14:47 ..data -> ..2018_06_04_14_47_03.291041453
lrwxrwxrwx 1 root root 18 Jun 4 14:47 stripe1.xml -> ..data/stripe1.xml
lrwxrwxrwx 1 root root 18 Jun 4 14:47 stripe2.xml -> ..data/stripe2.xml
我猜 Kubernetes 需要这些符号链接和 ../data 和 ..timestamp/ 文件夹,但我知道有些应用程序如果看到非预期的文件或文件夹可能会启动失败。
有没有方法告诉 Kubernetes 不要生成所有这些符号链接,直接挂载文件?
subPath
属性的解决方法对我来说不可行,因为我需要configmap mount的自动更新功能...我想暂时没有其他选择,只能重启pod并且不使用任何自动更新机制。 - Tobias