我正在嘗試使用this拉取請求(最近在v1.3中發佈)中實現的新subPath
功能。volumeMount子路徑不起作用
然而,mount
輸出顯示它忽略了subPath
,安裝同一NFS目錄兩個音量坐騎:
nfs-server:/mnt/nfs/exports/apps/my-app on /home/share/foo type nfs4 (rw,relatime,vers=4.0,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.128.0.4,local_lock=none,addr=nfs-server)
nfs-server:/mnt/nfs/exports/apps/my-app on /home/share/bar/baz type nfs4 (rw,relatime,vers=4.0,rsize=524288,wsize=524288,namlen=255,hard,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=10.128.0.4,local_lock=none,addr=nfs-server)
我的部署YAML的相關位:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: app
spec:
replicas: 1
template:
metadata:
labels:
name: app
spec:
containers:
- name: app
image: my-org/my-app:latest
volumeMounts:
- mountPath: /home/share/foo
name: nfs
subPath: foo-resources
- mountPath: /home/share/bar/baz
name: nfs
subPath: baz-resources
volumes:
- name: nfs
nfs:
path: /mnt/nfs/exports/apps/my-app
server: nfs-server