Skip to content

Commit

Permalink
Update osmcha config
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Jan 2, 2024
1 parent 25b30b6 commit 2fc5663
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 108 deletions.
3 changes: 1 addition & 2 deletions images/osmcha-web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ ENV REACT_APP_PRODUCTION_API_URL=/api/v1
RUN apt-get update && apt-get install -y git
RUN mkdir /app
WORKDIR /app
RUN git clone https://github.com/Rub21/osmcha-frontend.git /app
RUN git checkout env/realchangesets
RUN git clone https://github.com/osmus/osmcha-frontend.git /app
RUN yarn install
COPY start.sh .
CMD [ "/app/start.sh" ]
26 changes: 15 additions & 11 deletions osm-seed/templates/osmcha-app/configMap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,15 @@ data:
OSM_SERVER_URL: {{ .Values.osmchaApi.env.OSM_SERVER_URL | quote }}
DJANGO_DEBUG: "False"
DJANGO_ENV: "production"
REDIS_URL: "redis://{{ .Release.Name }}-osmcha-redis:6379"
REDIS_URL: "redis://localhost:6379"
OSM_PLANET_BASE_URL: {{ .Values.osmchaApi.env.OSM_PLANET_BASE_URL | quote }}
# frontend
OSMCHA_URL: {{ .Values.osmchaApi.env.OSMCHA_URL | quote }}
OSMCHA_API_URL: {{ .Values.osmchaApi.env.OSMCHA_API_URL | quote }}
REACT_APP_OSM_URL: {{ .Values.osmchaApi.env.REACT_APP_OSM_URL | quote }}
REACT_APP_OSM_API: {{ .Values.osmchaApi.env.REACT_APP_OSM_API | quote }}
REACT_APP_OVERPASS_BASE: {{ .Values.osmchaApi.env.REACT_APP_OVERPASS_BASE | quote }}
REACT_APP_ENABLE_REAL_CHANGESETS: {{ .Values.osmchaApi.env.REACT_APP_ENABLE_REAL_CHANGESETS | quote }}
REACT_APP_DISABLE_REAL_CHANGESETS: {{ .Values.osmchaApi.env.REACT_APP_DISABLE_REAL_CHANGESETS | quote }}
REACT_APP_MAPBOX_ACCESS_TOKEN: {{ .Values.osmchaApi.env.REACT_APP_MAPBOX_ACCESS_TOKEN | quote }}
---
apiVersion: v1
Expand All @@ -49,17 +49,14 @@ 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 All @@ -83,22 +80,29 @@ data:
location @proxy_to_frontend {
root /assets;
try_files $uri @django;
try_files $uri $uri/ =404;
}
location / {
root /assets;
# checks for static file, if not found proxy to app
location /api {
try_files $uri $uri/ @django;
}
location /admin {
try_files $uri $uri/ @django;
}
# cookiecutter-django app
location @django {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://app;
}
location / {
root /assets;
# checks for static file, if not found proxy to app
try_files $uri $uri/ /index.html;
}
}
}
mime.types: |
Expand Down
4 changes: 4 additions & 0 deletions osm-seed/templates/osmcha-app/cronJob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,8 @@ spec:
- configMapRef:
name: {{ .Release.Name }}-osmcha-common-env
restartPolicy: Never
{{- if .Values.osmchaApi.nodeSelector.enabled }}
nodeSelector:
{{ .Values.osmchaApi.nodeSelector.label_key }} : {{ .Values.osmchaApi.nodeSelector.label_value }}
{{- end }}
{{- end }}
4 changes: 4 additions & 0 deletions osm-seed/templates/osmcha-app/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ spec:
mountPath: /staticfiles
- name: nginx-assets
mountPath: /assets
- name: redis
image: "redis:latest"
ports:
- containerPort: 6379
volumes:
- name: staticfiles
emptyDir: {}
Expand Down
8 changes: 7 additions & 1 deletion osm-seed/templates/osmcha-app/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ 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-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" }}
Expand Down
22 changes: 0 additions & 22 deletions osm-seed/templates/osmcha-redis/deployment.yaml

