KubeZero/charts/clamav/templates/statefulset.yaml

79 lines
2.3 KiB
YAML
Raw Permalink Normal View History

2021-08-18 12:02:40 +00:00
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: {{ include "kubezero-lib.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "kubezero-lib.labels" . | nindent 4 }}
spec:
2023-12-14 22:05:05 +00:00
replicas: {{ .Values.replicaCount }}
2021-08-18 12:02:40 +00:00
selector:
matchLabels:
{{- include "kubezero-lib.selectorLabels" . | nindent 6 }}
serviceName: {{ include "kubezero-lib.fullname" . }}
template:
metadata:
labels:
{{- include "kubezero-lib.selectorLabels" . | nindent 8 }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
spec:
containers:
- name: clamav
2023-12-14 22:05:05 +00:00
image: "{{ .Values.image.repository }}:{{ default .Chart.AppVersion .Values.image.tag }}_{{ .Values.image.type }}"
2021-08-18 12:02:40 +00:00
ports:
- containerPort: 3310
name: clamav
protocol: TCP
# Give clamav up to 300s to get CVDs in place etc.
startupProbe:
exec:
command:
- /usr/local/bin/clamdcheck.sh
failureThreshold: 30
periodSeconds: 10
livenessProbe:
exec:
command:
- /usr/local/bin/clamdcheck.sh
failureThreshold: 2
periodSeconds: 30
successThreshold: 1
timeoutSeconds: 3
resources:
2023-12-14 22:05:05 +00:00
{{- toYaml .Values.resources | nindent 10 }}
2021-08-18 12:02:40 +00:00
volumeMounts:
- mountPath: /var/lib/clamav
name: signatures
- mountPath: /etc/clamav
name: config-volume
#securityContext:
# runAsNonRoot: true
volumes:
- name: config-volume
configMap:
name: {{ include "kubezero-lib.fullname" . }}
2023-12-14 22:05:05 +00:00
{{- with .Values.nodeSelector }}
2021-08-18 12:02:40 +00:00
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
2023-12-14 22:05:05 +00:00
{{- with .Values.affinity }}
2021-08-18 12:02:40 +00:00
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
2023-12-14 22:05:05 +00:00
{{- with .Values.tolerations }}
2021-08-18 12:02:40 +00:00
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
volumeClaimTemplates:
- metadata:
name: signatures
spec:
accessModes: [ "ReadWriteOnce" ]
2023-12-14 22:05:05 +00:00
{{- with .Values.storageClassName }}
2021-08-18 12:02:40 +00:00
storageClassName: {{ . }}
{{- end }}
resources:
requests:
storage: 2Gi