- infra (k8s, kind, helm, docker) backbone is implemented - security: implementation + unit tests are done
80 lines
2.6 KiB
YAML
80 lines
2.6 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "incidentops.fullname" . }}-worker
|
|
labels:
|
|
{{- include "incidentops.worker.labels" . | nindent 4 }}
|
|
spec:
|
|
{{- if not .Values.worker.autoscaling.enabled }}
|
|
replicas: {{ .Values.worker.replicaCount }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "incidentops.worker.selectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
annotations:
|
|
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
|
checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
|
|
{{- with .Values.worker.podAnnotations }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "incidentops.worker.selectorLabels" . | nindent 8 }}
|
|
spec:
|
|
{{- with .Values.global.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "incidentops.serviceAccountName" . }}
|
|
securityContext:
|
|
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
|
containers:
|
|
- name: worker
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|
|
image: {{ include "incidentops.worker.image" . }}
|
|
imagePullPolicy: {{ .Values.worker.image.pullPolicy }}
|
|
command:
|
|
- celery
|
|
- -A
|
|
- worker.celery_app
|
|
- worker
|
|
- --loglevel=info
|
|
- -Q
|
|
- {{ .Values.worker.queues }}
|
|
- --concurrency={{ .Values.worker.concurrency }}
|
|
envFrom:
|
|
- configMapRef:
|
|
name: {{ include "incidentops.fullname" . }}-config
|
|
- secretRef:
|
|
name: {{ include "incidentops.fullname" . }}-secret
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- celery
|
|
- -A
|
|
- worker.celery_app
|
|
- inspect
|
|
- ping
|
|
- -d
|
|
- celery@$HOSTNAME
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 60
|
|
timeoutSeconds: 10
|
|
failureThreshold: 3
|
|
resources:
|
|
{{- toYaml .Values.worker.resources | nindent 12 }}
|
|
{{- with .Values.worker.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.worker.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.worker.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|