From 11be91ae36028df4b35c252cd71f6e676e7fdf54 Mon Sep 17 00:00:00 2001 From: Fabian Fischer Date: Tue, 18 Jul 2023 10:24:38 +0200 Subject: [PATCH] Support exposing a filterproxy for non k8s galera We also need the feature introduced in #458 for `galera` not just for `galerak8s`. --- README.md | 2 +- appuio/haproxy/Chart.yaml | 2 +- appuio/haproxy/README.md | 2 +- appuio/haproxy/templates/_helpers.tpl | 14 ++++++++++++++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1fe5ad06..07687a34 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ helm repo add appuio https://charts.appuio.ch | [![chart downloads](https://img.shields.io/github/downloads/appuio/charts/data-cube-curation-0.3.1/total)](https://github.com/appuio/charts/releases/tag/data-cube-curation-0.3.1) | [data-cube-curation](appuio/data-cube-curation/README.md) | | [![chart downloads](https://img.shields.io/github/downloads/appuio/charts/exoip-1.0.4/total)](https://github.com/appuio/charts/releases/tag/exoip-1.0.4) | [exoip](appuio/exoip/README.md) | | [![chart downloads](https://img.shields.io/github/downloads/appuio/charts/generic-0.1.2/total)](https://github.com/appuio/charts/releases/tag/generic-0.1.2) | [generic](appuio/generic/README.md) | -| [![chart downloads](https://img.shields.io/github/downloads/appuio/charts/haproxy-2.2.1/total)](https://github.com/appuio/charts/releases/tag/haproxy-2.2.1) | [haproxy](appuio/haproxy/README.md) | +| [![chart downloads](https://img.shields.io/github/downloads/appuio/charts/haproxy-2.3.0/total)](https://github.com/appuio/charts/releases/tag/haproxy-2.3.0) | [haproxy](appuio/haproxy/README.md) | | [![chart downloads](https://img.shields.io/github/downloads/appuio/charts/mariadb-galera-1.2.4/total)](https://github.com/appuio/charts/releases/tag/mariadb-galera-1.2.4) | [mariadb-galera](appuio/mariadb-galera/README.md) | | [![chart downloads](https://img.shields.io/github/downloads/appuio/charts/maxscale-2.0.1/total)](https://github.com/appuio/charts/releases/tag/maxscale-2.0.1) | [maxscale](appuio/maxscale/README.md) | | [![chart downloads](https://img.shields.io/github/downloads/appuio/charts/metrics-server-2.12.1/total)](https://github.com/appuio/charts/releases/tag/metrics-server-2.12.1) | [metrics-server](appuio/metrics-server/README.md) | diff --git a/appuio/haproxy/Chart.yaml b/appuio/haproxy/Chart.yaml index 4861e82a..b494dc10 100644 --- a/appuio/haproxy/Chart.yaml +++ b/appuio/haproxy/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: 2.7.3 description: A Helm chart for HAProxy which can be customized by a config map. name: haproxy -version: 2.2.1 +version: 2.3.0 maintainers: - name: APPUiO Team email: info@appuio.ch diff --git a/appuio/haproxy/README.md b/appuio/haproxy/README.md index 9c6bf835..6dc41ab7 100644 --- a/appuio/haproxy/README.md +++ b/appuio/haproxy/README.md @@ -1,6 +1,6 @@ # haproxy -![Version: 2.2.1](https://img.shields.io/badge/Version-2.2.1-informational?style=flat-square) ![AppVersion: 2.7.3](https://img.shields.io/badge/AppVersion-2.7.3-informational?style=flat-square) +![Version: 2.3.0](https://img.shields.io/badge/Version-2.3.0-informational?style=flat-square) ![AppVersion: 2.7.3](https://img.shields.io/badge/AppVersion-2.7.3-informational?style=flat-square) A Helm chart for HAProxy which can be customized by a config map. diff --git a/appuio/haproxy/templates/_helpers.tpl b/appuio/haproxy/templates/_helpers.tpl index ba9a36c6..fa1e19fd 100644 --- a/appuio/haproxy/templates/_helpers.tpl +++ b/appuio/haproxy/templates/_helpers.tpl @@ -76,12 +76,26 @@ frontend galeraMetrics {{- range $i, $node := .Values.haproxy.galera.nodes }} use_backend galera-node-{{$i}} if { hdr_sub(host) -i mariadb-{{$i}} } {{- end }} + {{- range $i, $node := .Values.haproxy.galera.nodes }} + use_backend galera-node-{{$i}} if { path_beg /mariadb/{{$i}} } + {{- end }} + {{- if .Values.haproxy.filterproxy.enabled }} + use_backend filterproxy + {{- end }} {{- range $i, $node := .Values.haproxy.galera.nodes }} backend galera-node-{{$i}} mode http server node-{{$i}} {{ $node.address }}:9104 init-addr none check resolvers mydns {{- end }} +{{- $namespace := .Release.Namespace -}} +{{- if .Values.haproxy.filterproxy.enabled }} + +backend filterproxy + mode http + http-request set-query namespace={{ $namespace }} + server filter {{ .Values.haproxy.filterproxy.url }} +{{- end }} {{- end }} {{- end -}}