openshift - 如何在 openshift 中使用正在运行的容器挂载网络共享(SAMBA Windows 共享)
问题描述
我已经尝试使用 cifs 与主机一起安装网络共享,然后托管到 docker 容器。那是有效的。但我想用容器直接挂载。
解决方案
您可以通过 flexVolume 驱动挂载 cifs,如下所示。
cifs 可以这样使用,参考上面的链接进行 cifs 测试。
apiVersion: v1
kind: Pod
metadata:
name: busybox
namespace: default
spec:
containers:
- name: busybox
image: busybox
command:
- sleep
- "3600"
imagePullPolicy: IfNotPresent
volumeMounts:
- name: test
mountPath: /data
volumes:
- name: test
flexVolume:
driver: "fstab/cifs"
fsType: "cifs"
secretRef:
name: "cifs-secret"
options:
networkPath: "//server/share"
mountOptions: "dir_mode=0755,file_mode=0644,noperm"
推荐阅读
- excel - vba 代码耗时过长(偏移)在 excel 中运行的代码以填充工作表的行列
- python - IndexError,Python 绘图
- c# - EPPlus Excel 相关日期上次修改
- replace - 修复文本文件中多余的空格
- python - 从另一个数据框中删除具有相同值的行
- mongodb - 仅安装 Mongo 客户端/Shell - 在 Windows 上不安装 MongoDB
- python - 芹菜嵌套和弦未按正确顺序调用回调
- python - 如何创建熊猫数据框以在 Python 中导出此字典?
- dart - Flutter Stack 变化深度
- javascript - 打开时,模态框内的 iframe 未滚动到顶部