Skip to content

Commit

Permalink
Add values to add extra InitContainers to agent and lapi (#178)
Browse files Browse the repository at this point in the history
Signed-off-by: Erwan Vallienne <[email protected]>
  • Loading branch information
erwanval authored Aug 20, 2024
1 parent 6bd1d20 commit b6363d0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions charts/crowdsec/templates/agent-daemonSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ spec:
securityContext:
allowPrivilegeEscalation: false
privileged: false
{{- if .Values.agent.extraInitContainers }}
{{- toYaml .Values.agent.extraInitContainers | nindent 6 }}
{{- end }}
containers:
- name: crowdsec-agent
image: "{{ .Values.image.repository | default "crowdsecurity/crowdsec" }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
Expand Down
7 changes: 6 additions & 1 deletion charts/crowdsec/templates/lapi-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ spec:
imagePullSecrets:
{{ toYaml .Values.image.pullSecrets | indent 8 }}
{{- end }}
{{ if .Values.lapi.dashboard.enabled }}
{{- if or (.Values.lapi.dashboard.enabled) (.Values.lapi.extraInitContainers) }}
initContainers:
{{- if .Values.lapi.dashboard.enabled }}
- name: fetch-metabase-config
image: busybox:1.28
imagePullPolicy: IfNotPresent
Expand All @@ -54,6 +55,10 @@ spec:
mountPath: /metabase-data
subPath: dashboard
{{- end }}
{{- if .Values.lapi.extraInitContainers }}
{{- toYaml .Values.lapi.extraInitContainers | nindent 8 }}
{{- end }}
{{- end }}
containers:
- name: crowdsec-lapi
image: "{{ .Values.image.repository | default "crowdsecurity/crowdsec" }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
Expand Down
6 changes: 6 additions & 0 deletions charts/crowdsec/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ lapi:
# -- Labels to be added to lapi pods, if global podLabels are not set
podLabels: {}

# -- Extra init containers to be added to lapi pods
extraInitContainers: []

# -- resources for lapi
resources:
limits:
Expand Down Expand Up @@ -326,6 +329,9 @@ agent:
# -- Labels to be added to agent pods, if global podLabels are not set
podLabels: {}

# -- Extra init containers to be added to agent pods
extraInitContainers: []

resources:
limits:
memory: 250Mi
Expand Down

0 comments on commit b6363d0

Please sign in to comment.