【发布时间】:2020-10-29 12:15:27
【问题描述】:
我有两个不同的配置映射 test-configmap 和 common-config。我试图将它们安装在同一位置,但一个配置映射覆盖了另一个。然后我读到subPath 并没有工作。
部署.yaml
apiVersion: apps/v1beta1 # for versions before 1.8.0 use apps/v1beta1
kind: Deployment
metadata:
name: testing
spec:
replicas: 1
template:
metadata:
name: testing
labels:
app: testing
spec:
containers:
- name: testing-container
image: testing
imagePullPolicy: IfNotPresent
ports:
- containerPort: __PORT__
volumeMounts:
- name: commonconfig-volume
mountPath: /usr/src/app/config/test.config
subPath: test.config
volumes:
- name: commonconfig-volume
configMap:
name: test-configmap
- name: commonconfig-volume
configMap:
name: common-config
错误:
The Deployment "testing" is invalid: spec.template.spec.volumes[1].name: Duplicate value: "commonconfig-volume"
我不确定是否可以合并两个配置映射。如果是,那我该怎么做。
【问题讨论】:
-
下次添加您提到的配置图的内容,以便对人们更有意义
标签: deployment kubernetes