-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathcoprocessor-sns-worker-deployment.yaml
More file actions
124 lines (124 loc) · 5.33 KB
/
coprocessor-sns-worker-deployment.yaml
File metadata and controls
124 lines (124 loc) · 5.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{{- if .Values.snsWorker.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: coprocessor-sns-worker
app.kubernetes.io/name: {{ include "snsWorkerName" . }}
name: {{ include "snsWorkerName" . }}
spec:
replicas: {{ .Values.snsWorker.replicas }}
selector:
matchLabels:
app: coprocessor-sns-worker
{{- if .Values.snsWorker.updateStrategy }}
strategy:
{{- toYaml .Values.snsWorker.updateStrategy | nindent 4 }}
{{- end }}
template:
metadata:
labels:
app: coprocessor-sns-worker
app.kubernetes.io/name: {{ include "snsWorkerName" . }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
imagePullSecrets:
- name: registry-credentials
restartPolicy: Always
{{- with .Values.snsWorker.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.snsWorker.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.snsWorker.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.snsWorker.serviceAccountName }}
serviceAccountName: {{ .Values.snsWorker.serviceAccountName }}
{{- end }}
containers:
- name: coprocessor-sns-worker
image: {{ .Values.snsWorker.image.name }}:{{ .Values.snsWorker.image.tag }}
command: ["sns_worker"]
args:
- --database-url=$(DATABASE_URL)
- --bucket-name-ct64=$(S3_BUCKET_NAME)
- --bucket-name-ct128=$(S3_BUCKET_NAME)
- --log-level={{ .Values.snsWorker.args.logLevel }}
- --service-name={{ .Values.snsWorker.args.serviceName }}
- --pg-listen-channels
{{- range .Values.snsWorker.args.pgListenChannels }}
- {{ . | quote }}
{{- end }}
- --pg-notify-channel
- {{ .Values.snsWorker.args.pgNotifyChannel | quote }}
- --work-items-batch-size={{ .Values.snsWorker.args.workItemsBatchSize }}
- --pg-polling-interval={{ .Values.snsWorker.args.pgPollingInterval }}
- --pg-pool-connections={{ .Values.snsWorker.args.pgPoolConnections }}
- --pg-timeout={{ .Values.snsWorker.args.pgTimeout }}
- --s3-max-concurrent-uploads={{ .Values.snsWorker.args.s3MaxConcurrentUploads }}
- --s3-max-retries-per-upload={{ .Values.snsWorker.args.s3MaxRetriesPerUpload }}
- --s3-max-backoff={{ .Values.snsWorker.args.s3MaxBackoff }}
- --s3-max-retries-timeout={{ .Values.snsWorker.args.s3MaxRetriesTimeout }}
- --s3-recheck-duration={{ .Values.snsWorker.args.s3RecheckDuration }}
- --s3-regular-recheck-duration={{ .Values.snsWorker.args.s3RegularRecheckDuration }}
- --gc-batch-size={{ .Values.snsWorker.args.gcBatchSize }}
- --cleanup-interval={{ .Values.snsWorker.args.cleanupInterval }}
- --liveness-threshold={{ .Values.snsWorker.args.livenessThreshold }}
- --lifo={{ .Values.snsWorker.args.lifo }}
- --enable-compression={{ .Values.snsWorker.args.enableCompression }}
- --schedule-policy={{ .Values.snsWorker.args.schedulePolicy }}
- --tenant-api-key=$(TENANT_API_KEY)
{{- with .Values.snsWorker.extraArgs }}
{{- toYaml . | nindent 12 }}
{{- end }}
env:
{{- include "coprocessorDatabaseEnv" . | nindent 12 }}
- name: S3_BUCKET_NAME
value: {{ .Values.snsWorker.config.s3BucketName | quote }}
{{- if default .Values.commonConfig.tracing.enabled .Values.snsWorker.tracing.enabled }}
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: {{ .Values.commonConfig.tracing.endpoint | quote }}
- name: OTEL_SERVICE_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
{{- end }}
{{- with .Values.commonConfig.env }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.snsWorker.env }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
{{- range $portName, $portValue := .Values.snsWorker.ports }}
- name: {{ $portName }}
containerPort: {{ $portValue }}
protocol: TCP
{{- end }}
resources:
requests:
cpu: {{ .Values.snsWorker.resources.requests.cpu | default "100m" }}
memory: {{ .Values.snsWorker.resources.requests.memory | default "256Mi" }}
limits:
cpu: {{ .Values.snsWorker.resources.limits.cpu | default "500m" }}
memory: {{ .Values.snsWorker.resources.limits.memory | default "512Mi" }}
{{- if and .Values.snsWorker.probes .Values.snsWorker.probes.liveness.enabled }}
livenessProbe:
{{- toYaml (omit .Values.snsWorker.probes.liveness "enabled") | nindent 12 }}
{{- end }}
{{- if and .Values.snsWorker.probes .Values.snsWorker.probes.readiness.enabled }}
readinessProbe:
{{- toYaml (omit .Values.snsWorker.probes.readiness "enabled") | nindent 12 }}
{{- end }}
{{- end -}}