Skip to content

Commit

Permalink
Add values to add extraVolumes to lapi and agent (#188)
Browse files Browse the repository at this point in the history
Signed-off-by: Erwan Vallienne <[email protected]>
  • Loading branch information
erwanval authored Sep 3, 2024
1 parent 5959fe4 commit ba15273
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
6 changes: 6 additions & 0 deletions charts/crowdsec/templates/agent-daemonSet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down
10 changes: 8 additions & 2 deletions charts/crowdsec/templates/lapi-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
12 changes: 12 additions & 0 deletions charts/crowdsec/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ba15273

Please sign in to comment.