I have created a kubernetes configmap which contains multiple key value pairs. I want to mount each value in a different path. Im using helm to create charts.
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Values.name }}-configmap
namespace: {{ .Values.namespace }}
labels:
name: {{ .Values.name }}-configmap
data:
test1.yml: |-
{{ .Files.Get .Values.test1_filename }}
test2.yml: |-
{{ .Files.Get .Values.test2_filename }}
I want test1.yml and test2.yml to be mounted in different directories.How can i do it?
You can use
subPath
field to pickup specific file from configMap: