Reorganise the trains

This commit is contained in:
kjeld Schouten-Lebbing
2021-08-23 21:32:52 +02:00
parent 674b30a7bd
commit d3deb8af69
614 changed files with 16 additions and 903 deletions
@@ -0,0 +1,17 @@
{{/* Make sure all variables are set properly */}}
{{- include "common.values.setup" . }}
{{/* Append the configMap volume to the volumes */}}
{{- define "mosquitto.configVolume" -}}
enabled: "true"
mountPath: "/mosquitto/config/mosquitto.conf"
subPath: "mosquitto.conf"
type: "custom"
volumeSpec:
configMap:
name: {{ template "common.names.fullname" . }}-config
{{- end -}}
{{- $_ := set .Values.persistence "mosquitto-config" (include "mosquitto.configVolume" . | fromYaml) -}}
{{/* Render the templates */}}
{{ include "common.all" . }}
@@ -0,0 +1,22 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "common.names.fullname" . }}-config
labels:
{{- include "common.labels" . | nindent 4 }}
data:
mosquitto.conf: |
listener {{ .Values.service.main.ports.main.port }}
{{- if .Values.auth.enabled }}
allow_anonymous false
{{- else }}
allow_anonymous true
{{- end }}
{{- if .Values.persistence.data.enabled }}
persistence true
persistence_location {{ .Values.persistence.data.mountPath }}
autosave_interval 1800
{{- end }}
{{- if .Values.persistence.configinc.enabled }}
include_dir {{ .Values.persistence.configinc.mountPath }}
{{- end }}