From 750e9e60880484d4afd3fff6d4e1fbfa3885b74b Mon Sep 17 00:00:00 2001
From: Tom Teichler <tom.teichler@teckids.org>
Date: Tue, 9 Apr 2024 18:54:27 +0200
Subject: [PATCH] Use kubeconfig from variable

---
 .gitlab-ci.yml      |  3 +-
 deploy/ingress.yaml | 67 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 68 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index cb5ecb6c..adb548c6 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -39,6 +39,7 @@ deploy docker image:
   stage: deploy
   image: bitnami/kubectl:latest
   script:
+    - echo $KUBECONFIG | base64 -d > /tmp/kubeconfig
     - cd deploy
     - sed -i s/IMAGE_TAG/$CI_COMMIT_REF_NAME@$(cat ../DIGESTFILE)/g deployment.yaml
-    - for file in *; do kubectl apply -f $file; done
+    - for file in *; do kubectl --kubeconfig=/tmp/kubeconfig apply -f $file; done
diff --git a/deploy/ingress.yaml b/deploy/ingress.yaml
index 9dd88ddd..a7d713b0 100644
--- a/deploy/ingress.yaml
+++ b/deploy/ingress.yaml
@@ -29,9 +29,74 @@ spec:
               number: 80
         path: /
         pathType: Prefix
-
+  - host: hacknsun.camp
+    http:
+      paths:
+      - backend:
+          service:
+            name: teckids-website
+            port:
+              number: 80
+        path: /
+        pathType: Prefix
+  - host: www.hacknsun.camp
+    http:
+      paths:
+      - backend:
+          service:
+            name: teckids-website
+            port:
+              number: 80
+        path: /
+        pathType: Prefix
+  - host: hacknfun.camp
+    http:
+      paths:
+      - backend:
+          service:
+            name: teckids-website
+            port:
+              number: 80
+        path: /
+        pathType: Prefix
+  - host: www.hacknfun.camp
+    http:
+      paths:
+      - backend:
+          service:
+            name: teckids-website
+            port:
+              number: 80
+        path: /
+        pathType: Prefix
+  - host: teckids.de
+    http:
+      paths:
+      - backend:
+          service:
+            name: teckids-website
+            port:
+              number: 80
+        path: /
+        pathType: Prefix
+  - host: www.teckids.de
+    http:
+      paths:
+      - backend:
+          service:
+            name: teckids-website
+            port:
+              number: 80
+        path: /
+        pathType: Prefix
   tls:
   - hosts:
     - teckids.org
     - www.teckids.org
+    - hacknsun.camp
+    - www.hacknsun.camp
+    - hacknfun.camp
+    - www.hacknfun.camp
+    - teckids.de
+    - www.teckids.de
     secretName: teckids-website-tls
-- 
GitLab