Skip to content

Commit 5ca17c3

Browse files
bpmctdeansheather
andauthored
feat: add ingress to helm chart (#4446)
* feat: add ingress to helm chart * chore: multiple hostname support in ingress * fixup! chore: multiple hostname support in ingress Co-authored-by: Dean Sheather <dean@deansheather.com>
1 parent 3120c94 commit 5ca17c3

File tree

2 files changed

+81
-1
lines changed

2 files changed

+81
-1
lines changed

helm/templates/ingress.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
{{- if .Values.coder.ingress.enable }}
3+
---
4+
apiVersion: networking.k8s.io/v1
5+
kind: Ingress
6+
metadata:
7+
name: coder
8+
labels:
9+
{{- include "coder.labels" . | nindent 4 }}
10+
annotations:
11+
{{- toYaml .Values.coder.ingress.annotations | nindent 4 }}
12+
spec:
13+
{{- if .Values.coder.ingress.className }}
14+
{{/* If this is set to an empty string it fails validation on K8s */}}
15+
ingressClassName: {{ .Values.coder.ingress.className | quote }}
16+
{{- end }}
17+
18+
rules:
19+
- host: {{ .Values.coder.ingress.host | quote }}
20+
http:
21+
paths:
22+
- path: /
23+
pathType: Prefix
24+
backend:
25+
service:
26+
name: coder
27+
port:
28+
name: {{ include "coder.portName" . | quote }}
29+
{{- if .Values.coder.ingress.wildcardHost }}
30+
- host: {{ .Values.coder.ingress.wildcardHost | quote }}
31+
http:
32+
paths:
33+
- path: /
34+
pathType: Prefix
35+
backend:
36+
service:
37+
name: coder
38+
port:
39+
name: {{ include "coder.portName" . | quote }}
40+
{{- end }}
41+
42+
{{- if .Values.coder.ingress.tls.enable }}
43+
tls:
44+
- hosts:
45+
- {{ .Values.coder.ingress.host | quote }}
46+
secretName: {{ .Values.coder.ingress.tls.secretName | quote}}
47+
{{- if .Values.coder.ingress.tls.wildcardSecretName }}
48+
- hosts:
49+
- {{ .Values.coder.ingress.wildcardHost | quote }}
50+
secretName: {{ .Values.coder.ingress.tls.wildcardSecretName | quote}}
51+
{{- end }}
52+
{{- end }}
53+
{{- end }}

helm/values.yaml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ coder:
5959

6060
# coder.resources -- The resources to request for Coder. These are optional
6161
# and are not set by default.
62-
resources: {}
62+
resources:
63+
{}
6364
# limits:
6465
# cpu: 100m
6566
# memory: 128Mi
@@ -88,3 +89,29 @@ coder:
8889
# coder.service.annotations -- The service annotations. See:
8990
# https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
9091
annotations: {}
92+
93+
# coder.ingress -- The Ingress object to expose for Coder.
94+
ingress:
95+
# coder.ingress.enable -- Whether to create the Ingress object. If using an
96+
# Ingress, we recommend not specifying coder.tls.secretNames as the Ingress
97+
# will handle TLS termination.
98+
enable: false
99+
# coder.ingress.className -- The name of the Ingress class to use.
100+
className: ""
101+
# coder.ingress.host -- The hostname to match on.
102+
host: ""
103+
# coder.ingress.wildcardHost -- The wildcard hostname to match on. Should be
104+
# in the form "*.example.com". Optional if not using applications over
105+
# subdomains.
106+
wildcardHost: ""
107+
# coder.ingress.annotations -- The ingress annotations.
108+
annotations: {}
109+
# coder.ingress.tls -- The TLS configuration to use for the Ingress.
110+
tls:
111+
# coder.ingress.tls.enable -- Whether to enable TLS on the Ingress.
112+
enable: false
113+
# coder.ingress.tls.secretName -- The name of the TLS secret to use.
114+
secretName: ""
115+
# coder.ingress.tls.wildcardSecretName -- The name of the TLS secret to
116+
# use for the wildcard host.
117+
wildcardSecretName: ""

0 commit comments

Comments
 (0)