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

fix pvc and user #1553

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading