diff --git a/charts/brokencrystals/Chart.yaml b/charts/brokencrystals/Chart.yaml index d8af799..eb68625 100644 --- a/charts/brokencrystals/Chart.yaml +++ b/charts/brokencrystals/Chart.yaml @@ -4,7 +4,7 @@ description: | Benchmark application that uses modern technologies and implements a set of common security vulnerabilities type: application -version: 0.1.0 +version: 0.1.5 icon: https://raw.githubusercontent.com/NeuraLegion/brokencrystals/stable/public/public/assets/img/logo.png keywords: - brokencrystals diff --git a/charts/brokencrystals/templates/deployment.yaml b/charts/brokencrystals/templates/deployment.yaml index eec4d9d..a01a98c 100644 --- a/charts/brokencrystals/templates/deployment.yaml +++ b/charts/brokencrystals/templates/deployment.yaml @@ -1,3 +1,9 @@ +{{- $repeaterIDs := (or (and (hasKey .Values "global") .Values.global.repeaterIDs) (compact (list .Values.repeaterID))) }} +{{- $token := (or (and (hasKey .Values "global") .Values.global.token) .Values.token) }} +{{- $cluster := (or (and (hasKey .Values "global") .Values.global.cluster) .Values.cluster) }} +{{- $timeout := (or (and (hasKey .Values "global") .Values.global.timeout) .Values.timeout "30000") }} +{{- $repeaterImageTag := (or (and (hasKey .Values "global") .Values.global.repeaterImageTag) .Values.repeaterImageTag "latest") }} + apiVersion: apps/v1 kind: Deployment metadata: @@ -194,29 +200,31 @@ spec: image: sj26/mailcatcher {{- end }} - {{- if and .Values.repeaterID .Values.token .Values.cluster }} - - name: repeater - image: brightsec/cli{{ if ne .Values.repeaterImageTag "" }}:{{ .Values.repeaterImageTag }}{{ else }}:latest{{ end }} + {{- if and $token $cluster (gt (len $repeaterIDs) 0) }} + {{- range $index, $repeaterID := $repeaterIDs }} + - name: repeater-{{ $index }} + image: brightsec/cli:{{ $repeaterImageTag }} command: ["bright-cli", "repeater"] args: - - "--token=$(TOKEN)" - - "--id=$(REPEATER_ID)" - - "--cluster=$(CLUSTER)" - - "--timeout=$(TIMEOUT)" - - "--log-level=verbose" + - "--token=$(TOKEN)" + - "--id=$(REPEATER_ID)" + - "--cluster=$(CLUSTER)" + - "--timeout=$(TIMEOUT)" + - "--log-level=verbose" resources: requests: cpu: 200m memory: 100Mi env: - name: REPEATER_ID - value: "{{ .Values.repeaterID }}" + value: "{{ $repeaterID }}" - name: TOKEN - value: "{{ .Values.token }}" + value: "{{ $token }}" - name: CLUSTER - value: "{{ .Values.cluster }}" + value: "{{ $cluster }}" - name: TIMEOUT - value: "{{ .Values.timeout | default "30000" }}" + value: "{{ $timeout }}" + {{- end }} {{- end }} volumes: diff --git a/charts/brokencrystals/values.yaml b/charts/brokencrystals/values.yaml index f0bffe5..e8d681e 100644 --- a/charts/brokencrystals/values.yaml +++ b/charts/brokencrystals/values.yaml @@ -5,9 +5,9 @@ ingress: images: main: stable-52ed70 repeaterImageTag: "" -repeaterID: "" -token: "" -cluster: "" -timeout: "" +repeaterID: null +token: null +cluster: null +timeout: null clusterConfigMap: "brokencrystals-config" useMailcatcher: false