Update common.yaml

Signed-off-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
This commit is contained in:
Kjeld Schouten-Lebbing 2022-09-26 12:04:00 +02:00 committed by GitHub
parent 497d459134
commit 00b22662a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 29 additions and 0 deletions

View File

@ -46,5 +46,34 @@ volumeSpec:
{{- $_ := set .Values.additionalContainers "k8sgateway" (include "k8sgateway.container" . | fromYaml) -}}
{{- end -}}
{{/* 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 */}}
{{- if .Values.blocky.apiIngress -}}
{{- include "blocky.apiinjector" . }}
{{- end }}
{{/* Render the templates */}}
{{ include "tc.common.loader.apply" . }}