diff --git a/charts/crowdsec/templates/lapi-deployment.yaml b/charts/crowdsec/templates/lapi-deployment.yaml index 3188348..1d39145 100644 --- a/charts/crowdsec/templates/lapi-deployment.yaml +++ b/charts/crowdsec/templates/lapi-deployment.yaml @@ -172,6 +172,10 @@ spec: {{ if .Values.lapi.persistentVolume.config.enabled }} command: ['sh', '-c', 'mv -n /staging/etc/crowdsec/* /etc/crowdsec_data/ && rm -rf /staging/etc/crowdsec && ln -s /etc/crowdsec_data /etc/crowdsec && ./docker_start.sh'] {{ end }} + {{- if .Values.lapi.lifecycle }} + 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" .) }} volumeMounts: {{- if .Values.tls.enabled }} diff --git a/charts/crowdsec/values.yaml b/charts/crowdsec/values.yaml index af6a83f..cae00c7 100644 --- a/charts/crowdsec/values.yaml +++ b/charts/crowdsec/values.yaml @@ -258,6 +258,13 @@ lapi: # -- Any extra secrets you may need (for example, external DB password) extraSecrets: {} # dbPassword: randomPass + lifecycle: {} + # preStop: + # exec: + # command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"] + # postStart: + # exec: + # command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"] # agent will deploy pod on every node as daemonSet to read wanted pods logs agent: