Skip to content

Commit fa6fabc

Browse files
committed
Update osmcha deployment to the new version
1 parent 22aa86b commit fa6fabc

File tree

1 file changed

+19
-52
lines changed

1 file changed

+19
-52
lines changed

osm-seed/templates/osmcha-app/deployment.yaml

Lines changed: 19 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -23,50 +23,23 @@ spec:
2323
run: {{ .Release.Name }}-osmcha-app
2424
spec:
2525
initContainers:
26-
- name: web-builder
27-
image: "{{ .Values.osmchaWeb.image.name }}:{{ .Values.osmchaWeb.image.tag }}"
28-
envFrom:
29-
- configMapRef:
30-
name: {{ .Release.Name }}-osmcha-common-env
31-
volumeMounts:
32-
- name: nginx-assets
33-
mountPath: /assets
34-
- name: migrations
26+
- name: osmcha-init
3527
image: "{{ .Values.osmchaApi.image.name }}:{{ .Values.osmchaApi.image.tag }}"
3628
command:
37-
- /bin/sh
38-
- -c
39-
- |
40-
set -x
41-
flag=true
42-
while "$flag" = true; do
43-
pg_isready -h $POSTGRES_HOST -p 5432 >/dev/null 2>&2 || continue
44-
flag=false
45-
python manage.py migrate
46-
python manage.py collectstatic --noinput
47-
mkdir -p /staticfiles/static
48-
cp -r /app/staticfiles/* /staticfiles/static/
49-
done
29+
- /bin/sh
30+
- -c
31+
- python manage.py migrate
32+
- python manage.py collectstatic --noinput
5033
envFrom:
5134
- configMapRef:
5235
name: {{ .Release.Name }}-osmcha-common-env
5336
volumeMounts:
5437
- name: staticfiles
55-
mountPath: /staticfiles
56-
# securityContext:
57-
# runAsUser: 0
38+
mountPath: /app/staticfiles
5839
containers:
59-
- name: api
60-
# securityContext:
61-
# runAsUser: 0
40+
- name: osmcha-api
6241
image: "{{ .Values.osmchaApi.image.name }}:{{ .Values.osmchaApi.image.tag }}"
63-
command:
64-
- /bin/sh
65-
- -c
66-
- |
67-
set -x
68-
echo "start app...."
69-
gunicorn --workers 4 --bind 0.0.0.0:5000 --log-file - --access-logfile - config.wsgi
42+
args: ["gunicorn", "config.wsgi", "-b", "0.0.0.0:5000", "--access-logfile", "-", "--timeout", "120", "--workers", "4", "--threads", "16"]
7043
ports:
7144
- containerPort: 5000
7245
livenessProbe:
@@ -75,12 +48,13 @@ spec:
7548
port: 5000
7649
initialDelaySeconds: 60
7750
timeoutSeconds: 30
78-
envFrom:
79-
- configMapRef:
80-
name: {{ .Release.Name }}-osmcha-common-env
51+
8152
volumeMounts:
8253
- name: staticfiles
8354
mountPath: /staticfiles
55+
envFrom:
56+
- configMapRef:
57+
name: {{ .Release.Name }}-osmcha-common-env
8458
{{- if .Values.osmchaApi.resources.enabled }}
8559
resources:
8660
requests:
@@ -91,31 +65,24 @@ spec:
9165
cpu: {{ .Values.osmchaApi.resources.limits.cpu }}
9266
{{- end }}
9367

94-
- name: nginx
95-
image: "nginx:latest"
68+
- name: frontend-nginx
69+
image: "{{ .Values.osmchaWeb.image.name }}:{{ .Values.osmchaWeb.image.tag }}"
9670
ports:
9771
- containerPort: 80
72+
env:
73+
- name: BACKEND_URL
74+
value: http://localhost:5000
9875
volumeMounts:
99-
- name: osmcha-frontend-nginx-config
100-
mountPath: /etc/nginx
101-
readOnly: true
10276
- name: staticfiles
103-
mountPath: /staticfiles
104-
- name: nginx-assets
105-
mountPath: /assets
77+
mountPath: /srv/www/static/django
78+
readOnly: true
10679
- name: redis
10780
image: "redis:latest"
10881
ports:
10982
- containerPort: 6379
11083
volumes:
11184
- name: staticfiles
11285
emptyDir: {}
113-
- name: nginx-assets
114-
emptyDir: {}
115-
- name: osmcha-frontend-nginx-config
116-
configMap:
117-
name: {{ .Release.Name }}-osmcha-nginx-config
118-
defaultMode: 0777
11986
{{- if .Values.osmchaApi.nodeSelector.enabled }}
12087
nodeSelector:
12188
{{ .Values.osmchaApi.nodeSelector.label_key }} : {{ .Values.osmchaApi.nodeSelector.label_value }}

0 commit comments

Comments
 (0)