This file was deleted.

14 changes: 0 additions & 14 deletions osm-seed/templates/osmcha-redis/service.yaml

This file was deleted.

105 changes: 47 additions & 58 deletions osm-seed/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,54 +205,54 @@ dbBackupRestore:
name: "developmentseed/osmseed-backup-restore"
tag: "0.1.0-0.dev.git.942.h994af82"
cronjobs:
- name: web-db
- name: web-db
enabled: false
schedule: "* * * * *"
env:
# DB action: backup/restore
DB_ACTION: backup
# Naming backup files
SET_DATE_AT_NAME: true
BACKUP_CLOUD_FOLDER: database/web-db
BACKUP_CLOUD_FILE: osmseed-api-web-db
AWS_S3_BUCKET: secure-bucket
# Clean up backups options
CLEANUP_BACKUPS: true
RETENTION_DAYS: "30"
resources:
enabled: false
schedule: "* * * * *"
env:
# DB action: backup/restore
DB_ACTION: backup
# Naming backup files
SET_DATE_AT_NAME: true
BACKUP_CLOUD_FOLDER: database/web-db
BACKUP_CLOUD_FILE: osmseed-api-web-db
AWS_S3_BUCKET: secure-bucket
# Clean up backups options
CLEANUP_BACKUPS: true
RETENTION_DAYS: "30"
resources:
enabled: false
requests:
memory: "300Mi"
cpu: "0.5"
limits:
memory: "400Mi"
cpu: "0.6"
nodeSelector:
enabled: false
- name: osmcha-db
requests:
memory: "300Mi"
cpu: "0.5"
limits:
memory: "400Mi"
cpu: "0.6"
nodeSelector:
enabled: false
- name: osmcha-db
enabled: false
schedule: "* * * * *"
env:
# DB action: backup/restore
DB_ACTION: backup
# Naming backup files
SET_DATE_AT_NAME: true
BACKUP_CLOUD_FOLDER: database/osmcha-db
BACKUP_CLOUD_FILE: osmseed-osmcha-db
AWS_S3_BUCKET: secure-bucket
# Clean up backups options
CLEANUP_BACKUPS: true
RETENTION_DAYS: "30"
resources:
enabled: false
requests:
memory: "300Mi"
cpu: "0.5"
limits:
memory: "400Mi"
cpu: "0.6"
nodeSelector:
enabled: false
schedule: "* * * * *"
env:
# DB action: backup/restore
DB_ACTION: backup
# Naming backup files
SET_DATE_AT_NAME: true
BACKUP_CLOUD_FOLDER: database/osmcha-db
BACKUP_CLOUD_FILE: osmseed-osmcha-db
AWS_S3_BUCKET: secure-bucket
# Clean up backups options
CLEANUP_BACKUPS: true
RETENTION_DAYS: "30"
resources:
enabled: false
requests:
memory: "300Mi"
cpu: "0.5"
limits:
memory: "400Mi"
cpu: "0.6"
nodeSelector:
enabled: false

# ====================================================================================================
# Variables for osm-seed for osmosis, this configuration os to get the planet dump files from apidb
Expand Down Expand Up @@ -754,11 +754,11 @@ changesetReplicationJob:
# ====================================================================================================
# Variables for osmcha web builder
# ====================================================================================================

osmchaWeb:
enabled: true
image:
name: ""
tag: ""
# ====================================================================================================
# Variables for osmcha Api
# ====================================================================================================
Expand Down Expand Up @@ -827,14 +827,3 @@ osmchaDb:
GCP_gcePersistentDisk_size: 50Gi
nodeSelector:
enabled: false
# ====================================================================================================
# Variables for osmcha redis
# ====================================================================================================

osmchaRedis:
enabled: true
image:
name: "redis"
tag: "latest"
port: 6379
replicaCount: 1

0 comments on commit 2fc5663

Please sign in to comment.