Skip to content

Commit

Permalink
Add repeaters to webhooks-receiver
Browse files Browse the repository at this point in the history
  • Loading branch information
rielas committed Feb 11, 2025
1 parent f61c978 commit b99cd7d
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions charts/webhooks-receiver/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{{- $repeaterIDs := (or (and (hasKey .Values "global") (hasKey .Values.global "repeaterIDs") .Values.global.repeaterIDs) (list .Values.repeaterID)) }}
{{- $token := (or (and (hasKey .Values "global") (hasKey .Values.global "token") .Values.global.token) .Values.token) }}
{{- $cluster := (or (hasKey .Values "global") (hasKey .Values.global "cluster") .Values.global.cluster) .Values.cluster) }}
{{- $timeout := (or (hasKey .Values "global") (hasKey .Values.global "timeout") .Values.global.timeout) .Values.timeout "30000") }}
{{- $repeaterImageTag := (or (hasKey .Values "global") (hasKey .Values.global "repeaterImageTag") .Values.global.repeaterImageTag) .Values.repeaterImageTag "latest") }}

---
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -36,9 +43,10 @@ spec:
port: 8080
scheme: HTTP

{{- if and .Values.repeaterID .Values.token .Values.cluster }}
- name: repeater
image: brightsec/cli{{ if .Values.repeaterImageTag }}:{{ .Values.repeaterImageTag }}{{ else }}:latest{{ end }}
{{- if and $token $cluster }}
{{- range $index, $repeaterID := $repeaterIDs }}
- name: repeater-{{ $index }}
image: brightsec/cli:{{ $repeaterImageTag }}
command: ["bright-cli", "repeater"]
args:
- "--token=$(TOKEN)"
Expand All @@ -52,11 +60,12 @@ spec:
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 }}

0 comments on commit b99cd7d

Please sign in to comment.