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
59 changes: 59 additions & 0 deletions helm-chart/binderhub/schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,65 @@ properties:
description: |
TODO

httpRoute:
type: object
required:
- enabled
properties:
enabled:
type: boolean
description: |
Enable the creation of a Gateway API HTTPRoute referencing incoming
network network traffic to the binder k8s Service.
annotations:
type: object
additionalProperties: false
patternProperties: *labels-and-annotations-patternProperties
description: |
Annotations to apply to the HTTPRoute resource.

See [the Kubernetes
documentation](https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/)
for more details about annotations.
hostnames:
type: array
description: |
List of hostnames to route requests to the proxy.
filters:
type: array
description: |
List of HTTPRoute filters.

See [the Gateway API](https://gateway-api.sigs.k8s.io/reference/spec/#httproutefilter)
matches:
type: array
description: |
List of HTTPRoute matches to apply.

Default:

```yaml
- path:
type: PathPrefix
value: /
```

See [the Gateway API](https://gateway-api.sigs.k8s.io/reference/spec/#httproutematch)
parentRefs:
type: array
description: |
List of HTTPRoute parentRefs, identifying the Gateway to use.

Typically:

```yaml
- kind: Gateway
name: your-gateway
namespace: other-namespace # if gateway is in a separate namespace
```

See [the Gateway API](https://gateway-api.sigs.k8s.io/reference/spec/#parentreference)

ingress:
type: object
additionalProperties: false
Expand Down
37 changes: 37 additions & 0 deletions helm-chart/binderhub/templates/httproute.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{- $route := .Values.httpRoute }}
{{- if $route.enabled }}
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: {{ include "fullname" . }}
{{- with $route.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- with $route.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with $route.parentRefs }}
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.

I appreciate this naming over z2jh's current naming that references a gateway instead of parentRefs, considering if we should align z2jh with this

Copy link
Copy Markdown
Member

@manics manics Jan 28, 2026

Choose a reason for hiding this comment

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

I had that thought too! The current Z2JH values have already been released though, so it would either be a breaking change, or require more complicated logic to provide backwards compatibility.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, I should have commented my reasoning here. This is based on having done a deployment with jupyterhub and prometheus/grafana, and I like the prometheus/grafana approach better, since it is a more straightforward passthrough of the specs.

Theirs do expose much more of the route to allow for other Gateway API versions, route types, rules, but I thought that was overkill for us for now, so this is a bit in between theirs and the one in z2jh.

parentRefs:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with $route.hostnames }}
hostnames:
{{- . | toYaml | nindent 4 }}
{{- end }}
rules:
- backendRefs:
- name: binder
port: 80
{{- with $route.filters }}
filters:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $route.matches }}
matches:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
11 changes: 11 additions & 0 deletions helm-chart/binderhub/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,17 @@ imageCleaner:
dockerSocketName: docker.sock
dockerLibDir: /var/lib/docker

httpRoute:
enabled: false
annotations: {}
hostnames: []
parentRefs: []
filters: []
matches:
- path:
type: PathPrefix
value: /

ingress:
enabled: false
https:
Expand Down
Loading