Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ClamAV with persistentVolume #322

Open
hperez-lab opened this issue Aug 29, 2023 · 3 comments
Open

Using ClamAV with persistentVolume #322

hperez-lab opened this issue Aug 29, 2023 · 3 comments

Comments

@hperez-lab
Copy link

I have enabled the persistentVolume in my ClamAV configuration:

apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
  name: clamav
spec:
  releaseName: clamav
  targetNamespace: clamav
  chart:
    repository: https://wiremind.github.io/wiremind-helm-charts
    name: clamav
    version: 2.6.2
  values:
    image:
      repository: ghcr.io/mailu/clamav # Should be a mirror on our docker-registry
      tag: 1.9.50
    ## Clamav data dir persistence
    persistentVolume:
      enabled: true
      accessModes:
      - ReadWriteOnce
      size: 1Gi

The pv and pvc are created as expected however I'm getting the below error when the container is trying to start:

Tue Aug 29 07:44:56 2023 -> ERROR: Can't create freshclam.dat in /data
Tue Aug 29 07:44:56 2023 -> Hint: The database directory must be writable for UID 2000 or GID 2000
Tue Aug 29 07:44:56 2023 -> Hint: The database directory must be writable for UID 2000 or GID 2000

As a workaround I have created a pod associated to the pvc already created and changing the permission of the /data folder form root to 2000 (chown 2000:2000 /data). But I would like to know it there is any way to fix this issue without having to make the workaround.

I have tried different configurations with podSecurityContext and securityContext but unsuccessfully.

Thank you

@sugarman402
Copy link

Hi, we encountered into the very same issue.

@sugarman402
Copy link

We found a workaround for this, We added fsGroup: 2000 to the values file under the podSecurityContext key.

@desaintmartin
Copy link
Member

Hi, PR accepted!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants