2022-09-22 22:05:40 +00:00
|
|
|
{{/* 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
|
2022-09-24 20:39:59 +00:00
|
|
|
mountPath: /app/config.yml
|
|
|
|
subPath: config.yml
|
2022-09-22 22:05:40 +00:00
|
|
|
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" -}}
|
2022-09-26 11:35:03 +00:00
|
|
|
{{- $_ := set .Values.podAnnotations "prometheus.io/port" (.Values.service.http.ports.http.port | toString) -}}
|
2022-09-22 22:05:40 +00:00
|
|
|
|
2022-09-26 09:57:00 +00:00
|
|
|
{{- if .Values.webUI.enabled -}}
|
2022-09-22 22:05:40 +00:00
|
|
|
{{- $_ := 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 -}}
|
|
|
|
|
2022-09-26 10:04:00 +00:00
|
|
|
{{/* Define path for api */}}
|
|
|
|
{{- define "blocky.api" -}}
|
|
|
|
{{- $fullname := include "tc.common.names.fullname" . -}}
|
|
|
|
path: "/api"
|
|
|
|
# -- Ignored if not kubeVersion >= 1.14-0
|
|
|
|
pathType: Prefix
|
|
|
|
service:
|
|
|
|
# -- Overrides the service name reference for this path
|
|
|
|
name: {{ printf "%s-http" $fullname }}
|
|
|
|
port: {{ .Values.service.http.ports.http.port }}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/* inject websocket path to all main ingress hosts*/}}
|
|
|
|
{{- define "blocky.apiinjector" -}}
|
|
|
|
{{- $path := list (include "blocky.api" . | fromYaml) -}}
|
|
|
|
{{- if .Values.ingress.main.enabled }}
|
|
|
|
{{- range .Values.ingress.main.hosts }}
|
|
|
|
{{- $newpaths := list }}
|
|
|
|
{{- $newpaths := concat .paths $path }}
|
|
|
|
{{- $_ := set . "paths" ( deepCopy $newpaths ) -}}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{/* inject api paths in ingress */}}
|
|
|
|
{{- include "blocky.apiinjector" . }}
|
|
|
|
|
2022-09-22 22:05:40 +00:00
|
|
|
{{/* Render the templates */}}
|
|
|
|
{{ include "tc.common.loader.apply" . }}
|