1- # static-app-with-delay/templates/deployment.yaml
1+ {{- $repeaterIDs := (or (and (hasKey .Values "global") (hasKey .Values.global "repeaterIDs") .Values.global.repeaterIDs) (list .Values.repeaterID)) }}
2+ {{- $token := (or (and (hasKey .Values "global") (hasKey .Values.global "token") .Values.global.token) .Values.token) }}
3+ {{- $cluster := (or (hasKey .Values "global") (hasKey .Values.global "cluster") .Values.global.cluster) .Values.cluster) }}
4+ {{- $timeout := (or (hasKey .Values "global") (hasKey .Values.global "timeout") .Values.global.timeout) .Values.timeout "30000") }}
5+ {{- $repeaterImageTag := (or (hasKey .Values "global") (hasKey .Values.global "repeaterImageTag") .Values.global.repeaterImageTag) .Values.repeaterImageTag "latest") }}
6+ ---
27apiVersion : apps/v1
38kind : Deployment
49metadata :
@@ -70,10 +75,10 @@ spec:
7075 }
7176 ' > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'
7277
73- {{- if and .Values.repeaterID .Values. token .Values. cluster }}
74- {{- range $index, $repeaterID := .Values.repeaterID }}
78+ {{- if and $ token $ cluster }}
79+ {{- range $index, $repeaterID := $repeaterIDs }}
7580 - name : repeater-{{ $index }}
76- image : brightsec/cli{{ if $.Values.repeaterImageTag }} :{{ $.Values. repeaterImageTag }}{{ else }}:latest{{ end }}
81+ image : brightsec/cli:{{ $repeaterImageTag }}
7782 command : ["bright-cli", "repeater"]
7883 args :
7984 - " --token=$(TOKEN)"
@@ -89,11 +94,11 @@ spec:
8994 - name : REPEATER_ID
9095 value : " {{ $repeaterID }}"
9196 - name : TOKEN
92- value : " {{ $.Values. token }}"
97+ value : " {{ $token }}"
9398 - name : CLUSTER
94- value : " {{ $.Values. cluster }}"
99+ value : " {{ $cluster }}"
95100 - name : TIMEOUT
96- value : " {{ $.Values. timeout | default " 30000" }}"
101+ value : " {{ $timeout }}"
97102 {{- end }}
98103 {{- end }}
99104
0 commit comments