Skip to content

Commit 6fd5344

Browse files
ffaisericpaulsen
andauthored
feat: add support for NodePort service type in Helm chart (#8993)
* add support for NodePort service type in Helm chart * fix nodeport values * formatting & make update-golden-files * update-golden-files --------- Co-authored-by: Eric <ericpaulsen@coder.com>
1 parent a2d64c0 commit 6fd5344

File tree

10 files changed

+21
-0
lines changed

10 files changed

+21
-0
lines changed

helm/coder/templates/service.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@ spec:
1616
port: 80
1717
targetPort: "http"
1818
protocol: TCP
19+
{{ if eq .Values.coder.service.type "NodePort" }}
20+
nodePort: {{ .Values.coder.service.httpNodePort }}
21+
{{ end }}
1922
{{- if eq (include "coder.tlsEnabled" .) "true" }}
2023
- name: "https"
2124
port: 443
2225
targetPort: "https"
2326
protocol: TCP
27+
{{ if eq .Values.coder.service.type "NodePort" }}
28+
nodePort: {{ .Values.coder.service.httpsNodePort }}
29+
{{ end }}
2430
{{- end }}
2531
{{- if eq "LoadBalancer" .Values.coder.service.type }}
2632
{{- with .Values.coder.service.loadBalancerIP }}

helm/coder/tests/testdata/command.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ spec:
9090
port: 80
9191
targetPort: "http"
9292
protocol: TCP
93+
9394
externalTrafficPolicy: "Cluster"
9495
selector:
9596
app.kubernetes.io/name: coder

helm/coder/tests/testdata/command_args.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ spec:
9090
port: 80
9191
targetPort: "http"
9292
protocol: TCP
93+
9394
externalTrafficPolicy: "Cluster"
9495
selector:
9596
app.kubernetes.io/name: coder

helm/coder/tests/testdata/default_values.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ spec:
9090
port: 80
9191
targetPort: "http"
9292
protocol: TCP
93+
9394
externalTrafficPolicy: "Cluster"
9495
selector:
9596
app.kubernetes.io/name: coder

helm/coder/tests/testdata/labels_annotations.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ spec:
9090
port: 80
9191
targetPort: "http"
9292
protocol: TCP
93+
9394
externalTrafficPolicy: "Cluster"
9495
selector:
9596
app.kubernetes.io/name: coder

helm/coder/tests/testdata/provisionerd_psk.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ spec:
9090
port: 80
9191
targetPort: "http"
9292
protocol: TCP
93+
9394
externalTrafficPolicy: "Cluster"
9495
selector:
9596
app.kubernetes.io/name: coder

helm/coder/tests/testdata/sa.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ spec:
9191
port: 80
9292
targetPort: "http"
9393
protocol: TCP
94+
9495
externalTrafficPolicy: "Cluster"
9596
selector:
9697
app.kubernetes.io/name: coder

helm/coder/tests/testdata/tls.golden

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,12 @@ spec:
9090
port: 80
9191
targetPort: "http"
9292
protocol: TCP
93+
9394
- name: "https"
9495
port: 443
9596
targetPort: "https"
9697
protocol: TCP
98+
9799
externalTrafficPolicy: "Cluster"
98100
selector:
99101
app.kubernetes.io/name: coder

helm/coder/tests/testdata/workspace_proxy.golden

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ spec:
9090
port: 80
9191
targetPort: "http"
9292
protocol: TCP
93+
9394
externalTrafficPolicy: "Cluster"
9495
selector:
9596
app.kubernetes.io/name: coder

helm/coder/values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,12 @@ coder:
241241
# coder.service.annotations -- The service annotations. See:
242242
# https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
243243
annotations: {}
244+
# coder.service.httpNodePort -- Enabled if coder.service.type is set to NodePort.
245+
# If not set, Kubernetes will allocate a port from the default range, 30000-32767.
246+
httpNodePort: ""
247+
# coder.service.httpsNodePort -- Enabled if coder.service.type is set to NodePort.
248+
# If not set, Kubernetes will allocate a port from the default range, 30000-32767.
249+
httpsNodePort: ""
244250

245251
# coder.ingress -- The Ingress object to expose for Coder.
246252
ingress:

0 commit comments

Comments
 (0)