Skip to content

Commit ff80ddf

Browse files
committed
feat: add k8s integration for tutor paragon static hosting
1 parent 39ff9fe commit ff80ddf

File tree

3 files changed

+63
-0
lines changed

3 files changed

+63
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{% if PARAGON_SERVE_COMPILED_THEMES %}
2+
{% if not PARAGON_ENABLED_THEMES %} {% set PARAGON_ENABLED_THEMES = ['light'] %} {% endif %}
3+
---
4+
apiVersion: apps/v1
5+
kind: Deployment
6+
metadata:
7+
name: paragon-statics
8+
namespace: openedx
9+
labels:
10+
app.kubernetes.io/name: paragon-statics
11+
spec:
12+
replicas: 1
13+
selector:
14+
matchLabels:
15+
app.kubernetes.io/name: paragon-statics
16+
template:
17+
metadata:
18+
labels:
19+
app.kubernetes.io/name: paragon-statics
20+
spec:
21+
containers:
22+
- name: nginx
23+
image: {{ PARAGON_STATIC_SERVER_IMAGE }}
24+
volumeMounts:
25+
- name: static-files
26+
mountPath: /usr/share/nginx/html
27+
readOnly: true
28+
volumes:
29+
- name: static-files
30+
configMap:
31+
name: paragon-static-files
32+
items:
33+
- key: core.min.css
34+
path: core/core.min.css
35+
{% for theme in PARAGON_ENABLED_THEMES %}
36+
- key: {{ theme }}.min.css
37+
path: themes/{{ theme }}/{{ theme }}.min.css
38+
{% endfor %}
39+
{% endif %}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{% if PARAGON_SERVE_COMPILED_THEMES %}
2+
---
3+
apiVersion: v1
4+
kind: Service
5+
metadata:
6+
name: paragon-statics
7+
namespace: openedx
8+
spec:
9+
selector:
10+
app.kubernetes.io/name: paragon-statics
11+
ports:
12+
- port: 80
13+
targetPort: 80
14+
{% endif %}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{% if PARAGON_SERVE_COMPILED_THEMES %}
2+
{% if not PARAGON_ENABLED_THEMES %} {% set PARAGON_ENABLED_THEMES = ['light'] %} {% endif %}
3+
- name: paragon-static-files
4+
files:
5+
- core.min.css=../{{ PARAGON_COMPILED_THEMES_PATH }}/core/core.min.css {% for theme in PARAGON_ENABLED_THEMES %}
6+
- {{ theme }}.min.css=../{{ PARAGON_COMPILED_THEMES_PATH }}/themes/{{ theme }}/{{ theme }}.min.css{% endfor %}
7+
options:
8+
labels:
9+
app.kubernetes.io/name: paragon-static-files
10+
{% endif %}

0 commit comments

Comments
 (0)