Skip to content

Commit 4d61651

Browse files
authored
Make it possible to customize nats port (#407)
Signed-off-by: Waldemar Quevedo <wally@nats.io> Co-authored-by: Waldemar Quevedo <wally@nats.io>
1 parent da50a09 commit 4d61651

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

helm/charts/nats/templates/NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ now use the NATS tools within the container as follows:
1919

2020
nats-box:~# nats-sub test &
2121
nats-box:~# nats-pub test hi
22-
nats-box:~# nc {{ template "nats.fullname" . }} 4222
22+
nats-box:~# nc {{ template "nats.fullname" . }} {{ .Values.nats.client.port }}
2323

2424
{{- end }}
2525

helm/charts/nats/templates/configmap.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ metadata:
88
{{- include "nats.labels" . | nindent 4 }}
99
data:
1010
nats.conf: |
11+
# NATS Clients Port
12+
port: {{ .Values.nats.client.port }}
13+
1114
# PID file shared with configuration reloader.
1215
pid_file: "/var/run/nats/nats.pid"
1316

helm/charts/nats/templates/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ spec:
3636
{{- end }}
3737
{{- end }}
3838
- name: {{ .Values.nats.client.portName }}
39-
port: 4222
39+
port: {{ .Values.nats.client.port }}
4040
{{- if .Values.appProtocol.enabled }}
4141
appProtocol: tcp
4242
{{- end }}

helm/charts/nats/templates/statefulset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,10 +251,10 @@ spec:
251251
resources:
252252
{{- toYaml .Values.nats.resources | nindent 10 }}
253253
ports:
254-
- containerPort: 4222
254+
- containerPort: {{ .Values.nats.client.port }}
255255
name: {{ .Values.nats.client.portName }}
256256
{{- if .Values.nats.externalAccess }}
257-
hostPort: 4222
257+
hostPort: {{ .Values.nats.client.port }}
258258
{{- end }}
259259
- containerPort: 7422
260260
name: leafnodes

0 commit comments

Comments
 (0)