Skip to content

Commit 6b944c8

Browse files
committed
chore(clamav): Remove data volume
According to the [ClamAV documentation](https://docs.clamav.net/manual/Installing/Docker.html#image-selection-recommendations) you should either use the _base image and add persistent storage to the container or use the normal image without persistent storage. There are reported issues with the database breaking for some time when the pod is recreated while freshclam writes the database. This ensures that a newly started pod is always functioning. Freshclam is run by the container either way to retrieve updates (or fix a broken database) but this way you will always start with a working one. If persistent storage for the clamav pod is required the `clamav.extraVolumeMounts` or `clamav.extraVolumes` values in the helm chart can be used to achieve the same. fixes #315 Signed-off-by: Adrian Nöthlich <git@promasu.tech>
1 parent 29ee128 commit 6b944c8

3 files changed

Lines changed: 0 additions & 90 deletions

File tree

charts/mailu/README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -685,15 +685,6 @@ Check that the deployed pods are all running.
685685
| `clamav.image.tag` | Pod image tag (defaults to mailuVersion if set, otherwise Chart.AppVersion) | `1.4@sha256:9a761d591ece47ecbc0927480aa39fafc23c827fe578b61e5123c27e0eafd34d` |
686686
| `clamav.image.pullPolicy` | Pod image pull policy | `IfNotPresent` |
687687
| `clamav.image.registry` | Pod image registry (specific for clamav as it is not part of the mailu organization) | `docker.io` |
688-
| `clamav.persistence.enabled` | Enable persistence using PVC | `true` |
689-
| `clamav.persistence.size` | Pod pvc size | `2Gi` |
690-
| `clamav.persistence.storageClass` | Pod pvc storage class | `""` |
691-
| `clamav.persistence.accessModes` | Pod pvc access modes | `["ReadWriteOnce"]` |
692-
| `clamav.persistence.annotations` | Pod pvc annotations | `{}` |
693-
| `clamav.persistence.labels` | Pod pvc labels | `{}` |
694-
| `clamav.persistence.selector` | Additional labels to match for the PVC | `{}` |
695-
| `clamav.persistence.dataSource` | Custom PVC data source | `{}` |
696-
| `clamav.persistence.existingClaim` | Use a existing PVC which must be created manually before bound | `""` |
697688
| `clamav.resources.limits` | The resources limits for the container | `{}` |
698689
| `clamav.resources.requests` | The requested resources for the container | `{}` |
699690
| `clamav.livenessProbe.enabled` | Enable livenessProbe | `true` |

charts/mailu/templates/clamav/statefulset.yaml

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,6 @@ spec:
7373
securityContext: {{- omit .Values.clamav.containerSecurityContext "enabled" | toYaml | nindent 12 }}
7474
{{- end }}
7575
volumeMounts:
76-
- name: data
77-
subPath: clamav
78-
mountPath: /var/lib/clamav
7976
{{- if .Values.clamav.extraVolumeMounts }}
8077
{{- include "common.tplvalues.render" (dict "value" .Values.clamav.extraVolumeMounts "context" $) | nindent 12 }}
8178
{{- end }}
@@ -126,48 +123,4 @@ spec:
126123
{{- if .Values.clamav.extraVolumes }}
127124
{{- include "common.tplvalues.render" (dict "value" .Values.clamav.extraVolumes "context" $) | nindent 8 }}
128125
{{- end }}
129-
{{- if not .Values.clamav.persistence.enabled }}
130-
- name: data
131-
emptyDir: {}
132-
{{- else if .Values.clamav.persistence.existingClaim }}
133-
- name: data
134-
persistentVolumeClaim:
135-
claimName: {{ printf "%s" (tpl .Values.clamav.persistence.existingClaim .) }}
136-
{{- else }}
137-
volumeClaimTemplates:
138-
- metadata:
139-
name: data
140-
labels: {{- include "common.labels.standard" . | nindent 10 }}
141-
app.kubernetes.io/component: clamav
142-
{{- if .Values.clamav.persistence.labels }}
143-
{{- include "common.tplvalues.render" ( dict "value" .Values.clamav.persistence.labels "context" $ ) | nindent 10 }}
144-
{{- end }}
145-
{{- if .Values.commonLabels }}
146-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 10 }}
147-
{{- end }}
148-
{{- if or .Values.clamav.persistence.annotations .Values.commonAnnotations }}
149-
annotations:
150-
{{- if .Values.clamav.persistence.annotations }}
151-
{{- include "common.tplvalues.render" ( dict "value" .Values.clamav.persistence.annotations "context" $ ) | nindent 10 }}
152-
{{- end }}
153-
{{- if .Values.commonAnnotations }}
154-
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 10 }}
155-
{{- end }}
156-
{{- end }}
157-
spec:
158-
accessModes:
159-
{{- range .Values.clamav.persistence.accessModes }}
160-
- {{ . | quote }}
161-
{{- end }}
162-
resources:
163-
requests:
164-
storage: {{ .Values.clamav.persistence.size | quote }}
165-
{{- if .Values.clamav.persistence.selector }}
166-
selector: {{- include "common.tplvalues.render" (dict "value" .Values.clamav.persistence.selector "context" $) | nindent 10 }}
167-
{{- end }}
168-
{{- if .Values.clamav.persistence.dataSource }}
169-
dataSource: {{- include "common.tplvalues.render" (dict "value" .Values.clamav.persistence.dataSource "context" $) | nindent 10 }}
170-
{{- end }}
171-
{{- include "common.storage.class" (dict "persistence" .Values.clamav.persistence "global" .Values.global) | nindent 8 }}
172-
{{- end }}
173126
{{- end }}

charts/mailu/values.yaml

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2001,40 +2001,6 @@ clamav:
20012001
pullPolicy: IfNotPresent
20022002
registry: docker.io
20032003

2004-
## Pod persistence (if not using single_pvc)
2005-
persistence:
2006-
## @param clamav.persistence.enabled Enable persistence using PVC
2007-
enabled: true
2008-
2009-
## @param clamav.persistence.size Pod pvc size
2010-
size: 2Gi
2011-
2012-
## @param clamav.persistence.storageClass Pod pvc storage class
2013-
storageClass: ""
2014-
2015-
## @param clamav.persistence.accessModes Pod pvc access modes
2016-
accessModes: [ReadWriteOnce]
2017-
2018-
## @param clamav.persistence.annotations Pod pvc annotations
2019-
annotations: {}
2020-
2021-
## @param clamav.persistence.labels Pod pvc labels
2022-
labels: {}
2023-
2024-
## @param clamav.persistence.selector Additional labels to match for the PVC
2025-
## e.g:
2026-
## selector:
2027-
## matchLabels:
2028-
## app: my-app
2029-
selector: {}
2030-
2031-
## @param clamav.persistence.dataSource Custom PVC data source
2032-
dataSource: {}
2033-
2034-
## @param clamav.persistence.existingClaim Use a existing PVC which must be created manually before bound
2035-
## NOTE: requires clamav.persistence.enabled: true
2036-
existingClaim: ""
2037-
20382004
## Pod resource requests and limits
20392005
## ref: https://kubernetes.io/docs/user-guide/compute-resources/
20402006
## We usually recommend not to specify default resources and to leave this as a conscious

0 commit comments

Comments
 (0)