My configMap file:
kind: ConfigMap
apiVersion: v1
metadata:
name: config
data:
config.xml: |
{{ .Files.Get "configuration/config.tpl" | indent 4 }}
control1.xml: |
{{ .Files.Get "controlsets/control1.tpl" | indent 4 }}
control2.xml: |
{{ .Files.Get "controlsets/control2.tpl" | indent 4 }}
How do I achieve that config.xml will be mounted to configuration folder and both control files to controlsets folder? Thank you for answer.
EDIT: I solved issue but I think it can be done more dynamically.
configMap file stays the same.
volumeMounts part of deployment file:
volumeMounts:
- name: config-volume
mountPath: /app/Configuration/config.xml
subPath: config.xml
- name: config-volume
mountPath: /app/Controlsets/control1.xml
subPath: control1.xml
- name: config-volume
mountPath: /app/Controlsets/control2.xml
subPath: control2.xml
How would I achieve that all files which are in controlsets folder go into /app/Controlsets folder and all files in configuration go to /app/Configuration folder with script? Now I have to change yaml files for each config file I add. It would be nice If just write relations between folders and the rest is done by helm.