Red Hat Training

A Red Hat training course is available for OpenShift Container Platform

26.4. 更新卷

更新现有卷或卷挂载与 添加卷 相同,但使用 --overwrite 选项:

$ oc set volume <object_type>/<name> --add --overwrite [options]

示例

将复制控制器 r1 的现有卷 v1 替换为现有的持久性卷声明 pvc1

$ oc set volume rc/r1 --add --overwrite --name=v1 --type=persistentVolumeClaim --claim-name=pvc1

将卷 v1 的部署配置 d1 挂载点更改为 /opt

$ oc set volume dc/d1 --add --overwrite --name=v1 --mount-path=/opt