From fadcfe8baab82f1a7ecbbbb9a27db176d77117b1 Mon Sep 17 00:00:00 2001 From: Srinivas Chippagiri Date: Wed, 28 Oct 2026 08:58:13 -0700 Subject: [PATCH 1/2] feat: add optional Gateway API HTTPRoute for nginx Add httpRoute.* values that render a gateway.networking.k8s.io/v1 HTTPRoute pointing at the nginx service, as an alternative to the Ingress. Signed-off-by: Srinivas Chippagiri --- CHANGELOG.md | 1 + README.md | 7 ++++++ templates/nginx/nginx-httproute.yaml | 37 ++++++++++++++++++++++++++++ values.yaml | 24 ++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 templates/nginx/nginx-httproute.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 175d9ef0..230bbabd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## master / unreleased * [FEATURE] Parquet converter: allow running it as a StatefulSet with a persistent volume per pod #685 +* [FEATURE] Add optional Gateway API `HTTPRoute` for the nginx service (`httpRoute.*`) as an alternative to `ingress` #PR * [ENHANCEMENT] Expose `nginx.config.client_body_buffer_size` to set the nginx `client_body_buffer_size` #350 * [DEPENDENCY] Update Helm release rollout-operator to v0.53.1 #683 * [DEPENDENCY] Update prom/memcached-exporter Docker tag to v0.18.0 #684 diff --git a/README.md b/README.md index 6ca543db..35642a6f 100644 --- a/README.md +++ b/README.md @@ -319,6 +319,13 @@ Kubernetes: `^1.19.0-0` | distributor.​topologySpreadConstraints | list | `[]` | | | externalConfigSecretName | string | `"secret-with-config.yaml"` | | | externalConfigVersion | string | `"0"` | | +| httpRoute.​annotations | object | `{}` | Annotations for the HTTPRoute | +| httpRoute.​enabled | bool | `false` | Create an HTTPRoute for the nginx service | +| httpRoute.​filters | list | `[]` | Filters of the route rule | +| httpRoute.​hostnames | list | `[]` | Hostnames matched by the HTTPRoute (templated) | +| httpRoute.​labels | object | `{}` | Extra labels for the HTTPRoute | +| httpRoute.​matches | list | `[{"path":{"type":"PathPrefix","value":"/"}}]` | Request matches of the route rule | +| httpRoute.​parentRefs | list | `[]` | Gateways the HTTPRoute attaches to | | image.​pullPolicy | string | `"IfNotPresent"` | | | image.​pullSecrets | list | `[]` | Optionally specify an array of imagePullSecrets. Secrets must be manually created in the namespace. ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ | | image.​repository | string | `"quay.io/cortexproject/cortex"` | | diff --git a/templates/nginx/nginx-httproute.yaml b/templates/nginx/nginx-httproute.yaml new file mode 100644 index 00000000..90e86d50 --- /dev/null +++ b/templates/nginx/nginx-httproute.yaml @@ -0,0 +1,37 @@ +{{- if and .Values.httpRoute.enabled .Values.nginx.enabled -}} +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: {{ include "cortex.nginxFullname" . }} + namespace: {{ .Release.Namespace }} + labels: + {{- include "cortex.nginxLabels" . | nindent 4 }} + {{- with .Values.httpRoute.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.httpRoute.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- with .Values.httpRoute.parentRefs }} + parentRefs: + {{- toYaml . | nindent 4 }} + {{- end }} + {{- with .Values.httpRoute.hostnames }} + hostnames: + {{- tpl (toYaml .) $ | nindent 4 }} + {{- end }} + rules: + - backendRefs: + - name: {{ include "cortex.nginxFullname" . }} + port: {{ .Values.nginx.service.port | default .Values.nginx.http_listen_port }} + {{- with .Values.httpRoute.matches }} + matches: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.httpRoute.filters }} + filters: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/values.yaml b/values.yaml index ba8b32fc..4626bb05 100644 --- a/values.yaml +++ b/values.yaml @@ -24,6 +24,30 @@ ingress: - / tls: [] +# Gateway API HTTPRoute that routes traffic to the nginx service, as an alternative to `ingress`. +# Requires the Gateway API CRDs (v1) in the cluster. +httpRoute: + # -- Create an HTTPRoute for the nginx service + enabled: false + # -- Annotations for the HTTPRoute + annotations: {} + # -- Extra labels for the HTTPRoute + labels: {} + # -- Gateways the HTTPRoute attaches to + parentRefs: [] + # - name: my-gateway + # namespace: gateway-system + # sectionName: https + # -- Hostnames matched by the HTTPRoute (templated) + hostnames: [] + # -- Request matches of the route rule + matches: + - path: + type: PathPrefix + value: / + # -- Filters of the route rule + filters: [] + serviceAccount: create: true name: From 869b4328018522d68046d251dad44517eeea9cb5 Mon Sep 17 00:00:00 2001 From: Srinivas Chippagiri Date: Wed, 28 Oct 2026 08:58:26 -0700 Subject: [PATCH 2/2] docs: set changelog PR number Signed-off-by: Srinivas Chippagiri --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 230bbabd..b7902898 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## master / unreleased * [FEATURE] Parquet converter: allow running it as a StatefulSet with a persistent volume per pod #685 -* [FEATURE] Add optional Gateway API `HTTPRoute` for the nginx service (`httpRoute.*`) as an alternative to `ingress` #PR +* [FEATURE] Add optional Gateway API `HTTPRoute` for the nginx service (`httpRoute.*`) as an alternative to `ingress` #689 * [ENHANCEMENT] Expose `nginx.config.client_body_buffer_size` to set the nginx `client_body_buffer_size` #350 * [DEPENDENCY] Update Helm release rollout-operator to v0.53.1 #683 * [DEPENDENCY] Update prom/memcached-exporter Docker tag to v0.18.0 #684