-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathdeployment.yml
86 lines (86 loc) · 2.19 KB
/
deployment.yml
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
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: worker
annotations:
description: AntiNex API Consumers - Celery Django Rest Framework Backend Worker
runtime: python3
labels:
app: worker
purpose: worker
layer: backend
messaging: redis
cache: redis
pubsub: consumer
spec:
replicas: 1
selector:
matchLabels:
app: worker
backend: enabled
template:
metadata:
labels:
app: worker
purpose: worker
layer: backend
messaging: redis
cache: redis
pubsub: consumer
backend: enabled
spec:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: backend
operator: In
values:
- enabled
hostname: worker
restartPolicy: Always
containers:
- image: jayjohnson/antinex-worker:latest
imagePullPolicy: Always
name: worker
resources: {}
command:
- /bin/bash
- -c
- cd /opt/antinex/api &&
. /opt/venv/bin/activate &&
source /opt/antinex/api/envs/k8.env &&
export WORKER_EXTRA_ARGS="--without-heartbeat --without-gossip" &&
/opt/antinex/api/run-worker.sh &&
tail -f /var/log/antinex/api/worker.log
env:
- name: POSTGRES_USER
valueFrom:
secretKeyRef:
name: worker.db
key: username
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: worker.db
key: password
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
name: worker.db
key: dbname
- name: S3_ACCESS_KEY
valueFrom:
secretKeyRef:
name: minio-s3-access
key: access_key
- name: S3_SECRET_KEY
valueFrom:
secretKeyRef:
name: minio-s3-access
key: secret_key
- name: S3_ADDRESS
value: minio-service:9000
- name: S3_REGION_NAME
value: us-east-1