I am having two different config maps test-configmap and common-config. I tried to mount them at the same location, but one config map over
You have to use special projected volumes for achieve that. Example your deployment:
apiVersion: apps/v1
kind: Deployment
metadata:
name: testing
spec:
replicas: 1
selector:
matchLabels:
app: testing
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
volumes:
- name: commonconfig-volume
projected:
sources:
- configMap:
name: test-configmap
- configMap:
name: common-config
You can use secret same as configMap