Skip to content

Commit

Permalink
Update osmcha deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Dec 19, 2023
1 parent d575ed5 commit 9ec396b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion images/osmcha-web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ RUN sed -i "s|https://osmcha.org|$OSMCHA_URL|g" package.json
RUN yarn build:${BUILD_ENV}

FROM nginx:alpine
COPY --from=builder /app/build /assets
COPY --from=builder /app/build /assets
8 changes: 0 additions & 8 deletions images/osmcha-web/start.sh

This file was deleted.

5 changes: 0 additions & 5 deletions images/osmcha-web/supervisord.conf

This file was deleted.

7 changes: 5 additions & 2 deletions osm-seed/templates/osmcha-app/configMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ data:
DJANGO_DEBUG: "False"
DJANGO_ENV: "production"
# OSM_SERVER_URL: {{ .Values.osmchaApi.env.OSM_SERVER_URL | quote }}
REDIS_URL: {{ .Release.Name }}-osmcha-redis
REDIS_URL: "redis://{{ .Release.Name }}-osmcha-redis:6379"
---
apiVersion: v1
kind: ConfigMap
Expand All @@ -42,14 +42,17 @@ data:
}
http {
access_log /dev/stdout;
error_log /dev/stderr;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
# access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
Expand Down
9 changes: 8 additions & 1 deletion osm-seed/templates/osmcha-app/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,17 @@ spec:
runAsUser: 0
containers:
- name: osmcha-api
securityContext:
runAsUser: 0
image: "{{ .Values.osmchaApi.image.name }}:{{ .Values.osmchaApi.image.tag }}"
command:
- /bin/sh
- -c
- |
set -x
gunicorn --workers 4 --bind 0.0.0.0:5000 --log-file log-file.log --access-logfile access-logfile.log config.wsgi
pip install git+https://github.com/OpenHistoricalMap/social-core.git &&
sed -i "s|https://api.openhistoricalmap.org/api/0.6/user/details|https://www.openhistoricalmap.org/api/0.6/user/details|g" /usr/local/lib/python3.10/site-packages/social_core/backends/openstreetmap.py
gunicorn --workers 4 --bind 0.0.0.0:5000 --log-file - --access-logfile - config.wsgi
ports:
- containerPort: 5000
livenessProbe:
Expand All @@ -74,8 +78,11 @@ spec:
memory: {{ .Values.osmchaApi.resources.limits.memory }}
cpu: {{ .Values.osmchaApi.resources.limits.cpu }}
{{- end }}

- name: osmcha-nginx
image: "{{ .Values.osmchaWeb.image.name }}:{{ .Values.osmchaWeb.image.tag }}"
ports:
- containerPort: 80
volumeMounts:
- name: osmcha-frontend-nginx-config
mountPath: /etc/nginx
Expand Down
12 changes: 9 additions & 3 deletions osm-seed/templates/osmcha-app/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ metadata:
release: {{ .Release.Name }}
annotations:
{{- if and (eq .Values.serviceType "LoadBalancer") .Values.AWS_SSL_ARN }}
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: {{ .Values.AWS_SSL_ARN }}
# service.beta.kubernetes.io/aws-load-balancer-ssl-cert: {{ .Values.AWS_SSL_ARN }}
# service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
# service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https
meta.helm.sh/release-name: dev
meta.helm.sh/release-namespace: default
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: http
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https
service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout: "300"
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:us-east-1:618380242247:certificate/9bc4e15c-2652-47ed-bfa8-3e078d708b87
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: https
{{- end }}
{{- if eq .Values.serviceType "ClusterIP" }}
kubernetes.io/ingress.class: nginx
Expand All @@ -32,7 +38,7 @@ spec:
name: http
{{- if and (eq .Values.serviceType "LoadBalancer") .Values.AWS_SSL_ARN }}
- port: 443
targetPort: http
targetPort: 80
protocol: TCP
name: https
{{- end }}
Expand Down

0 comments on commit 9ec396b

Please sign in to comment.