Skip to content
Snippets Groups Projects
Commit 9651a083b90b authored by Simon Chabot's avatar Simon Chabot
Browse files

feat: add a option to mount local file as config files

parent cdbd0452f713
No related branches found
No related tags found
1 merge request!6feat: add a option to mount local file as config files
{{- if .Values.mountConfigMaps }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name}}-config-files
data:
{{- range $c := .Values.mountConfigMaps }}
{{ $c.key }} : |-
{{ $c.data | indent 4 }}
{{ end }}
{{ end }}
......@@ -28,5 +28,5 @@
imagePullSecrets:
- name: {{ .Release.Name }}-regcred
{{- end }}
{{- if .Values.volume }}
{{- if or .Values.volume .Values.mountConfigMaps}}
volumes:
......@@ -32,4 +32,5 @@
volumes:
{{- if .Values.volume }}
- name: {{ .Values.volume.name }}
persistentVolumeClaim:
claimName: {{ .Values.volume.name }}
......@@ -33,6 +34,12 @@
- name: {{ .Values.volume.name }}
persistentVolumeClaim:
claimName: {{ .Values.volume.name }}
{{- end }}
{{- if .Values.mountConfigMaps }}
- name: config-files
configMap:
name: {{ .Release.Name}}-config-files
{{- end }}
{{- end}}
containers:
- image: {{ .Values.image.repo }}:{{ .Values.image.tag }}
......@@ -58,5 +65,5 @@
- secretRef:
name: {{ .Release.Name }}-env
{{- end }}
{{- if .Values.volume }}
{{- if or .Values.volume .Values.mountConfigMaps}}
volumeMounts:
......@@ -62,3 +69,4 @@
volumeMounts:
{{- if .Values.volume }}
- name: {{ .Values.volume.name }}
mountPath: {{ .Values.volume.mountPath }}
......@@ -63,5 +71,11 @@
- name: {{ .Values.volume.name }}
mountPath: {{ .Values.volume.mountPath }}
{{- end }}
{{- range $c := .Values.mountConfigMaps }}
- name: config-files
mountPath: {{ $c.mountPath }}
subPath: {{ $c.key }}
{{ end }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
......
......@@ -90,3 +90,10 @@
# registry: registry.exemple.org
# username: user
# password: password
#
mountConfigMaps: []
# - key: "config.yaml" # keys must be unique
# mountPath: "/etc/project/config.yaml"
# data: |-
# some content
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment