Skip to content

Commit 0c8ea6d

Browse files
authored
httproute-support (#527)
1 parent a06ea28 commit 0c8ea6d

File tree

3 files changed

+115
-0
lines changed

3 files changed

+115
-0
lines changed

charts/netdata/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,60 @@ See values.yaml for defaults
368368
</td>
369369
<td>URL hostnames for the ingress (they need to resolve to the external IP of the ingress controller)</td>
370370
</tr>
371+
<tr>
372+
<td>httpRoute.enabled</td>
373+
<td>bool</td>
374+
<td><pre lang="json">
375+
false
376+
</pre>
377+
</td>
378+
<td>Create HTTPRoute to access the netdata web UI via Gateway API</td>
379+
</tr>
380+
<tr>
381+
<td>httpRoute.annotations</td>
382+
<td>object</td>
383+
<td><pre lang="json">
384+
{}
385+
</pre>
386+
</td>
387+
<td>Additional annotations to add to the HTTPRoute</td>
388+
</tr>
389+
<tr>
390+
<td>httpRoute.labels</td>
391+
<td>object</td>
392+
<td><pre lang="json">
393+
{}
394+
</pre>
395+
</td>
396+
<td>Additional labels to add to the HTTPRoute</td>
397+
</tr>
398+
<tr>
399+
<td>httpRoute.parentRefs</td>
400+
<td>list</td>
401+
<td><pre lang="json">
402+
[]
403+
</pre>
404+
</td>
405+
<td>Parent references for Gateway API HTTPRoute. Required when `httpRoute.enabled=true`</td>
406+
</tr>
407+
<tr>
408+
<td>httpRoute.hostnames</td>
409+
<td>list</td>
410+
<td><pre lang="json">
411+
[]
412+
</pre>
413+
</td>
414+
<td>Hostnames for the HTTPRoute</td>
415+
</tr>
416+
<tr>
417+
<td>httpRoute.rules</td>
418+
<td>list</td>
419+
<td><pre lang="json">
420+
[]
421+
</pre>
422+
</td>
423+
<td>Optional explicit HTTPRoute rules. If empty, a default PathPrefix `/` rule is generated</td>
424+
</tr>
371425
<tr>
372426
<td>rbac.create</td>
373427
<td>bool</td>
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{{- if and .Values.parent.enabled .Values.httpRoute.enabled -}}
2+
{{- $fullName := include "netdata.name" . -}}
3+
{{- $svcPort := .Values.service.port -}}
4+
5+
apiVersion: gateway.networking.k8s.io/v1
6+
kind: HTTPRoute
7+
metadata:
8+
name: {{ $fullName }}
9+
namespace: {{ .Release.Namespace }}
10+
labels:
11+
app: {{ template "netdata.name" . }}
12+
chart: {{ template "netdata.chart" . }}
13+
release: {{ .Release.Name }}
14+
heritage: {{ .Release.Service }}
15+
{{- with .Values.httpRoute.labels }}
16+
{{ toYaml . | indent 4 }}
17+
{{- end }}
18+
{{- with .Values.httpRoute.annotations }}
19+
annotations:
20+
{{ toYaml . | indent 4 }}
21+
{{- end }}
22+
spec:
23+
parentRefs:
24+
{{ required "A valid .Values.httpRoute.parentRefs entry is required when httpRoute.enabled is true" .Values.httpRoute.parentRefs | toYaml | indent 4 }}
25+
{{- with .Values.httpRoute.hostnames }}
26+
hostnames:
27+
{{ toYaml . | indent 4 }}
28+
{{- end }}
29+
rules:
30+
{{- if .Values.httpRoute.rules }}
31+
{{ toYaml .Values.httpRoute.rules | indent 4 }}
32+
{{- else }}
33+
- matches:
34+
- path:
35+
type: PathPrefix
36+
value: /
37+
backendRefs:
38+
- name: {{ $fullName }}
39+
port: {{ $svcPort }}
40+
{{- end }}
41+
{{- end }}

charts/netdata/values.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,26 @@ ingress:
139139
# hosts:
140140
# - netdata.k8s.local
141141

142+
httpRoute:
143+
# -- Create HTTPRoute to access the netdata web UI via Gateway API
144+
# @section -- General settings
145+
enabled: false
146+
# -- Additional annotations to add to the HTTPRoute
147+
# @section -- General settings
148+
annotations: {}
149+
# -- Additional labels to add to the HTTPRoute
150+
# @section -- General settings
151+
labels: {}
152+
# -- Parent references for Gateway API HTTPRoute. Required when `httpRoute.enabled=true`
153+
# @section -- General settings
154+
parentRefs: []
155+
# -- Hostnames for the HTTPRoute
156+
# @section -- General settings
157+
hostnames: []
158+
# -- Optional explicit HTTPRoute rules. If empty, a default PathPrefix `/` rule is generated
159+
# @section -- General settings
160+
rules: []
161+
142162
rbac:
143163
# -- if true, create & use RBAC resources
144164
# @section -- General settings

0 commit comments

Comments
 (0)