Skip to content

Commit 4c1dd66

Browse files
wmuldergovfatbird
authored andcommitted
DBC22-1788: Cache Django Media
Updating some resource values at same time to ensure capacity
1 parent 1b91e75 commit 4c1dd66

File tree

5 files changed

+27
-37
lines changed

5 files changed

+27
-37
lines changed

compose/frontend/default.conf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,20 @@ server {
3232
add_header X-Proxy-Cache $upstream_cache_status;
3333
}
3434

35+
location /django-media/ {
36+
proxy_ssl_server_name on;
37+
proxy_pass http://{ENVIRONMENT}-django;
38+
proxy_connect_timeout 5s;
39+
proxy_cache_background_update on;
40+
proxy_cache_lock on;
41+
proxy_cache_lock_age 10s;
42+
proxy_cache_lock_timeout 10s;
43+
proxy_cache_revalidate on;
44+
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
45+
proxy_cache_valid 200 1d;
46+
add_header X-Proxy-Cache $upstream_cache_status;
47+
}
48+
3549
# redirect server error pages to the static page /50x.html
3650
#
3751
error_page 500 502 503 504 /50x.html;

infrastructure/_django/templates/django-route.yaml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -43,30 +43,6 @@ spec:
4343
host: {{ .Values.route.host }}
4444
path: /django-static/
4545

46-
---
47-
apiVersion: route.openshift.io/v1
48-
kind: Route
49-
metadata:
50-
name: {{ template "app.fullname" . }}-backend-media
51-
labels: {{ include "app.labels" . | nindent 4 }}
52-
{{ if .Values.route.iprestricted }}
53-
annotations:
54-
haproxy.router.openshift.io/ip_whitelist: {{ .Values.route.ipallowlist }}
55-
{{ end }}
56-
spec:
57-
to:
58-
kind: Service
59-
name: {{ template "app.fullname" . }}
60-
port:
61-
targetPort: 80-tcp
62-
tls:
63-
termination: edge
64-
insecureEdgeTerminationPolicy: Redirect
65-
wildcardPolicy: None
66-
host: {{ .Values.route.host }}
67-
path: /django-media/
68-
69-
7046
---
7147
apiVersion: route.openshift.io/v1
7248
kind: Route

infrastructure/main/values-prod.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ image-caching:
6464
resources:
6565
requests:
6666
cpu: 50m
67-
memory: 50Mi
67+
memory: 100Mi
6868
limits:
6969
cpu: 250m
70-
memory: 100Mi
70+
memory: 150Mi
7171
env:
7272
imagecachingConfigMap: prod-drivebc-image-caching
7373
autoscaling:
@@ -92,7 +92,7 @@ redis:
9292
cpu: 50m
9393
memory: 50Mi
9494
limits:
95-
cpu: 100m
95+
cpu: 200m
9696
memory: 100Mi
9797

9898
static:
@@ -106,10 +106,10 @@ static:
106106
resources:
107107
requests:
108108
cpu: 50m
109-
memory: 50Mi
110-
limits:
111-
cpu: 150m
112109
memory: 100Mi
110+
limits:
111+
cpu: 250m
112+
memory: 150Mi
113113
env:
114114
staticConfigMap: prod-drivebc-static
115115
staticSecret: prod-drivebc-static

infrastructure/main/values-test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,11 @@ static:
105105
deployment:
106106
resources:
107107
requests:
108-
cpu: 20m
109-
memory: 50Mi
110-
limits:
111-
cpu: 150m
108+
cpu: 50m
112109
memory: 100Mi
110+
limits:
111+
cpu: 250m
112+
memory: 150Mi
113113
env:
114114
staticConfigMap: test-drivebc-static
115115
staticSecret: test-drivebc-static

infrastructure/main/values-uat.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ image-caching:
6464
resources:
6565
requests:
6666
cpu: 50m
67-
memory: 50Mi
67+
memory: 100Mi
6868
limits:
6969
cpu: 250m
70-
memory: 100Mi
70+
memory: 150Mi
7171
env:
7272
imagecachingConfigMap: uat-drivebc-image-caching
7373
autoscaling:
@@ -92,7 +92,7 @@ redis:
9292
cpu: 50m
9393
memory: 50Mi
9494
limits:
95-
cpu: 100m
95+
cpu: 200m
9696
memory: 100Mi
9797

9898
static:

0 commit comments

Comments
 (0)