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
26 changes: 26 additions & 0 deletions examples/ingress/ingress.values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Using coder with ingress in versions from 1.21 and newer
# Coder's built-in ingress controller is no longer packaged
# the coderd pod does not require a fanout so it is exposed
# by creating a LoadBalancer service
coderd:
serviceNext: true
devurlsHost: '*.devurls.coderhost.com'
serviceSpec:
type: ClusterIP
# The values.yaml file in the chart includes LoadBalancer
# specs which need to have the keys removed using null
# this does not work as a sub-chart
loadBalancerIP: null
externalTrafficPolicy: null
loadBalancerSourceRanges: null
# Add the ingress values section to enable the ingress resource
# without the controller
ingress:
# Enable set to true creates the ingress resource
enable: true
# Ingress needs a host name so it can share a controller
host: 'coder.coderhost.com'
# useDefault set to false disables creation of the ingress controller
useDefault: false
# add annotations for TLS issuers and such
annotations: {}
Copy link

Choose a reason for hiding this comment

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

not mandatory but would be nice to modify the OpenShift one to add an example that creates an OpenShift Route (it needs some different annotations)

https://docs.okd.io/latest/networking/routes/route-configuration.html#nw-ingress-creating-a-route-via-an-ingress_route-configuration

35 changes: 35 additions & 0 deletions templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -409,3 +409,38 @@ spec:
{{- end }}
{{- end }}
---
{{- if and (merge .Values dict | dig "coderd" "serviceNext" true) (merge .Values dict | dig "ingress" "enable" true) }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: coderd-ingress
namespace: {{ .Release.Namespace | quote }}
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: "0"
Copy link

Choose a reason for hiding this comment

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

I think this can be put in the default values file, then we can make all of the annotations configurable, similar to how we do it with securityContext: https://github.com/cdr/enterprise-helm/blob/e158a751b9a1c3198adff2c08b4a5f50c1e33fdf/templates/coderd.yaml#L36-L42

right now there's no way to clear the nginx.ingress.kubernetes.io/proxy-body-size annotation here

FWIW, I think this resolves: https://app.clubhouse.io/coder/story/14644/route-traffic-to-coderd-using-ingress -- thank you!

{{- range $key, $value := merge .Values dict | dig "ingress" "annotations" dict }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- include "coder.ingress.tls" . }}
rules:
Copy link

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Default backend is supposed to be on the controller rather than the ingress resources (by convention)... this choice was deliberate.

Copy link

Choose a reason for hiding this comment

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

@mterhar TIL! Do you have a link to learn about this convention?

- host: {{ merge .Values dict | dig "ingress" "host" "" | quote }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ include "coder.serviceName" . }}
port:
number: 80
- host: {{ merge .Values dict | dig "coderd" "devurlsHost" "" | quote }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: {{ include "coder.serviceName" . }}
port:
number: 80
{{- end }}