我正在尝试将 volumeMounts 中的文件添加到 .dockerignore 并试图了解 subPath 和 mountPath 之间的区别。阅读官方文档对我来说并不清楚。
我应该从我读取的内容中添加 mountPath 是 pod 中将安装卷的目录。
来自官方文档:“subPath volumeMounts.subPath 属性指定引用卷内的子路径而不是其根。” https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath(这部分不清楚)
- mountPath: /root/test.pem
name: test-private-key
subPath: test.testing.com.key
Run Code Online (Sandbox Code Playgroud)
在这个例子中,我应该将 test.pem 和 test.testing.com.key 都包含到 dockerignore 中吗?
kubernetes ×1