Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions charts/netdata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,60 @@ See values.yaml for defaults
</td>
<td>URL hostnames for the ingress (they need to resolve to the external IP of the ingress controller)</td>
</tr>
<tr>
<td>httpRoute.enabled</td>
<td>bool</td>
<td><pre lang="json">
false
</pre>
</td>
<td>Create HTTPRoute to access the netdata web UI via Gateway API</td>
</tr>
<tr>
<td>httpRoute.annotations</td>
<td>object</td>
<td><pre lang="json">
{}
</pre>
</td>
<td>Additional annotations to add to the HTTPRoute</td>
</tr>
<tr>
<td>httpRoute.labels</td>
<td>object</td>
<td><pre lang="json">
{}
</pre>
</td>
<td>Additional labels to add to the HTTPRoute</td>
</tr>
<tr>
<td>httpRoute.parentRefs</td>
<td>list</td>
<td><pre lang="json">
[]
</pre>
</td>
<td>Parent references for Gateway API HTTPRoute. Required when `httpRoute.enabled=true`</td>
</tr>
<tr>
<td>httpRoute.hostnames</td>
<td>list</td>
<td><pre lang="json">
[]
</pre>
</td>
<td>Hostnames for the HTTPRoute</td>
</tr>
<tr>
<td>httpRoute.rules</td>
<td>list</td>
<td><pre lang="json">
[]
</pre>
</td>
<td>Optional explicit HTTPRoute rules. If empty, a default PathPrefix `/` rule is generated</td>
</tr>
<tr>
<td>rbac.create</td>
<td>bool</td>
Expand Down
41 changes: 41 additions & 0 deletions charts/netdata/templates/parent/httproute.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if and .Values.parent.enabled .Values.httpRoute.enabled -}}
{{- $fullName := include "netdata.name" . -}}
{{- $svcPort := .Values.service.port -}}

apiVersion: gateway.networking.k8s.io/v1
Comment on lines +4 to +5
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apiVersion is hard-coded to gateway.networking.k8s.io/v1, which will make httpRoute.enabled=true fail to install on clusters that only have HTTPRoute served as v1beta1 (common depending on the installed Gateway API CRDs). Consider selecting the apiVersion based on .Capabilities.APIVersions.Has (or making it configurable via Values.httpRoute.apiVersion) similar to how the chart handles Ingress apiVersion selection.

Suggested change
apiVersion: gateway.networking.k8s.io/v1
{{- $httpRouteApiVersion := "gateway.networking.k8s.io/v1" -}}
{{- if not (.Capabilities.APIVersions.Has "gateway.networking.k8s.io/v1/HTTPRoute") -}}
{{- if .Capabilities.APIVersions.Has "gateway.networking.k8s.io/v1beta1/HTTPRoute" -}}
{{- $httpRouteApiVersion = "gateway.networking.k8s.io/v1beta1" -}}
{{- end -}}
{{- end -}}
apiVersion: {{ $httpRouteApiVersion }}

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The concern is technically valid but has a low practical impact in 2026. Gateway API v1 (HTTPRoute GA) shipped in October 2023 (over 2.5 years ago).

kind: HTTPRoute
metadata:
name: {{ $fullName }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "netdata.name" . }}
chart: {{ template "netdata.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.httpRoute.labels }}
{{ toYaml . | indent 4 }}
{{- end }}
{{- with .Values.httpRoute.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
parentRefs:
{{ required "A valid .Values.httpRoute.parentRefs entry is required when httpRoute.enabled is true" .Values.httpRoute.parentRefs | toYaml | indent 4 }}
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The required message says “.Values.httpRoute.parentRefs entry”, but parentRefs is a list. Consider clarifying the message to indicate a non-empty list / at least one parentRef is required.

Suggested change
{{ required "A valid .Values.httpRoute.parentRefs entry is required when httpRoute.enabled is true" .Values.httpRoute.parentRefs | toYaml | indent 4 }}
{{ required "A non-empty .Values.httpRoute.parentRefs list with at least one parentRef is required when httpRoute.enabled is true" .Values.httpRoute.parentRefs | toYaml | indent 4 }}

Copilot uses AI. Check for mistakes.
{{- with .Values.httpRoute.hostnames }}
hostnames:
{{ toYaml . | indent 4 }}
{{- end }}
rules:
{{- if .Values.httpRoute.rules }}
{{ toYaml .Values.httpRoute.rules | indent 4 }}
{{- else }}
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: {{ $fullName }}
port: {{ $svcPort }}
{{- end }}
{{- end }}
20 changes: 20 additions & 0 deletions charts/netdata/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,26 @@ ingress:
# hosts:
# - netdata.k8s.local

httpRoute:
# -- Create HTTPRoute to access the netdata web UI via Gateway API
# @section -- General settings
enabled: false
# -- Additional annotations to add to the HTTPRoute
# @section -- General settings
annotations: {}
# -- Additional labels to add to the HTTPRoute
# @section -- General settings
labels: {}
# -- Parent references for Gateway API HTTPRoute. Required when `httpRoute.enabled=true`
# @section -- General settings
parentRefs: []
# -- Hostnames for the HTTPRoute
# @section -- General settings
hostnames: []
# -- Optional explicit HTTPRoute rules. If empty, a default PathPrefix `/` rule is generated
# @section -- General settings
rules: []

rbac:
# -- if true, create & use RBAC resources
# @section -- General settings
Expand Down
Loading