我只是好奇這兩種ConfigMap在volumes部分中定義的方式有什么區別?
pstest-config包括config.json檔案。
newpod.yaml:
apiVersion: v1
kind: Pod
metadata:
name: configmappod
spec:
containers:
- name: configmapcontainer
image: blue
volumeMounts:
- name: config-vol
mountPath: "/config/newConfig.json"
subPath: "config.json"
readOnly: true
volumes:
- name: config-vol
projected:
sources:
- configMap:
name: test-config
items:
- key: config.json
path: config.json
newpod2.yaml
apiVersion: v1
kind: Pod
metadata:
name: configmappod
spec:
containers:
- name: configmapcontainer
image: blue
volumeMounts:
- name: config-vol
mountPath: "/config/newConfig.json"
subPath: "config.json"
readOnly: true
volumes:
- name: config-vol
configMap:
name: test-config
uj5u.com熱心網友回復:
沒有什么不同,它們產生相同的結果。順便說一句,該readOnly屬性是多余的,在這兩種情況下都沒有任何作用。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/407243.html
標籤:
上一篇:找不到Minikube標志
