-
Notifications
You must be signed in to change notification settings - Fork 17
add example for custom ingress #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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: {} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggest we add a defaultBackend too: https://kubernetes.io/docs/concepts/services-networking/ingress/#default-backend
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 }} | ||
There was a problem hiding this comment.
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