From 3a31e973c00108162c43e48a934ca95027b20545 Mon Sep 17 00:00:00 2001 From: Matheus Pimenta Date: Fri, 6 Mar 2026 03:44:28 +0000 Subject: [PATCH] Introduce GRPCRoute in the Helm chart Signed-off-by: Matheus Pimenta --- charts/podinfo/templates/grpcroute.yaml | 42 +++++++++++++++++++++++++ charts/podinfo/values.yaml | 22 +++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 charts/podinfo/templates/grpcroute.yaml diff --git a/charts/podinfo/templates/grpcroute.yaml b/charts/podinfo/templates/grpcroute.yaml new file mode 100644 index 0000000..716ace7 --- /dev/null +++ b/charts/podinfo/templates/grpcroute.yaml @@ -0,0 +1,42 @@ +{{- if .Values.grpcRoute.enabled -}} +{{- $fullName := include "podinfo.fullname" . -}} +{{- $grpcPort := .Values.service.grpcPort -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: GRPCRoute +metadata: + name: {{ $fullName }} + namespace: {{ include "podinfo.namespace" . }} + labels: + {{- include "podinfo.labels" . | nindent 4 }} + {{- with .Values.grpcRoute.additionalLabels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.grpcRoute.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + parentRefs: + {{- with .Values.grpcRoute.parentRefs }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.grpcRoute.hostnames }} + hostnames: + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + {{- range .Values.grpcRoute.rules }} + - backendRefs: + - name: {{ $fullName }} + port: {{ $grpcPort }} + weight: 1 + {{- with .matches }} + matches: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .filters }} + filters: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- end }} +{{- end }} diff --git a/charts/podinfo/values.yaml b/charts/podinfo/values.yaml index 255c101..4902cea 100644 --- a/charts/podinfo/values.yaml +++ b/charts/podinfo/values.yaml @@ -232,6 +232,28 @@ httpRoute: type: PathPrefix value: / +# -- Expose the gRPC service via Gateway GRPCRoute +# Requires a Gateway controller with GRPCRoute support +# Docs https://gateway-api.sigs.k8s.io/guides/grpc-routing/ +grpcRoute: + # GRPCRoute enabled. + enabled: false + # Add additional labels to the GRPCRoute. + additionalLabels: {} + # GRPCRoute annotations. + annotations: {} + # Which Gateways this Route is attached to. + parentRefs: + - name: gateway + sectionName: http + # namespace: default + # Hostnames matching HTTP header. + hostnames: + - podinfo.local + # List of rules applied. + rules: + - {} + # create Prometheus Operator monitor serviceMonitor: enabled: false