Skip to content

Commit 57f4cb4

Browse files
authored
feat(helm): add Gateway API HTTPRoute support to the burrito-server (#927)
* feat(helm): add Gateway API HTTPRoute support to the burrito-server * feat(helm): add Gateway API HTTPRoute for the burrito-controllers metrics endpoint * fix(helm): reference named service port in HTTPRoute backendRef to match ingress
1 parent a1e951b commit 57f4cb4

4 files changed

Lines changed: 126 additions & 0 deletions

File tree

deploy/charts/burrito/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ A Helm chart for handling a complete burrito deployment
5252
| controllers.deployment.podAnnotations | object | `{"kubectl.kubernetes.io/default-container":"burrito"}` | Annotations to be added to the pods generated by the Burrito controller deployment |
5353
| controllers.deployment.readinessProbe | object | `{"httpGet":{"path":"/readyz","port":8081},"initialDelaySeconds":5,"periodSeconds":20}` | Controller readiness probe configuration |
5454
| controllers.metadata | object | `{"labels":{"app.kubernetes.io/component":"controllers","app.kubernetes.io/name":"burrito-controllers"}}` | Metadata configuration for the Burrito controller |
55+
| controllers.metricsHttproute.apiVersion | string | `"gateway.networking.k8s.io/v1"` | Gateway API version to use for the Burrito controller metrics HTTPRoute |
56+
| controllers.metricsHttproute.enabled | bool | `false` | Enable/Disable Gateway API HTTPRoute creation for the Burrito controller metrics endpoint (requires the Gateway API CRDs and controllers.service enabled) |
57+
| controllers.metricsHttproute.hostnames | list | `[]` | Hostnames the HTTPRoute matches. Defaults to the controller metrics ingress host when left empty |
58+
| controllers.metricsHttproute.metadata | object | `{"annotations":{},"labels":{}}` | Metadata configuration for the Burrito controller metrics HTTPRoute |
59+
| controllers.metricsHttproute.parentRefs | list | `[]` | Gateways the HTTPRoute attaches to (required when metricsHttproute is enabled). Each entry follows the Gateway API parentRef schema (name, optionally namespace/sectionName) |
60+
| controllers.metricsHttproute.rules | list | `[]` | HTTPRoute rules. Defaults to a single rule routing "/" (PathPrefix) to the burrito-controllers service when left empty |
5561
| controllers.service.enabled | bool | `false` | Enable/Disable service creation for the Burrito controller |
5662
| datastore.deployment.args | list | `["datastore","start"]` | Arguments to pass to the Burrito datastore container |
5763
| datastore.deployment.command | list | `["burrito"]` | Command to run in the Burrito datastore container |
@@ -116,6 +122,12 @@ A Helm chart for handling a complete burrito deployment
116122
| server.deployment.podAnnotations | object | `{"kubectl.kubernetes.io/default-container":"burrito"}` | Annotations to be added to the pods generated by the Burrito server deployment |
117123
| server.deployment.ports | list | `[{"containerPort":8080,"name":"http"}]` | Server exposed port |
118124
| server.deployment.readinessProbe | object | `{"httpGet":{"path":"/healthz","port":8080},"initialDelaySeconds":5,"periodSeconds":20}` | Server readiness probe configuration |
125+
| server.httproute.apiVersion | string | `"gateway.networking.k8s.io/v1"` | Gateway API version to use for the Burrito server HTTPRoute |
126+
| server.httproute.enabled | bool | `false` | Enable/Disable Gateway API HTTPRoute creation for the Burrito server (requires the Gateway API CRDs and server.service enabled) |
127+
| server.httproute.hostnames | list | `[]` | Hostnames the HTTPRoute matches. Defaults to the server ingress host when left empty |
128+
| server.httproute.metadata | object | `{"annotations":{},"labels":{}}` | Metadata configuration for the Burrito server HTTPRoute |
129+
| server.httproute.parentRefs | list | `[]` | Gateways the HTTPRoute attaches to (required when httproute is enabled). Each entry follows the Gateway API parentRef schema (name, optionally namespace/sectionName) |
130+
| server.httproute.rules | list | `[]` | HTTPRoute rules. Defaults to a single rule routing "/" (PathPrefix) to the burrito-server service when left empty |
119131
| server.ingress | object | `{"annotations":{},"enabled":false,"host":"burrito.example.com","ingressClassName":"nginx","tls":[]}` | Ingress configuration for the Burrito server |
120132
| server.ingress.annotations | object | `{}` | Annotations to be added to the Burrito server ingress |
121133
| server.ingress.enabled | bool | `false` | Enable/Disable ingress creation for the Burrito server |

deploy/charts/burrito/templates/controllers.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,45 @@ spec:
190190
tls:
191191
{{- toYaml .metricsIngress.tls | nindent 4 }}
192192
{{- end }}
193+
{{- if .metricsHttproute.enabled }}
194+
{{- if not .metricsHttproute.parentRefs }}
195+
{{- fail "controllers.metricsHttproute.enabled is set but controllers.metricsHttproute.parentRefs is empty: at least one parentRef (Gateway) is required" }}
196+
{{- end }}
197+
---
198+
apiVersion: {{ .metricsHttproute.apiVersion | default "gateway.networking.k8s.io/v1" }}
199+
kind: HTTPRoute
200+
metadata:
201+
name: burrito-controllers-metrics
202+
{{- with mergeOverwrite (deepCopy .metadata) .metricsHttproute.metadata }}
203+
labels:
204+
{{- toYaml .labels | nindent 4}}
205+
annotations:
206+
{{- toYaml .annotations | nindent 4}}
207+
{{- end }}
208+
spec:
209+
parentRefs:
210+
{{- toYaml .metricsHttproute.parentRefs | nindent 4 }}
211+
{{- with .metricsHttproute.hostnames | default (list .metricsIngress.host) }}
212+
hostnames:
213+
{{- toYaml . | nindent 4 }}
214+
{{- end }}
215+
rules:
216+
{{- with .metricsHttproute.rules }}
217+
{{- toYaml . | nindent 4 }}
218+
{{- else }}
219+
- matches:
220+
- path:
221+
type: PathPrefix
222+
value: /
223+
backendRefs:
224+
- name: burrito-controllers
225+
{{- range .service.ports }}
226+
{{- if eq .name "metrics" }}
227+
port: {{ .port }}
228+
{{- end }}
229+
{{- end }}
230+
{{- end }}
231+
{{- end }}
193232
---
194233
apiVersion: v1
195234
kind: ServiceAccount

deploy/charts/burrito/templates/server.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,45 @@ spec:
167167
tls:
168168
{{- toYaml .ingress.tls | nindent 4 }}
169169
{{- end }}
170+
{{- if .httproute.enabled }}
171+
{{- if not .httproute.parentRefs }}
172+
{{- fail "server.httproute.enabled is set but server.httproute.parentRefs is empty: at least one parentRef (Gateway) is required" }}
173+
{{- end }}
174+
---
175+
apiVersion: {{ .httproute.apiVersion | default "gateway.networking.k8s.io/v1" }}
176+
kind: HTTPRoute
177+
metadata:
178+
name: burrito-server
179+
{{- with mergeOverwrite (deepCopy .metadata) .httproute.metadata }}
180+
labels:
181+
{{- toYaml .labels | nindent 4}}
182+
annotations:
183+
{{- toYaml .annotations | nindent 4}}
184+
{{- end }}
185+
spec:
186+
parentRefs:
187+
{{- toYaml .httproute.parentRefs | nindent 4 }}
188+
{{- with .httproute.hostnames | default (list .ingress.host) }}
189+
hostnames:
190+
{{- toYaml . | nindent 4 }}
191+
{{- end }}
192+
rules:
193+
{{- with .httproute.rules }}
194+
{{- toYaml . | nindent 4 }}
195+
{{- else }}
196+
- matches:
197+
- path:
198+
type: PathPrefix
199+
value: /
200+
backendRefs:
201+
- name: burrito-server
202+
{{- range .service.ports }}
203+
{{- if eq .name "http" }}
204+
port: {{ .port }}
205+
{{- end }}
206+
{{- end }}
207+
{{- end }}
208+
{{- end }}
170209
---
171210
apiVersion: v1
172211
kind: ServiceAccount

deploy/charts/burrito/values.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,24 @@ controllers:
409409
host: burrito-controllers.example.com
410410
# -- TLS configuration for the Burrito controller metrics ingress
411411
tls: []
412+
metricsHttproute:
413+
# -- Enable/Disable Gateway API HTTPRoute creation for the Burrito controller metrics endpoint (requires the Gateway API CRDs and controllers.service enabled)
414+
enabled: false
415+
# -- Metadata configuration for the Burrito controller metrics HTTPRoute
416+
metadata:
417+
labels: {}
418+
annotations: {}
419+
# -- Gateway API version to use for the Burrito controller metrics HTTPRoute
420+
apiVersion: gateway.networking.k8s.io/v1
421+
# -- Gateways the HTTPRoute attaches to (required when metricsHttproute is enabled). Each entry follows the Gateway API parentRef schema (name, optionally namespace/sectionName)
422+
parentRefs: []
423+
# - name: my-gateway
424+
# namespace: gateway-system
425+
# sectionName: https
426+
# -- Hostnames the HTTPRoute matches. Defaults to the controller metrics ingress host when left empty
427+
hostnames: []
428+
# -- HTTPRoute rules. Defaults to a single rule routing "/" (PathPrefix) to the burrito-controllers service when left empty
429+
rules: []
412430

413431
server:
414432
# -- Metadata configuration for the Burrito server
@@ -498,6 +516,24 @@ server:
498516
host: burrito.example.com
499517
# -- TLS configuration for the Burrito server ingress
500518
tls: []
519+
httproute:
520+
# -- Enable/Disable Gateway API HTTPRoute creation for the Burrito server (requires the Gateway API CRDs and server.service enabled)
521+
enabled: false
522+
# -- Metadata configuration for the Burrito server HTTPRoute
523+
metadata:
524+
labels: {}
525+
annotations: {}
526+
# -- Gateway API version to use for the Burrito server HTTPRoute
527+
apiVersion: gateway.networking.k8s.io/v1
528+
# -- Gateways the HTTPRoute attaches to (required when httproute is enabled). Each entry follows the Gateway API parentRef schema (name, optionally namespace/sectionName)
529+
parentRefs: []
530+
# - name: my-gateway
531+
# namespace: gateway-system
532+
# sectionName: https
533+
# -- Hostnames the HTTPRoute matches. Defaults to the server ingress host when left empty
534+
hostnames: []
535+
# -- HTTPRoute rules. Defaults to a single rule routing "/" (PathPrefix) to the burrito-server service when left empty
536+
rules: []
501537

502538
datastore:
503539
# -- Metadata configuration for the Burrito datastore

0 commit comments

Comments
 (0)