2018-12-13 06:28:33 +01:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: nginx
|
|
|
|
spec:
|
|
|
|
replicas: 1
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: nginx
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: nginx
|
|
|
|
spec:
|
2019-01-04 10:24:49 +01:00
|
|
|
initContainers:
|
|
|
|
- name: clean-openedx-staticfiles
|
|
|
|
image: regis/openedx:hawthorn
|
|
|
|
command: ['rm', '-rf', '/var/www/openedx/staticfiles']
|
|
|
|
volumeMounts:
|
|
|
|
- mountPath: /var/www/openedx/
|
|
|
|
name: openedx-staticfiles
|
|
|
|
imagePullPolicy: Always
|
|
|
|
- name: init-openedx-staticfiles
|
|
|
|
image: regis/openedx:hawthorn
|
|
|
|
command: ['cp', '-r', '/openedx/staticfiles', '/var/www/openedx/']
|
|
|
|
volumeMounts:
|
|
|
|
- mountPath: /var/www/openedx/
|
|
|
|
name: openedx-staticfiles
|
|
|
|
imagePullPolicy: Always
|
2018-12-13 06:28:33 +01:00
|
|
|
containers:
|
|
|
|
- name: nginx
|
2019-01-04 10:24:49 +01:00
|
|
|
image: nginx:1.13
|
2018-12-13 06:28:33 +01:00
|
|
|
volumeMounts:
|
|
|
|
- mountPath: /etc/nginx/conf.d/
|
|
|
|
name: config
|
2019-01-04 10:24:49 +01:00
|
|
|
- mountPath: /var/www/openedx/
|
|
|
|
name: openedx-staticfiles
|
2018-12-13 06:28:33 +01:00
|
|
|
- mountPath: /openedx/data/lms
|
|
|
|
name: data
|
|
|
|
ports:
|
|
|
|
- containerPort: 80
|
|
|
|
name: http-port
|
|
|
|
- containerPort: 443
|
|
|
|
name: https-port
|
|
|
|
volumes:
|
|
|
|
- name: config
|
|
|
|
configMap:
|
|
|
|
name: nginx-config
|
2019-01-04 10:24:49 +01:00
|
|
|
- name: openedx-staticfiles
|
|
|
|
persistentVolumeClaim:
|
|
|
|
claimName: openedx-staticfiles
|
2018-12-13 06:28:33 +01:00
|
|
|
- name: data
|
|
|
|
persistentVolumeClaim:
|
|
|
|
claimName: lms-data
|