由于每次都忘记玩意的yaml怎么写,被自己蠢哭的我决定记一个在网页上(* ̄︿ ̄)
主要是由于kubesphere 的点点点页面并不能实现这么一个操作,如果如下选择ksp的挂载
会得到下面的yaml,这个目录将会只有这个文件,因为文件夹只会包含被挂载问文件系统中的文件。
volumes:
- name: volume-s9q61h
configMap:
name: qbittorrent-config-json
items:
- key: qBittorrent.conf
path: qBittorrent.conf
defaultMode: 420
containers:
- name: container-5ys0py
volumeMounts:
- name: volume-s9q61h
readOnly: true
mountPath: /config/qBittorrent
我们需要做的就是让其他文件也显示出来,具体的写法是挂载至某一文件,而不是文件夹。volumeMount 额外的subPath 字段可以被用作挂载卷的某个独立文件或者是文件夹,无须挂载完整的卷。
如下:
volumes:
- name: volume-s9q61h
configMap:
name: qbittorrent-config-json
items:
- key: qBittorrent.conf
path: qBittorrent.conf
defaultMode: 420
containers:
- name: container-5ys0py
volumeMounts:
- name: volume-s9q61h
readOnly: true
mountPath: /config/qBittorrent/qBittorrent.conf
subPath: qBittorrent.conf
评论
YkDLwpiSryHNzK
fFimRKsdyLarA
GnwaQfZSPrlMEvo
TCMNeljAJQuhPFS
qxkFXnPp
VQWAzpFOuBCXo
ZqPOYEGHfLCymTz