diff --git a/charts/crowdsec/templates/agent-daemonSet.yaml b/charts/crowdsec/templates/agent-daemonSet.yaml index f14f645..e1637eb 100644 --- a/charts/crowdsec/templates/agent-daemonSet.yaml +++ b/charts/crowdsec/templates/agent-daemonSet.yaml @@ -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 }}" diff --git a/charts/crowdsec/templates/lapi-deployment.yaml b/charts/crowdsec/templates/lapi-deployment.yaml index 4d2fed7..0ad22e8 100644 --- a/charts/crowdsec/templates/lapi-deployment.yaml +++ b/charts/crowdsec/templates/lapi-deployment.yaml @@ -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 @@ -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 }}" diff --git a/charts/crowdsec/values.yaml b/charts/crowdsec/values.yaml index be63d93..29a5f80 100644 --- a/charts/crowdsec/values.yaml +++ b/charts/crowdsec/values.yaml @@ -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: @@ -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