feat(helm): custom template support with helm charts

This commit is contained in:
Stefan Warnat 2024-12-30 14:42:18 +00:00
parent eb50d8adf4
commit fa82f8ef0a
3 changed files with 38 additions and 0 deletions

View file

@ -0,0 +1,12 @@
{{ if .Values.umap.templates}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "umap.fullname" . }}-templates
labels:
{{- include "umap.labels" . | nindent 4 }}
data:
{{- range $k, $v := .Values.umap.templates }}
{{ $k }}: {{ $v | quote }}
{{- end }}
{{end}}

View file

@ -13,6 +13,7 @@ spec:
metadata: metadata:
annotations: annotations:
checksum/config: {{ include (print $.Template.BasePath "/secret-config.yaml") . | sha256sum }} checksum/config: {{ include (print $.Template.BasePath "/secret-config.yaml") . | sha256sum }}
checksum/templates: {{ include (print $.Template.BasePath "/configmap-templates.yaml") . | sha256sum }}
checksum/env: {{ include (print $.Template.BasePath "/secret-env.yaml") . | sha256sum }} checksum/env: {{ include (print $.Template.BasePath "/secret-env.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }} {{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}
@ -77,6 +78,14 @@ spec:
- name: data - name: data
mountPath: /srv/umap/uploads/ mountPath: /srv/umap/uploads/
{{- end }} {{- end }}
{{- if .Values.umap.templates}}
{{- range $k, $v := .Values.umap.templates }}
- name: templates
mountPath: /venv/lib/python3.11/site-packages/umap/templates/umap/{{- $k }}
subPath: {{ $k }}
{{- end }}
{{- end }}
volumes: volumes:
- name: config - name: config
secret: secret:
@ -88,6 +97,12 @@ spec:
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ include "umap.pvcName" . }} claimName: {{ include "umap.pvcName" . }}
{{- end }} {{- end }}
{{- if .Values.umap.templates}}
- name: templates
configMap:
name: {{ include "umap.fullname" . }}-templates
{{- end }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector:
{{- toYaml . | nindent 8 }} {{- toYaml . | nindent 8 }}

View file

@ -77,6 +77,17 @@ umap:
SECRET_KEY: CHANGE_ME SECRET_KEY: CHANGE_ME
STATIC_ROOT: /srv/umap/static STATIC_ROOT: /srv/umap/static
MEDIA_ROOT: /srv/umap/uploads MEDIA_ROOT: /srv/umap/uploads
templates: {}
# Overwrite templates like footer.html or header.html
# footer.html: |
# <a href="/imprint">Imprint</a>
# header.html: |
# custom Header
#
# It is not recommended to overwrite other templates!
# list of templates: https://github.com/umap-project/umap/tree/master/umap/templates/umap
# You can also provide umap.conf content here: # You can also provide umap.conf content here:
config: | config: |
from umap.settings.base import * from umap.settings.base import *