TrueChartsCatalogClone/incubator/blocky/0.0.4/templates/common.yaml

51 lines
1.7 KiB
YAML

{{/* Make sure all variables are set properly */}}
{{- include "tc.common.loader.init" . }}
{{ include "blocky.configmap" . }}
{{/* Always mount the configmap, with the basic config, plus the 'blockyConfig' */}}
{{- define "blocky.configmap.mount" -}}
enabled: true
type: custom
mountPath: /app/config/tc-config.yaml
subPath: tc-config.yaml
readOnly: true
volumeSpec:
configMap:
name: '{{ printf "%s-config" (include "tc.common.names.fullname" .) }}'
{{- end -}}
{{/* Append the general configMap volume to the volumes */}}
{{- define "k8sgateway.configvolume" -}}
enabled: "true"
mountPath: "/etc/coredns"
readOnly: true
type: "custom"
volumeSpec:
configMap:
name: {{ include "tc.common.names.fullname" . }}-corefile
items:
- key: Corefile
path: Corefile
{{- end -}}
{{- $_ := set .Values.persistence "tc-config" (include "blocky.configmap.mount" . | fromYaml) -}}
{{- $_ := set .Values.podAnnotations "prometheus.io/scrape" "true" -}}
{{- $_ := set .Values.podAnnotations "prometheus.io/path" "/metrics" -}}
{{- $_ := set .Values.podAnnotations "prometheus.io/port" (.Values.service.main.ports.main.targetPort | quote) -}}
{{- if .Values.blocky.enableWebUI -}}
{{- $_ := set .Values.additionalContainers "frontend" (include "blocky.frontend" . | fromYaml) -}}
{{- end -}}
{{- if and .Values.k8sgateway.enabled .Values.k8sgateway.domains -}}
{{- include "k8sgateway.configmap" . }}
{{- $_ := set .Values.persistence "config-volume" (include "k8sgateway.configvolume" . | fromYaml) -}}
{{- $_ := set .Values.additionalContainers "k8sgateway" (include "k8sgateway.container" . | fromYaml) -}}
{{- end -}}
{{/* Render the templates */}}
{{ include "tc.common.loader.apply" . }}