diff --git a/helm/coder/templates/httproute.yaml b/helm/coder/templates/httproute.yaml new file mode 100644 index 0000000000..fb4c967c41 --- /dev/null +++ b/helm/coder/templates/httproute.yaml @@ -0,0 +1,27 @@ +{{- if .Values.coder.httproute.enable }} +--- +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: coder + namespace: {{ .Release.Namespace }} + labels: + {{- include "coder.labels" . | nindent 4 }} + annotations: + {{- toYaml .Values.coder.httproute.annotations | nindent 4 }} +spec: + parentRefs: + {{- with .Values.coder.httproute.parentRefs }} + {{- toYaml . | nindent 4 }} + {{- end }} + rules: + - backendRefs: + - name: coder + # gateway api does not support named ports + port: 80 + hostnames: + - {{ .Values.coder.httproute.host | quote }} + {{- with .Values.coder.httproute.wildcardHost }} + - {{ . | quote }} + {{- end }} +{{- end }} diff --git a/helm/coder/values.yaml b/helm/coder/values.yaml index a994db1157..8c3c58b3ff 100644 --- a/helm/coder/values.yaml +++ b/helm/coder/values.yaml @@ -429,6 +429,31 @@ coder: # use for the wildcard host. wildcardSecretName: "" + # coder.httproute -- The HTTPRoute object to expose for Coder. + httproute: + # coder.httproute.enable -- Whether to create the HTTPRoute object. If using a + # Gateway, we recommend not specifying coder.tls.secretNames as the Gateway + # will handle TLS termination. + enable: false + # coder.httproute.parentRefs -- the parentRefs to bind the route to + # - name: my-gw + # namespace: gateway-namespace + # # sectionName is optional to fix to a specific listener + # sectionName: listener-name + parentRefs: [] + # coder.httproute.host -- The hostname to match on. + # Be sure to also set CODER_ACCESS_URL within coder.env[] + host: "" + # coder.httproute.wildcardHost -- The wildcard hostname to match on. Should be + # in the form "*.example.com" or "*-suffix.example.com". If you are using a + # suffix after the wildcard, the suffix will be stripped from the created + # ingress to ensure that it is a legal ingress host. Optional if not using + # applications over subdomains. + # Be sure to also set CODER_WILDCARD_ACCESS_URL within coder.env[] + wildcardHost: "" + # coder.httproute.annotations -- The HTTPRoute annotations. + annotations: {} + # coder.command -- The command to use when running the Coder container. Used # for customizing the location of the `coder` binary in your image. command: