From 1845462810b76354f625fd86d4853148fc7ca0ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Torma=20Krist=C3=B3f?= <tormakristof@tormakristof.eu>
Date: Wed, 3 Feb 2021 16:45:14 +0100
Subject: [PATCH] update static files as well

---
 k8s/deployment.yml | 56 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)

diff --git a/k8s/deployment.yml b/k8s/deployment.yml
index 8ec6fca..5cd1c9d 100644
--- a/k8s/deployment.yml
+++ b/k8s/deployment.yml
@@ -1,6 +1,62 @@
 ---
 apiVersion: apps/v1
 kind: Deployment
+metadata:
+  name: apache-static
+  namespace: devteam-kszk-bme-hu
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: apache-kszkepzes
+  template:
+    metadata:
+      labels:
+        app: apache-kszkepzes
+    spec:
+      initContainers:
+        - name: volume-mount-hack
+          image: busybox
+          command: ['sh', '-c', 'chown -R 1000:1000 /staticfiles']
+          volumeMounts:
+            - name: kszkepzes-static-volume
+              mountPath: /staticfiles
+        - name: kszkepzes-backend-collectstatic
+          image: registry.kszk.bme.hu/kszk/devteam/kszkepzes-backend:##IMAGETAG##
+          imagePullPolicy: 'Always'
+          command: ['python', 'manage.py', 'collectstatic', '--noinput']
+          volumeMounts:
+            - mountPath: /home/app/kszkepzes-backend/staticfiles
+              name: kszkepzes-static-volume
+          envFrom:
+            - configMapRef:
+                name: kszkepzes-config
+            - secretRef:
+                name: kszkepzes-secret-config
+        - name: volume-mount-hack-backwards
+          image: busybox
+          command: ['sh', '-c', 'chown -R 0:0 /staticfiles']
+          volumeMounts:
+            - name: kszkepzes-static-volume
+              mountPath: /staticfiles
+      containers:
+        - name: apache-kszkepzes
+          image: httpd:2
+          imagePullPolicy: 'Always'
+          volumeMounts:
+            - mountPath: /usr/local/apache2/htdocs/staticfiles
+              name: kszkepzes-static-volume
+          ports:
+            - containerPort: 80
+      volumes:
+        - name: kszkepzes-static-volume
+          persistentVolumeClaim:
+            claimName: kszkepzes-static-pv-claim
+      imagePullSecrets:
+        - name: kszkepzes-regcred
+---
+apiVersion: apps/v1
+kind: Deployment
 metadata:
   name: kszkepzes-backend
   namespace: devteam-kszk-bme-hu
-- 
GitLab