16
16
nodeSelector: { {(.Values.nats.nodeSelector | default .Values.scheduling.stateful.nodeSelector) | toJson } }
17
17
18
18
postInstall: |+
19
- cat <<EOF | kubectl apply -f -
19
+ cat <<' EOF' | kubectl apply -f -
20
20
apiVersion: batch/v1
21
21
kind: Job
22
22
metadata:
29
29
nodeSelector: { { (.Values.nats.nodeSelector | default .Values.scheduling.stateful.nodeSelector) | toJson } }
30
30
containers:
31
31
- name: nats-manager
32
- image: natsio /nats-box:0.14.1
33
- command: [ " sh" ]
32
+ { {- /* image: natsio/nats-box:0.14.1 */} }
33
+ image: ghcr.io/kloudlite/hub/nats:latest
34
+ command: ["bash"]
34
35
args:
35
36
- -c
36
37
- |+
@@ -41,17 +42,20 @@ spec:
41
42
42
43
echo "creatings NATS STREAMs"
43
44
{ {- range $k ,$stream := .Values.nats.streams } }
44
- nats --server { { include " nats.url" .} } stream add { { $stream .name } } \
45
- --replicas ={ { $.Values.nats.replicas} } \
46
- --subjects ={ { $stream .subjects | squote } } \
47
- --max-msg-size ={ { $stream .maxMsgBytes } } \
48
- { { if $stream .maxMsgsPerSubject } } --max-msgs-per-subject ={ { $stream .maxMsgsPerSubject} } { { end} } \
49
- --storage =file \
50
- { { if $stream .maxAge } } --max-age ={ { $stream .maxAge} } { { end } } \
51
- { { if $stream .workQueue } } --retention =" work" { { end } } \
52
- --compression =s2 \
53
- --discard =old \
45
+ params=(
46
+ --server { {include " nats.url" . | squote} }
47
+ --replicas={ {$.Values.nats.replicas} }
48
+ --subjects={ { $stream .subjects | squote } }
49
+ --max-msg-size={ { $stream .maxMsgBytes } }
50
+ { { if $stream .maxMsgsPerSubject } }--max-msgs-per-subject={ {$stream .maxMsgsPerSubject} }{ {end} }
51
+ { { if $stream .maxAge } }--max-age={ {$stream .maxAge} }{ { end } }
52
+ { { if $stream .workQueue } }--retention="work"{ { end } }
53
+ --storage=file
54
+ --compression=s2
55
+ --discard=old
54
56
--defaults
57
+ )
58
+ nats stream add "${ params[@]} " "{ {$stream .name} }"
55
59
{ {- end } }
56
60
restartPolicy: Never
57
61
backoffLimit: 0
0 commit comments