diff --git a/compose/frontend/default.conf b/compose/frontend/default.conf index fafe1b3ca..026bfd1e2 100644 --- a/compose/frontend/default.conf +++ b/compose/frontend/default.conf @@ -32,6 +32,20 @@ server { add_header X-Proxy-Cache $upstream_cache_status; } + location /django-media/ { + proxy_ssl_server_name on; + proxy_pass http://{ENVIRONMENT}-django; + proxy_connect_timeout 5s; + proxy_cache_background_update on; + proxy_cache_lock on; + proxy_cache_lock_age 10s; + proxy_cache_lock_timeout 10s; + proxy_cache_revalidate on; + proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504; + proxy_cache_valid 200 1h; + add_header X-Proxy-Cache $upstream_cache_status; + } + # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; diff --git a/infrastructure/_django/templates/django-route.yaml b/infrastructure/_django/templates/django-route.yaml index 98e9aae70..4926b9bd2 100644 --- a/infrastructure/_django/templates/django-route.yaml +++ b/infrastructure/_django/templates/django-route.yaml @@ -43,30 +43,6 @@ spec: host: {{ .Values.route.host }} path: /django-static/ ---- -apiVersion: route.openshift.io/v1 -kind: Route -metadata: - name: {{ template "app.fullname" . }}-backend-media - labels: {{ include "app.labels" . | nindent 4 }} -{{ if .Values.route.iprestricted }} - annotations: - haproxy.router.openshift.io/ip_whitelist: {{ .Values.route.ipallowlist }} -{{ end }} -spec: - to: - kind: Service - name: {{ template "app.fullname" . }} - port: - targetPort: 80-tcp - tls: - termination: edge - insecureEdgeTerminationPolicy: Redirect - wildcardPolicy: None - host: {{ .Values.route.host }} - path: /django-media/ - - --- apiVersion: route.openshift.io/v1 kind: Route diff --git a/infrastructure/main/values-prod.yaml b/infrastructure/main/values-prod.yaml index 1be5fb923..567570fac 100644 --- a/infrastructure/main/values-prod.yaml +++ b/infrastructure/main/values-prod.yaml @@ -64,10 +64,10 @@ image-caching: resources: requests: cpu: 50m - memory: 50Mi + memory: 100Mi limits: cpu: 250m - memory: 100Mi + memory: 150Mi env: imagecachingConfigMap: prod-drivebc-image-caching autoscaling: @@ -92,7 +92,7 @@ redis: cpu: 50m memory: 50Mi limits: - cpu: 100m + cpu: 200m memory: 100Mi static: @@ -106,10 +106,10 @@ static: resources: requests: cpu: 50m - memory: 50Mi - limits: - cpu: 150m memory: 100Mi + limits: + cpu: 250m + memory: 150Mi env: staticConfigMap: prod-drivebc-static staticSecret: prod-drivebc-static diff --git a/infrastructure/main/values-test.yaml b/infrastructure/main/values-test.yaml index 64537bcb8..b4fbb3c12 100644 --- a/infrastructure/main/values-test.yaml +++ b/infrastructure/main/values-test.yaml @@ -105,11 +105,11 @@ static: deployment: resources: requests: - cpu: 20m - memory: 50Mi - limits: - cpu: 150m + cpu: 50m memory: 100Mi + limits: + cpu: 250m + memory: 150Mi env: staticConfigMap: test-drivebc-static staticSecret: test-drivebc-static diff --git a/infrastructure/main/values-uat.yaml b/infrastructure/main/values-uat.yaml index fe4ad729c..b7f3303dc 100644 --- a/infrastructure/main/values-uat.yaml +++ b/infrastructure/main/values-uat.yaml @@ -64,10 +64,10 @@ image-caching: resources: requests: cpu: 50m - memory: 50Mi + memory: 100Mi limits: cpu: 250m - memory: 100Mi + memory: 150Mi env: imagecachingConfigMap: uat-drivebc-image-caching autoscaling: @@ -92,7 +92,7 @@ redis: cpu: 50m memory: 50Mi limits: - cpu: 100m + cpu: 200m memory: 100Mi static: