Commit fd090d2e authored by Kenzo-Hugo Hillion's avatar Kenzo-Hugo Hillion
Browse files

Externalize django static from backend on kubernetes

add missing volume in django static yaml kubernetes
parent d7ea4910
Pipeline #31571 passed with stages
in 3 minutes and 1 second
......@@ -26,6 +26,9 @@ kubectl -n ${NAMESPACE} wait --for=condition=available --timeout=600s deployment
## Backend
envsubst < ci/kubernetes/backend.yaml | kubectl apply -n ${NAMESPACE} -f -
kubectl -n ${NAMESPACE} patch deployment backend -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
## Django static
envsubst < ci/kubernetes/django-static.yaml | kubectl apply -n ${NAMESPACE} -f -
kubectl -n ${NAMESPACE} patch deployment django-static -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}"
## Celery worker
# envsubst < ci/kubernetes/celery-worker.yaml | kubectl apply -n ${NAMESPACE} -f -
## Frontend
......
......@@ -63,21 +63,6 @@ spec:
volumeMounts:
- name: static-data
mountPath: /code/public/static
- name: django-static-app
image: $CI_REGISTRY_IMAGE/django-static:${CI_COMMIT_REF_NAME}
imagePullPolicy: Always
ports:
- containerPort: 80
resources:
requests:
memory: "64Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "100m"
volumeMounts:
- name: static-data
mountPath: /usr/src/app/static/
imagePullSecrets:
- name: registry-gitlab
volumes:
......@@ -100,9 +85,5 @@ spec:
protocol: TCP
port: 8000
targetPort: 8000
- name: django-static
protocol: TCP
port: 8080
targetPort: 80
selector:
app: backend
apiVersion: apps/v1
kind: Deployment
metadata:
name: django-static
labels:
app: django-static
spec:
replicas: 1
selector:
matchLabels:
app: django-static
template:
metadata:
labels:
app: django-static
spec:
containers:
- name: django-static-app
image: $CI_REGISTRY_IMAGE/django-static:${CI_COMMIT_REF_NAME}
imagePullPolicy: Always
ports:
- containerPort: 80
resources:
requests:
memory: "64Mi"
cpu: "50m"
limits:
memory: "128Mi"
cpu: "100m"
volumeMounts:
- name: static-data
mountPath: /usr/src/app/static/
volumes:
- name: static-data
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: django-static
labels:
app: django-static
spec:
type: ClusterIP
ports:
- name: django-static-app
protocol: TCP
port: 8080
targetPort: 80
selector:
app: django-static
......@@ -21,7 +21,7 @@ spec:
servicePort: 8000
- path: /static
backend:
serviceName: backend
serviceName: django-static
servicePort: 8080
- path: /api
backend:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment