Skip to content

Commit

Permalink
fix pvc and user
Browse files Browse the repository at this point in the history
  • Loading branch information
ARADDCC013 committed Oct 8, 2024
1 parent 81ec9e1 commit 34c8c0a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,16 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
runAsUser: {{ .Values.clamav.runAsUser }}
containers:
- name: {{ include "bailo.fullname" . }}-clamav
ports:
- name: clamavport
containerPort: 3310
protocol: TCP
image: {{ .Values.clamav.image }}
command:
- /bin/sh
args:
- -c
- /init-unprivileged # Runs ClamAV as non-root unprivileged user. https://docs.clamav.net/manual/Installing/Docker.html#running-clamd-using-non-root-user-using---user-and---entrypoint
command: ["/bin/sh", "-c"]
args: ["/init-unprivileged && chown -R 1002:1002 /var/lib/clamav"] # Runs ClamAV as non-root unprivileged user. https://docs.clamav.net/manual/Installing/Docker.html#running-clamd-using-non-root-user-using---user-and---entrypoint
resources:
requests:
memory: "100Mi"
Expand All @@ -59,5 +56,5 @@ spec:
emptyDir: {}
- name: clamav-signatures
persistentVolumeClaim:
claimName: {{ .Values.aws.pvcClamAVName }}
claimName: {{ include "bailo.fullname" . }}-clamav-pvc
{{- end }}
15 changes: 9 additions & 6 deletions infrastructure/helm/bailo/templates/clamav/clamav.pvc.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
{{- if .Values.clamav.enabled }}
---
apiVersion: v1

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ .Values.aws.pvcClamAVName }}
name: {{ include "bailo.fullname" . }}-clamav-pvc
labels:
{{- include "bailo.labels" . | nindent 4 }}
spec:
accessModes:
- ReadWriteOnce
storageClassName: {{ .Values.aws.storageName }}
{{- range .Values.clamav.accessModes }}
- {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.aws.pvcClamAVStorage }}
storage: {{ .Values.clamav.size | quote }}
{{- end }}
6 changes: 4 additions & 2 deletions infrastructure/helm/bailo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ aws:
pvcMinioStorage: 20Gi
pvcMongoName: "bailo-mongodb"
pvcMongoStorage: 10Gi
pvcClamAVName: "bailo-clamav"
pvcClamAVStorage: 5Gi

# Pod resource
resources:
Expand Down Expand Up @@ -287,5 +285,9 @@ backend:

clamav:
enabled: false
runAsUser: 1002
image: clamav/clamav:latest_base # https://docs.clamav.net/manual/Installing/Docker.html#the-official-images-on-docker-hub
port: 3310
accessModes:
- ReadWriteOnce
size: 10G

0 comments on commit 34c8c0a

Please sign in to comment.