Here's an example of mounting config map entries as files:
apiVersion: v1
kind: ConfigMap
metadata:
name: config-1
data:
file1.txt: FILE1
file2.txt: FILE2
---
apiVersion: v1
kind: ConfigMap
metadata:
name: config-2
data:
boo1: BOO1
boo3: BOO3
---
apiVersion: v1
kind: Pod
metadata:
name: test
spec:
containers:
- image: nginx:stable-alpine
name: nginx
volumeMounts:
- name: a
mountPath: /etc/configs/a
- name: b
mountPath: /etc/configs/b
volumes:
- name: a
configMap:
name: config-1 # mount all keys in the ConfigMap config-1 as files.
- name: b
configMap:
name: config-2
items: # you can pick and choose which files to bring.
- key: boo1
path: boo1.txt # you can rename them as well, we'll be mounting boo1 from config-2 ConfigMap but we'll be mounting it as boo1.txt