forked from bcgov/zeva
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathk8s-celery.yaml
143 lines (143 loc) · 4.73 KB
/
k8s-celery.yaml
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
apiVersion: apps/v1
kind: Deployment
metadata:
name: celery-worker
spec:
replicas: 1
minReadySeconds: 20
template:
metadata:
name: celery-worker-pod
labels:
app: celery-worker
spec:
containers:
- name: celery-worker
image: django-backend
command: ['celery','worker','-A','zeva', '-l', 'info', '-E']
env:
- name: DATABASE_NAME
value: 'zeva'
- name: DATABASE_USER
value: 'zeva'
- name: DATABASE_PASSWORD
value: 'zevadev'
- name: DATABASE_ENGINE
value: 'postgresql'
- name: DATABASE_SERVICE_NAME
value: 'postgresql'
- name: POSTGRESQL_SERVICE_HOST
value: 'postgres'
- name: POSTGRESQL_SERVICE_PORT
value: '5432'
- name: KEYCLOAK_CERTS_URL
value: 'http://keycloak:8080/auth/realms/zeva/protocol/openid-connect/certs'
- name: KEYCLOAK_REALM
value: 'http://localhost:8888/auth/realms/zeva'
- name: KEYCLOAK_AUTHORITY
value: 'http://localhost:8888/auth/realms/zeva'
- name: KEYCLOAK_ISSUER
value: 'http://localhost:8888/auth/realms/zeva'
- name: KEYCLOAK_AUDIENCE
value: 'zeva-app'
- name: KEYCLOAK_CLIENT_ID
value: 'zeva-app'
- name: KEYCLOAK_SA_BASEURL
value: 'http://keycloak:8080'
- name: KEYCLOAK_SA_REALM
value: 'zeva'
- name: KEYCLOAK_SA_CLIENT_ID
value: 'zeva-app-sa'
- name: KEYCLOAK_SA_CLIENT_SECRET
value: '06dc71d6-1800-4f5d-b7b3-4c4fda226599'
- name: DJANGO_DEBUG
value: 'False' # this impacts celery logging too
- name: RABBITMQ_VHOST
value: '/zeva'
- name: RABBITMQ_USER
value: 'rabbitmq'
- name: RABBITMQ_PASSWORD
value: 'rabbitmq'
- name: RABBITMQ_HOST
value: 'rabbit'
- name: RABBITMQ_PORT
value: '5672'
initContainers:
- name: init-psql
image: busybox:1.28
command: ['sh', '-c', 'until nslookup postgres; do echo waiting for postgres; sleep 5; done;']
selector:
matchLabels:
app: celery-worker
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: celery-beat
spec:
replicas: 1
minReadySeconds: 20
template:
metadata:
name: celery-beat-pod
labels:
app: celery-beat
spec:
containers:
- name: celery-beat
image: django-backend
command: ['celery','beat','-A','zeva','-l', 'info']
env:
- name: DATABASE_NAME
value: 'zeva'
- name: DATABASE_USER
value: 'zeva'
- name: DATABASE_PASSWORD
value: 'zevadev'
- name: DATABASE_ENGINE
value: 'postgresql'
- name: DATABASE_SERVICE_NAME
value: 'postgresql'
- name: POSTGRESQL_SERVICE_HOST
value: 'postgres'
- name: POSTGRESQL_SERVICE_PORT
value: '5432'
- name: KEYCLOAK_CERTS_URL
value: 'http://keycloak:8080/auth/realms/zeva/protocol/openid-connect/certs'
- name: KEYCLOAK_REALM
value: 'http://localhost:8888/auth/realms/zeva'
- name: KEYCLOAK_AUTHORITY
value: 'http://localhost:8888/auth/realms/zeva'
- name: KEYCLOAK_ISSUER
value: 'http://localhost:8888/auth/realms/zeva'
- name: KEYCLOAK_AUDIENCE
value: 'zeva-app'
- name: KEYCLOAK_CLIENT_ID
value: 'zeva-app'
- name: KEYCLOAK_SA_BASEURL
value: 'http://keycloak:8080'
- name: KEYCLOAK_SA_REALM
value: 'zeva'
- name: KEYCLOAK_SA_CLIENT_ID
value: 'zeva-app-sa'
- name: KEYCLOAK_SA_CLIENT_SECRET
value: '06dc71d6-1800-4f5d-b7b3-4c4fda226599'
- name: DJANGO_DEBUG
value: 'False' # this impacts celery logging too
- name: RABBITMQ_VHOST
value: '/zeva'
- name: RABBITMQ_USER
value: 'rabbitmq'
- name: RABBITMQ_PASSWORD
value: 'rabbitmq'
- name: RABBITMQ_HOST
value: 'rabbit'
- name: RABBITMQ_PORT
value: '5672'
initContainers:
- name: init-psql
image: busybox:1.28
command: ['sh', '-c', 'until nslookup postgres; do echo waiting for postgres; sleep 5; done;']
selector:
matchLabels:
app: celery-beat