diff --git a/helm-chart/binderhub/schema.yaml b/helm-chart/binderhub/schema.yaml index a79e1ed52..3478b4dae 100644 --- a/helm-chart/binderhub/schema.yaml +++ b/helm-chart/binderhub/schema.yaml @@ -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 diff --git a/helm-chart/binderhub/templates/httproute.yaml b/helm-chart/binderhub/templates/httproute.yaml new file mode 100644 index 000000000..0ec3b813d --- /dev/null +++ b/helm-chart/binderhub/templates/httproute.yaml @@ -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 }} + 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 }} diff --git a/helm-chart/binderhub/values.yaml b/helm-chart/binderhub/values.yaml index ebff78d5c..c1bd677dd 100644 --- a/helm-chart/binderhub/values.yaml +++ b/helm-chart/binderhub/values.yaml @@ -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: