Skip to content

Commit

Permalink
Add lifecycle support for LAPI (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
sipr-invivo authored Apr 4, 2024
1 parent 851323c commit 57858f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions charts/crowdsec/templates/lapi-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
7 changes: 7 additions & 0 deletions charts/crowdsec/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 57858f2

Please sign in to comment.