Skip to content

Commit 1dae784

Browse files
weltekialexellis
authored andcommitted
Update chart to support NATS Jetstream
Test by deploying chart with `--set nats.queueMode=jetstream` Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
1 parent afbc54e commit 1dae784

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

chart/openfaas/templates/nats-dep.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ spec:
2929
- name: nats
3030
resources:
3131
{{- .Values.nats.resources | toYaml | nindent 12 }}
32+
{{- if eq .Values.nats.queueMode "jetstream" }}
3233
image: {{ .Values.nats.image }}
34+
{{- else }}
35+
image: {{ .Values.stan.image }}
36+
{{- end }}
3337
imagePullPolicy: {{ .Values.openfaasImagePullPolicy }}
3438
ports:
3539
- containerPort: 4222
@@ -38,12 +42,18 @@ spec:
3842
- containerPort: 8222
3943
protocol: TCP
4044
{{- end }}
45+
{{- if not (eq .Values.nats.queueMode "jetstream") }}
4146
command: ["/nats-streaming-server"]
47+
{{- end }}
4248
args:
49+
{{- if eq .Values.nats.queueMode "jetstream" }}
50+
- --js
51+
{{- else}}
4352
- --store
4453
- memory
4554
- --cluster_id
4655
- faas-cluster
56+
{{- end }}
4757
{{- if or .Values.nats.enableMonitoring .Values.nats.metrics.enabled }}
4858
- -m
4959
- "8222"
@@ -62,8 +72,12 @@ spec:
6272
- -routez
6373
- -subz
6474
- -varz
75+
{{- if eq .Values.nats.queueMode "jetstream" }}
76+
- -jsz=all
77+
{{- else }}
6578
- -channelz
6679
- -serverz
80+
{{- end }}
6781
- http://localhost:8222
6882
{{- end }}
6983
{{- with .Values.nodeSelector }}

chart/openfaas/values.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,15 +226,19 @@ alertmanager:
226226
limits:
227227
memory: "50Mi"
228228

229+
stan:
230+
image: nats-streaming:0.22.0
231+
229232
# NATS is required for async
230233
nats:
231234
channel: "faas-request"
235+
queueMode: ""
232236
external:
233237
clusterName: ""
234238
enabled: false
235239
host: ""
236240
port: ""
237-
image: nats-streaming:0.22.0
241+
image: nats:2.8.4
238242
enableMonitoring: false
239243
metrics:
240244
# Should stay off by default because the exporter is not multi-arch (yet)

0 commit comments

Comments
 (0)