From ba152730d2d9939ade658d0abeb6a67c2674f23c Mon Sep 17 00:00:00 2001 From: Erwan Vallienne <135604788+erwanval@users.noreply.github.com> Date: Tue, 3 Sep 2024 12:01:06 +0200 Subject: [PATCH] Add values to add extraVolumes to lapi and agent (#188) Signed-off-by: Erwan Vallienne --- charts/crowdsec/templates/agent-daemonSet.yaml | 6 ++++++ charts/crowdsec/templates/lapi-deployment.yaml | 10 ++++++++-- charts/crowdsec/values.yaml | 12 ++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/charts/crowdsec/templates/agent-daemonSet.yaml b/charts/crowdsec/templates/agent-daemonSet.yaml index cf8d287..cc741f7 100644 --- a/charts/crowdsec/templates/agent-daemonSet.yaml +++ b/charts/crowdsec/templates/agent-daemonSet.yaml @@ -206,6 +206,9 @@ spec: - name: crowdsec-agent-tls mountPath: /etc/ssl/crowdsec-agent {{- end }} + {{- if .Values.agent.extraVolumeMounts }} + {{ toYaml .Values.agent.extraVolumeMounts | nindent 10 }} + {{- end }} terminationGracePeriodSeconds: 30 volumes: - name: acquis-config-volume @@ -278,6 +281,9 @@ spec: secret: secretName: {{ .Release.Name }}-agent-tls {{- end }} + {{- if .Values.agent.extraVolumes }} + {{ toYaml .Values.agent.extraVolumes | nindent 6 }} + {{- end }} {{- with .Values.agent.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/crowdsec/templates/lapi-deployment.yaml b/charts/crowdsec/templates/lapi-deployment.yaml index e404036..df976fb 100644 --- a/charts/crowdsec/templates/lapi-deployment.yaml +++ b/charts/crowdsec/templates/lapi-deployment.yaml @@ -192,7 +192,7 @@ spec: lifecycle: {{- toYaml .Values.lapi.lifecycle | nindent 10 }} {{- end }} - {{- if or (.Values.tls.enabled) (.Values.lapi.persistentVolume.data.enabled) (.Values.lapi.persistentVolume.config.enabled) (.Values.lapi.dashboard.enabled) (include "lapiCustomConfigIsNotEmpty" .) }} + {{- if or (.Values.tls.enabled) (.Values.lapi.persistentVolume.data.enabled) (.Values.lapi.persistentVolume.config.enabled) (.Values.lapi.dashboard.enabled) (include "lapiCustomConfigIsNotEmpty" .) (.Values.lapi.extraVolumeMounts) }} volumeMounts: {{- if .Values.tls.enabled }} - name: crowdsec-lapi-tls @@ -240,6 +240,9 @@ spec: {{- end }} {{- end }} {{- end }} + {{- if .Values.lapi.extraVolumeMounts }} + {{ toYaml .Values.lapi.extraVolumeMounts | nindent 10 }} + {{- end }} {{- end }} {{- if .Values.lapi.dashboard.enabled }} - name: dashboard @@ -306,7 +309,7 @@ spec: {{- end }} terminationGracePeriodSeconds: 30 - {{- if or (.Values.tls.enabled) (.Values.lapi.persistentVolume.data.enabled) (.Values.lapi.persistentVolume.config.enabled) (.Values.lapi.dashboard.enabled) (include "lapiCustomConfigIsNotEmpty" .) }} + {{- if or (.Values.tls.enabled) (.Values.lapi.persistentVolume.data.enabled) (.Values.lapi.persistentVolume.config.enabled) (.Values.lapi.dashboard.enabled) (include "lapiCustomConfigIsNotEmpty" .) (.Values.lapi.extraVolumes) }} volumes: {{- if .Values.lapi.persistentVolume.data.enabled }} - name: crowdsec-db @@ -369,6 +372,9 @@ spec: secret: secretName: {{ .Release.Name }}-agent-tls {{- end }} + {{- if .Values.lapi.extraVolumes }} + {{ toYaml .Values.lapi.extraVolumes | nindent 6 }} + {{- end }} {{- end }} {{- with .Values.lapi.tolerations }} tolerations: diff --git a/charts/crowdsec/values.yaml b/charts/crowdsec/values.yaml index 64d7a92..35d5c27 100644 --- a/charts/crowdsec/values.yaml +++ b/charts/crowdsec/values.yaml @@ -182,6 +182,12 @@ lapi: # -- Extra init containers to be added to lapi pods extraInitContainers: [] + # -- Extra volumes to be added to lapi pods + extraVolumes: [] + + # -- Extra volumeMounts to be added to lapi pods + extraVolumeMounts: [] + # -- resources for lapi resources: limits: @@ -333,6 +339,12 @@ agent: # -- Extra init containers to be added to agent pods extraInitContainers: [] + # -- Extra volumes to be added to agent pods + extraVolumes: [] + + # -- Extra volumeMounts to be added to agent pods + extraVolumeMounts: [] + resources: limits: memory: 250Mi