2021-01-17 01:09:41 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: {{ include "rspamd.fullname" . }}
|
|
|
|
labels:
|
|
|
|
{{- include "rspamd.labels" . | nindent 4 }}
|
|
|
|
spec:
|
|
|
|
replicas: {{ .Values.replicaCount }}
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
{{- include "rspamd.selectorLabels" . | nindent 6 }}
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
{{- include "rspamd.selectorLabels" . | nindent 8 }}
|
|
|
|
annotations:
|
|
|
|
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
|
|
|
spec:
|
|
|
|
{{- with .Values.imagePullSecrets }}
|
|
|
|
imagePullSecrets:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
serviceAccountName: {{ include "rspamd.serviceAccountName" . }}
|
|
|
|
securityContext:
|
|
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
|
|
containers:
|
|
|
|
- name: rspamd
|
|
|
|
securityContext:
|
|
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
|
|
image: "{{ .Values.rspamd.image.repository }}:{{ .Values.rspamd.image.tag }}"
|
|
|
|
imagePullPolicy: {{ .Values.rspamd.image.pullPolicy }}
|
|
|
|
ports:
|
|
|
|
- name: rspamd-proxy
|
|
|
|
containerPort: 11332
|
|
|
|
protocol: TCP
|
2021-01-17 01:14:26 +00:00
|
|
|
- name: rspamd-normal
|
|
|
|
containerPort: 11333
|
|
|
|
protocol: TCP
|
|
|
|
- name: rspamd-ctrl
|
|
|
|
containerPort: 11334
|
|
|
|
protocol: TCP
|
|
|
|
- name: rspamd-fuzzy
|
|
|
|
containerPort: 11335
|
|
|
|
protocol: TCP
|
|
|
|
volumeMounts:
|
|
|
|
{{- range $key, $val := (index .Values.rspamd "local.d") }}
|
|
|
|
- name: rspamd-{{ $key | replace "_" "-" | replace "." "-" }}
|
|
|
|
mountPath: "/etc/rspamd/local.d/{{ $key }}"
|
|
|
|
subPath: {{ $key }}
|
|
|
|
{{- end }}
|
|
|
|
{{- range $key, $val := (index .Values.rspamd "dkim-keys") }}
|
|
|
|
- name: rspamd-dkim-{{ $key | replace "." "-" }}
|
|
|
|
mountPath: "/var/lib/rspamd/dkim/{{ $key }}.key"
|
|
|
|
subPath: {{ $key }}
|
|
|
|
{{- end }}
|
2021-01-17 01:09:41 +00:00
|
|
|
volumes:
|
|
|
|
- name: data
|
|
|
|
{{- if .Values.persistence.enabled }}
|
|
|
|
persistentVolumeClaim:
|
|
|
|
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- end }}
|
|
|
|
{{- else }}
|
|
|
|
emptyDir: {}
|
|
|
|
{{- end }}
|
2021-01-17 01:14:26 +00:00
|
|
|
{{- range $key, $val := (index .Values.rspamd "local.d") }}
|
|
|
|
- name: rspamd-{{ $key | replace "_" "-" | replace "." "-" }}
|
|
|
|
configMap:
|
|
|
|
name: rspamd-{{ $key | replace "_" "-" | replace "." "-" }}
|
|
|
|
{{- end }}
|
|
|
|
{{- range $key, $val := (index .Values.rspamd "dkim-keys") }}
|
|
|
|
- name: rspamd-dkim-{{ $key | replace "." "-" }}
|
|
|
|
configMap:
|
|
|
|
name: rspamd-dkim-{{ $key | replace "." "-" }}
|
|
|
|
{{- end }}
|
2021-01-17 01:09:41 +00:00
|
|
|
{{- with .Values.nodeSelector }}
|
|
|
|
nodeSelector:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.affinity }}
|
|
|
|
affinity:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.tolerations }}
|
|
|
|
tolerations:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|