feature: add optional grpcweb filter to ingress

This commit is contained in:
Stefan Reimer 2025-05-16 11:51:12 +00:00
parent b05a4937bd
commit 17e9720c42
5 changed files with 42 additions and 2 deletions

View File

@ -0,0 +1,30 @@
{{- if .Values.httpFilter.grpcWeb }}
# Inserts the grpcWeb filter into the http_connection mangager chain before the CORS filter
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: {{ include "gatewayName" . | trimPrefix "istio-" }}-grpcweb
namespace: {{ .Release.Namespace }}
labels:
{{ include "kubezero-lib.labels" . | nindent 4 }}
spec:
workloadSelector:
labels:
{{- include "gatewaySelectorLabels" . | nindent 6 }}
configPatches:
- applyTo: HTTP_FILTER
match:
context: GATEWAY
listener:
filterChain:
filter:
name: envoy.filters.network.http_connection_manager
subFilter:
name: envoy.filters.http.cors
patch:
operation: INSERT_BEFORE
value:
name: envoy.filters.http.grpc_web
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.grpc_web.v3.GrpcWeb
{{- end }}

View File

@ -44,3 +44,6 @@ hardening:
rejectUnderscoresHeaders: true
unescapeSlashes: true
preserveExternalRequestId: false
httpFilter:
grpcWeb: false

View File

@ -25,8 +25,7 @@ spec:
repoURL: {{ default "https://cdn.zero-downtime.net/charts" (index .Values $name "repository") }}
targetRevision: {{ default "HEAD" ( index .Values $name "targetRevision" ) | quote }}
helm:
# add with 1.32
#skipTests: true
skipTests: true
valuesObject:
{{- include (print $name "-values") $ | nindent 8 }}

View File

@ -98,6 +98,10 @@ proxyProtocol: {{ default true (index .Values "istio-ingress" "proxyProtocol") }
hardening:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with (index .Values "istio-ingress" "httpFilter") }}
httpFilter:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}

View File

@ -93,6 +93,10 @@ proxyProtocol: {{ default true (index .Values "istio-private-ingress" "proxyProt
hardening:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with (index .Values "istio-private-ingress" "httpFilter") }}
httpFilter:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}