Skip to content

Commit 0130245

Browse files
lexfreiclaude
andcommitted
Add Gateway API HTTPRoute support to Helm chart
Add HTTPRoute template as alternative to Ingress for exposing Kubernetes Dashboard via Gateway API. Kong proxy service is used as backend, maintaining compatibility with current architecture. Features: - HTTPRoute template with Gateway API v1 - Configuration via values.yaml app.httproute section - Dynamic Kong proxy port selection (TLS/HTTP) - Support for custom parentRefs, hostnames, and rules - Compatible with existing Ingress configuration Tested with Cilium Gateway Controller in local cluster. HTTPRoute successfully created and accepted by gateway controller. Fixes #10384 Signed-off-by: Aleksei Sviridkin <[email protected]> Co-Authored-By: Claude <[email protected]>
1 parent 2f3f7b0 commit 0130245

File tree

3 files changed

+98
-1
lines changed

3 files changed

+98
-1
lines changed

charts/kubernetes-dashboard/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
apiVersion: v2
1616
name: kubernetes-dashboard
17-
version: 7.13.0
17+
version: 7.14.0
1818
description: General-purpose web UI for Kubernetes clusters
1919
keywords:
2020
- kubernetes
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Copyright 2025 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
{{- if and .Values.app.httproute.enabled (eq .Values.app.mode "dashboard")}}
16+
17+
# Determine the service port to use for the HTTPRoute configuration
18+
# If TLS is enabled in the HTTPRoute configuration, use the TLS service port.
19+
# Otherwise, fall back to the HTTP service port.
20+
{{- $servicePort := (ternary 443 80 .Values.app.httproute.tls.enabled) }}
21+
22+
apiVersion: gateway.networking.k8s.io/v1
23+
kind: HTTPRoute
24+
metadata:
25+
name: {{ template "kubernetes-dashboard.name" . }}
26+
labels:
27+
{{- include "kubernetes-dashboard.labels" . | nindent 4 }}
28+
{{- with .Values.app.httproute.labels }}
29+
{{- toYaml . | nindent 4 }}
30+
{{- end }}
31+
annotations:
32+
{{- include "kubernetes-dashboard.annotations" . | nindent 4 }}
33+
{{- with .Values.app.httproute.annotations }}
34+
{{- toYaml . | nindent 4 }}
35+
{{- end }}
36+
spec:
37+
{{- with .Values.app.httproute.parentRefs }}
38+
parentRefs:
39+
{{- toYaml . | nindent 4 }}
40+
{{- end }}
41+
{{- with .Values.app.httproute.hostnames }}
42+
hostnames:
43+
{{- toYaml . | nindent 4 }}
44+
{{- end }}
45+
rules:
46+
{{- range .Values.app.httproute.rules }}
47+
- {{- with .matches }}
48+
matches:
49+
{{- toYaml . | nindent 8 }}
50+
{{- end }}
51+
{{- with .filters }}
52+
filters:
53+
{{- toYaml . | nindent 8 }}
54+
{{- end }}
55+
backendRefs:
56+
- name: {{ template "kong.fullname" (index $.Subcharts "kong") }}-proxy
57+
port: {{ $servicePort }}
58+
weight: 1
59+
{{- end }}
60+
{{- end }}

charts/kubernetes-dashboard/values.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,43 @@ app:
135135
secretName: ""
136136
labels: {}
137137
annotations: {}
138+
139+
# Gateway API HTTPRoute configuration
140+
# NOTE: Requires Gateway API CRDs (v1) installed in cluster
141+
# https://gateway-api.sigs.k8s.io/guides/getting-started/
142+
httproute:
143+
# Enable HTTPRoute resource (alternative to Ingress)
144+
enabled: false
145+
# Additional HTTPRoute labels
146+
labels: {}
147+
# Additional HTTPRoute annotations
148+
annotations: {}
149+
# Gateway references
150+
# Must reference an existing Gateway resource
151+
parentRefs: []
152+
# - name: example-gateway
153+
# namespace: gateway-system
154+
# sectionName: https
155+
# List of hostnames
156+
hostnames: []
157+
# - dashboard.example.com
158+
# HTTPRoute rules
159+
rules:
160+
- matches:
161+
- path:
162+
type: PathPrefix
163+
value: /
164+
# Optional filters:
165+
# filters:
166+
# - type: RequestHeaderModifier
167+
# requestHeaderModifier:
168+
# add:
169+
# - name: X-Custom-Header
170+
# value: value
171+
# TLS configuration (determines Kong proxy port: 443 for TLS, 80 for HTTP)
172+
tls:
173+
enabled: true
174+
138175
# Use the following toleration if Dashboard can be deployed on a tainted control-plane nodes
139176
# - key: node-role.kubernetes.io/control-plane
140177
# effect: NoSchedule

0 commit comments

Comments
 (0)