From 003a83d76aaa15e176363753f0e2161eba09e6d8 Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Thu, 29 Sep 2022 22:00:12 +0200 Subject: [PATCH] feat(blocky): add DoH support on main ingress (#3959) * Update common.yaml Signed-off-by: Kjeld Schouten-Lebbing * Update Chart.yaml Signed-off-by: Kjeld Schouten-Lebbing Signed-off-by: Kjeld Schouten-Lebbing --- charts/enterprise/blocky/Chart.yaml | 2 +- .../enterprise/blocky/templates/common.yaml | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/charts/enterprise/blocky/Chart.yaml b/charts/enterprise/blocky/Chart.yaml index f20037eb793..6897ac188cb 100644 --- a/charts/enterprise/blocky/Chart.yaml +++ b/charts/enterprise/blocky/Chart.yaml @@ -26,7 +26,7 @@ sources: - https://github.com/0xERR0R/blocky - https://github.com/Mozart409/blocky-frontend - https://hub.docker.com/r/spx01/blocky -version: 1.0.11 +version: 1.1.0 annotations: truecharts.org/catagories: | - network diff --git a/charts/enterprise/blocky/templates/common.yaml b/charts/enterprise/blocky/templates/common.yaml index 771a3d532ce..f8e20c4da02 100644 --- a/charts/enterprise/blocky/templates/common.yaml +++ b/charts/enterprise/blocky/templates/common.yaml @@ -73,5 +73,35 @@ service: {{/* inject api paths in ingress */}} {{- include "blocky.apiinjector" . }} + + +{{/* Define path for DoH */}} +{{- define "blocky.doh" -}} +{{- $fullname := include "tc.common.names.fullname" . -}} +path: "/dns-query" +# -- 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.dohinjector" -}} +{{- $path := list (include "blocky.doh" . | 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.dohinjector" . }} + + {{/* Render the templates */}} {{ include "tc.common.loader.apply" . }}