Skip to content

Commit 349c105

Browse files
authored
feat: Allow static NodePort (#138)
* Add nodeport to coder service
1 parent 6799d93 commit 349c105

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fmt: README.md
3838
README.md: README.md.gotmpl values.yaml
3939
@echo "--- Generating documentation"
4040
helm-docs --template-files=$<
41-
@echo -e "<!-- DO NOT EDIT. THIS IS GENERATED FROM README.md.gotmpl -->\n\n$$(cat README.md)" > README.md
41+
@echo "<!-- DO NOT EDIT. THIS IS GENERATED FROM README.md.gotmpl -->\n\n$$(cat README.md)" > README.md
4242
.PHONY: README.md
4343

4444
clean:

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ View [our docs](https://coder.com/docs/setup/installation) for detailed installa
2525
| certs | object | Certificate that will be mounted inside Coder services. | `{"secret":{"key":"","name":""}}` |
2626
| certs.secret.key | string | Key pointing to a certificate in the secret. | `""` |
2727
| certs.secret.name | string | Name of the secret. | `""` |
28-
| coderd | object | Primary service responsible for all things Coder! | `{"builtinProviderServiceAccount":{"annotations":{},"labels":{}},"devurlsHost":"","image":"","oidc":{"enableRefresh":false,"redirectOptions":{}},"podSecurityContext":{"runAsNonRoot":true,"runAsUser":1000,"seccompProfile":{"type":"RuntimeDefault"}},"replicas":1,"resources":{"limits":{"cpu":"250m","memory":"512Mi"},"requests":{"cpu":"250m","memory":"512Mi"}},"satellite":{"accessURL":"","enable":false,"primaryURL":""},"securityContext":{"allowPrivilegeEscalation":false,"readOnlyRootFilesystem":true,"seccompProfile":{"type":"RuntimeDefault"}},"serviceAnnotations":{},"serviceSpec":{"externalTrafficPolicy":"Local","loadBalancerIP":"","loadBalancerSourceRanges":[],"type":"LoadBalancer"},"superAdmin":{"passwordSecret":{"key":"password","name":""}},"tls":{"devurlsHostSecretName":"","hostSecretName":""},"trustProxyIP":false}` |
28+
| coderd | object | Primary service responsible for all things Coder! | `{"builtinProviderServiceAccount":{"annotations":{},"labels":{}},"devurlsHost":"","image":"","oidc":{"enableRefresh":false,"redirectOptions":{}},"podSecurityContext":{"runAsNonRoot":true,"runAsUser":1000,"seccompProfile":{"type":"RuntimeDefault"}},"replicas":1,"resources":{"limits":{"cpu":"250m","memory":"512Mi"},"requests":{"cpu":"250m","memory":"512Mi"}},"satellite":{"accessURL":"","enable":false,"primaryURL":""},"securityContext":{"allowPrivilegeEscalation":false,"readOnlyRootFilesystem":true,"seccompProfile":{"type":"RuntimeDefault"}},"serviceAnnotations":{},"serviceNodePorts":{"http":30080,"https":30443},"serviceSpec":{"externalTrafficPolicy":"Local","loadBalancerIP":"","loadBalancerSourceRanges":[],"type":"LoadBalancer"},"superAdmin":{"passwordSecret":{"key":"password","name":""}},"tls":{"devurlsHostSecretName":"","hostSecretName":""},"trustProxyIP":false}` |
2929
| coderd.builtinProviderServiceAccount | object | Customize the built-in Kubernetes provider service account. | `{"annotations":{},"labels":{}}` |
3030
| coderd.builtinProviderServiceAccount.annotations | object | A KV mapping of annotations. See: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ | `{}` |
3131
| coderd.builtinProviderServiceAccount.labels | object | Add labels to the service account used for the built-in provider. | `{}` |
@@ -46,6 +46,9 @@ View [our docs](https://coder.com/docs/setup/installation) for detailed installa
4646
| coderd.securityContext.readOnlyRootFilesystem | bool | Mounts the container's root filesystem as read-only. It is recommended to leave this setting enabled in production. This will override the same setting in the pod | `true` |
4747
| coderd.securityContext.seccompProfile | object | Sets the seccomp profile for the migration and runtime containers. | `{"type":"RuntimeDefault"}` |
4848
| coderd.serviceAnnotations | object | Extra annotations to apply to the coderd service. | `{}` |
49+
| coderd.serviceNodePorts | object | Allows manually setting static node ports for the coderd service. This is only helpful if static ports are required, and usually should be left alone. By default these are dynamically chosen. | `{"http":30080,"https":30443}` |
50+
| coderd.serviceNodePorts.http | int | Sets a static 'coderd' service non-TLS nodePort. This should usually be omitted. | `30080` |
51+
| coderd.serviceNodePorts.https | int | Sets a static 'coderd' service TLS nodePort This should usually be omitted. | `30443` |
4952
| coderd.serviceSpec | object | Specification to inject for the coderd service. See: https://kubernetes.io/docs/concepts/services-networking/service/ | `{"externalTrafficPolicy":"Local","loadBalancerIP":"","loadBalancerSourceRanges":[],"type":"LoadBalancer"}` |
5053
| coderd.serviceSpec.externalTrafficPolicy | string | Set the traffic policy for the service. See: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip | `"Local"` |
5154
| coderd.serviceSpec.loadBalancerIP | string | Set the external IP address of the Ingress service. | `""` |

templates/coderd.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,16 @@ spec:
254254
port: 80
255255
targetPort: 8080
256256
protocol: TCP
257+
{{ if .Values.coderd.serviceNodePorts.http }}
258+
nodePort: {{ .Values.coderd.serviceNodePorts.http }}
259+
{{ end }}
257260
- name: tcp-{{ include "coder.serviceName" . }}-https
258261
port: 443
259262
targetPort: 8443
260263
protocol: TCP
264+
{{ if .Values.coderd.serviceNodePorts.https }}
265+
nodePort: {{ .Values.coderd.serviceNodePorts.https }}
266+
{{ end }}
261267
{{- else }}
262268
---
263269
apiVersion: v1

values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ coderd:
2121
# will be restricted to the specified client IPs. This field will be ignored if
2222
# the cloud provider does not support this feature.
2323
loadBalancerSourceRanges: []
24+
25+
# coderd.serviceNodePorts -- Allows manually setting static node ports for the coderd service.
26+
# This is only helpful if static ports are required, and usually should be left alone.
27+
# By default these are dynamically chosen.
28+
serviceNodePorts:
29+
# coderd.serviceNodePorts.http -- Sets a static 'coderd' service non-TLS nodePort.
30+
# This should usually be omitted.
31+
http: null
32+
# coderd.serviceNodePorts.https -- Sets a static 'coderd' service TLS nodePort
33+
# This should usually be omitted.
34+
https: null
35+
2436
# coderd.serviceAnnotations -- Extra annotations to apply to the coderd service.
2537
serviceAnnotations: {}
2638

0 commit comments

Comments
 (0)