From 6de88c2364d2458c956d06aa979e1c0f5f4127a3 Mon Sep 17 00:00:00 2001 From: Jens7373 Date: Thu, 14 Aug 2025 08:09:52 +0000 Subject: [PATCH 01/18] Fixed frontend test --- frontend/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/main.go b/frontend/main.go index bede472b4..27f4da2a4 100644 --- a/frontend/main.go +++ b/frontend/main.go @@ -101,5 +101,5 @@ func main() { http.Handle("/", http.FileServer(http.Dir("./static"))) err := http.ListenAndServe(":8080", nil) - fmt.Println("%v", err) + fmt.Printf("%v", err) } From 78c48cc3a8a9d05c980283275993ad642494db58 Mon Sep 17 00:00:00 2001 From: Jeppe Holm Andersen <144018621+JeppeHA@users.noreply.github.com> Date: Thu, 14 Aug 2025 10:21:19 +0200 Subject: [PATCH 02/18] Github actions setup 0.1v --- .github/workflows/main.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..a35cbd5d4 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,9 @@ +name: simple-fortune-cookie +on: + push +jobs: + Build: + runs-on: go + steps: + - name: Test frontend + run: frontend/main_test.go From f907dfb7656dc99257940aec0ff980cc70fde655 Mon Sep 17 00:00:00 2001 From: Jeppe Holm Andersen <144018621+JeppeHA@users.noreply.github.com> Date: Thu, 14 Aug 2025 10:23:45 +0200 Subject: [PATCH 03/18] Github actions setup 0.2v --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a35cbd5d4..ac572cec7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,8 +2,8 @@ name: simple-fortune-cookie on: push jobs: - Build: - runs-on: go + Test: + runs-on: ubuntu-latest steps: - name: Test frontend - run: frontend/main_test.go + run: simple-fortune-cookie/frontend/main_test.go From 33e6bf33ef5e594b153a669c45b03467dd226a61 Mon Sep 17 00:00:00 2001 From: Jeppe Holm Andersen <144018621+JeppeHA@users.noreply.github.com> Date: Thu, 14 Aug 2025 10:27:30 +0200 Subject: [PATCH 04/18] Github actions setup 0.3v --- .github/workflows/main.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ac572cec7..ec28d569a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,5 +5,9 @@ jobs: Test: runs-on: ubuntu-latest steps: - - name: Test frontend - run: simple-fortune-cookie/frontend/main_test.go + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Test frontend + run: go test ./frontend/ + From 5f853206cb77b72deaf659b991df7fe76fd44c59 Mon Sep 17 00:00:00 2001 From: Jeppe Holm Andersen <144018621+JeppeHA@users.noreply.github.com> Date: Thu, 14 Aug 2025 10:35:15 +0200 Subject: [PATCH 05/18] Github actions setup 0.4v --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ec28d569a..8a058f781 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,7 @@ jobs: - name: Checkout repo uses: actions/checkout@v4 - - name: Test frontend - run: go test ./frontend/ + - name: Test Frontend + working-directory: frontend + run: go test ./... From df81dd164c318693daadf62c095d876ba106c732 Mon Sep 17 00:00:00 2001 From: Jeppe Holm Andersen <144018621+JeppeHA@users.noreply.github.com> Date: Thu, 14 Aug 2025 14:00:11 +0200 Subject: [PATCH 06/18] Dockerfiles and dockercompose file (#2) * Added new Dockerfiles to front and backend * Added composefile --------- Co-authored-by: Jens7373 --- backend/Dockerfile | 6 ++++++ docker-compose.yaml | 17 +++++++++++++++++ frontend/Dockerfile | 6 ++++++ 3 files changed, 29 insertions(+) create mode 100644 backend/Dockerfile create mode 100644 docker-compose.yaml create mode 100644 frontend/Dockerfile diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 000000000..0b7be642b --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,6 @@ +FROM golang:1.21-alpine AS builder +WORKDIR /app +COPY . /app +RUN go mod download && go mod verify +RUN cd /app && go build -o goapp +ENTRYPOINT ["./goapp"] \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 000000000..f89c51d63 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,17 @@ +services: + frontend-container: + image: frontenddocker + ports: + - 8080:8080 + depends_on: + - backend-container + environment: + BACKEND_PORT: 9000 + BACKEND_DNS: backend-container + + + backend-container: + image: backenddocker + ports: + - 9000:9000 + diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 000000000..0b7be642b --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,6 @@ +FROM golang:1.21-alpine AS builder +WORKDIR /app +COPY . /app +RUN go mod download && go mod verify +RUN cd /app && go build -o goapp +ENTRYPOINT ["./goapp"] \ No newline at end of file From 75dd559e25ceaeb6b3ff9ce6ecf38cd485d013ed Mon Sep 17 00:00:00 2001 From: Jeppe Holm Andersen <144018621+JeppeHA@users.noreply.github.com> Date: Thu, 14 Aug 2025 15:07:51 +0200 Subject: [PATCH 07/18] Docker Registry * Automatic docker push * Docker automatic push v2 * Docker automatic push v3 * Docker automatic push v4 * Docker automatic push v5 * Docker automatic push v6 --- .github/workflows/main.yml | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8a058f781..7a57552dd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,4 +11,32 @@ jobs: - name: Test Frontend working-directory: frontend run: go test ./... - + Dockerpush: + needs: Test + name: push dockerimage to dockerhub + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: login to docker hub + id: docker-hub + env: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + run: | + docker login -u $username -p $password + - name: build the frontend docker image + id: build-frontend-docker-image + run: | + ls -la + docker build frontend -t jeppeha/frontenddocker:latest + - name: push the frontend docker image + id: push-frontend-docker-image + run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/frontenddocker:latest + - name: build the backend docker image + id: build-backend-docker-image + run: | + ls -la + docker build backend -t jeppeha/backenddocker:latest + - name: push the backend docker image + id: push-backend-docker-image + run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/backenddocker:latest From 157ccb5b84c238282648c072e1192d1758f40c86 Mon Sep 17 00:00:00 2001 From: Jeppe Holm Andersen <144018621+JeppeHA@users.noreply.github.com> Date: Thu, 14 Aug 2025 15:27:58 +0200 Subject: [PATCH 08/18] Docker registry pull image from dockerhub * Automatic docker push * Docker automatic push v2 * Docker automatic push v3 * Docker automatic push v4 * Docker automatic push v5 * Docker automatic push v6 * Retrive image from dockerhub --- docker-compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index f89c51d63..abf002e9c 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,6 +1,6 @@ services: frontend-container: - image: frontenddocker + image: jeppeha/frontenddocker:latest ports: - 8080:8080 depends_on: @@ -11,7 +11,7 @@ services: backend-container: - image: backenddocker + image: jeppeha/backenddocker:latest ports: - 9000:9000 From 63064f9796f1d625584de30d10e70b4c376af638 Mon Sep 17 00:00:00 2001 From: Jeppe Holm Andersen <144018621+JeppeHA@users.noreply.github.com> Date: Thu, 14 Aug 2025 16:14:57 +0200 Subject: [PATCH 09/18] container-orchestration * Automatic docker push * Docker automatic push v2 * Docker automatic push v3 * Docker automatic push v4 * Docker automatic push v5 * Docker automatic push v6 * Retrive image from dockerhub * Container-orchestration --- backend-deployment.yaml | 18 ++++++++++++++++++ backend-svc.yaml | 11 +++++++++++ frontend-deployment.yaml | 24 ++++++++++++++++++++++++ frontend-svc.yaml | 11 +++++++++++ 4 files changed, 64 insertions(+) create mode 100644 backend-deployment.yaml create mode 100644 backend-svc.yaml create mode 100644 frontend-deployment.yaml create mode 100644 frontend-svc.yaml diff --git a/backend-deployment.yaml b/backend-deployment.yaml new file mode 100644 index 000000000..c9823e0f7 --- /dev/null +++ b/backend-deployment.yaml @@ -0,0 +1,18 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: backend +spec: + selector: + matchLabels: + app: backend + template: + metadata: + labels: + app: backend + spec: + containers: + - name: backend + image: jeppeha/backenddocker:latest + ports: + - containerPort: 9000 diff --git a/backend-svc.yaml b/backend-svc.yaml new file mode 100644 index 000000000..1bfe4e200 --- /dev/null +++ b/backend-svc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: backend-service +spec: + selector: + app: backend + ports: + - port: 9000 + targetPort: 9000 + type: ClusterIP \ No newline at end of file diff --git a/frontend-deployment.yaml b/frontend-deployment.yaml new file mode 100644 index 000000000..50db9c955 --- /dev/null +++ b/frontend-deployment.yaml @@ -0,0 +1,24 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: frontend +spec: + selector: + matchLabels: + app: frontend + template: + metadata: + labels: + app: frontend + spec: + containers: + - name: frontend + image: jeppeha/frontenddocker:latest + ports: + - containerPort: 8080 + env: + - name: BACKEND_DNS + value: backend-service + - name: BACKEND_PORT + value: "9000" + diff --git a/frontend-svc.yaml b/frontend-svc.yaml new file mode 100644 index 000000000..56123ab2e --- /dev/null +++ b/frontend-svc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: frontend-service +spec: + selector: + app: frontend + ports: + - port: 8080 + targetPort: 8080 + type: NodePort From 9f510f920e54ba8bf9755a848c35fb8a3eb63b60 Mon Sep 17 00:00:00 2001 From: Jens7373 <144002822+Jens7373@users.noreply.github.com> Date: Thu, 14 Aug 2025 16:23:00 +0200 Subject: [PATCH 10/18] Redis server added * Added redis deployment * Added redis deployment again --- redis-deployment.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 redis-deployment.yaml diff --git a/redis-deployment.yaml b/redis-deployment.yaml new file mode 100644 index 000000000..e5b60b287 --- /dev/null +++ b/redis-deployment.yaml @@ -0,0 +1,31 @@ +# redis-deployment.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: redis +spec: + replicas: 1 + selector: + matchLabels: + app: redis + template: + metadata: + labels: + app: redis + spec: + containers: + - REDIS_DNS: redis + image: redis:7-alpine + ports: + - containerPort: 6379 +--- +apiVersion: v1 +kind: Service +metadata: + name: redis +spec: + selector: + app: redis + ports: + - port: 6379 + targetPort: 6379 \ No newline at end of file From 29386808f483c09bcf6fe5092da9a629ee06e23c Mon Sep 17 00:00:00 2001 From: Jeppe Holm Andersen <144018621+JeppeHA@users.noreply.github.com> Date: Thu, 14 Aug 2025 17:34:02 +0200 Subject: [PATCH 11/18] Redis server with PVC * Added redis deployment * Added redis deployment again * Redis persitentsvolume --------- Co-authored-by: Jens7373 Co-authored-by: Jens7373 <144002822+Jens7373@users.noreply.github.com> --- backend-deployment.yaml | 3 +++ docker-compose.yaml | 13 +++++++++++++ redis-deployment.yaml | 22 +++++++++------------- redis-pvc.yaml | 11 +++++++++++ redis-svc.yaml | 11 +++++++++++ 5 files changed, 47 insertions(+), 13 deletions(-) create mode 100644 redis-pvc.yaml create mode 100644 redis-svc.yaml diff --git a/backend-deployment.yaml b/backend-deployment.yaml index c9823e0f7..b6851dbc1 100644 --- a/backend-deployment.yaml +++ b/backend-deployment.yaml @@ -16,3 +16,6 @@ spec: image: jeppeha/backenddocker:latest ports: - containerPort: 9000 + env: + - name: REDIS_DNS + value: redis-service \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index abf002e9c..431977718 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -14,4 +14,17 @@ services: image: jeppeha/backenddocker:latest ports: - 9000:9000 + depends_on: + - redis-container + environment: + REDIS_PORT: 6379 + REDIS_DNS: redis-container + + + redis-container: + image: redis:7-alpine + ports: + - 6379:6379 + + diff --git a/redis-deployment.yaml b/redis-deployment.yaml index e5b60b287..14f19cbf4 100644 --- a/redis-deployment.yaml +++ b/redis-deployment.yaml @@ -4,7 +4,6 @@ kind: Deployment metadata: name: redis spec: - replicas: 1 selector: matchLabels: app: redis @@ -13,19 +12,16 @@ spec: labels: app: redis spec: + volumes: + - name: redis-pvc + persistentVolumeClaim: + claimName: redis-pvc containers: - - REDIS_DNS: redis + - name: redis image: redis:7-alpine ports: - containerPort: 6379 ---- -apiVersion: v1 -kind: Service -metadata: - name: redis -spec: - selector: - app: redis - ports: - - port: 6379 - targetPort: 6379 \ No newline at end of file + volumeMounts: + - name: redis-pvc + mountPath: /data + diff --git a/redis-pvc.yaml b/redis-pvc.yaml new file mode 100644 index 000000000..1c1bc924f --- /dev/null +++ b/redis-pvc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: redis-pvc +spec: + storageClassName: "gp3" + resources: + requests: + storage: 5Gi + accessModes: + - ReadWriteOnce \ No newline at end of file diff --git a/redis-svc.yaml b/redis-svc.yaml new file mode 100644 index 000000000..b604f6d7f --- /dev/null +++ b/redis-svc.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: Service +metadata: + name: redis-service +spec: + selector: + app: redis + ports: + - port: 6379 + targetPort: 6379 + type: ClusterIP From 7f262368654e091ec4628860ec8172cbe4e92bc5 Mon Sep 17 00:00:00 2001 From: Jeppe Date: Fri, 15 Aug 2025 10:48:32 +0000 Subject: [PATCH 12/18] deployment workflow --- .github/workflows/deployment.yaml | 59 +++++++++++++++++++++++++++++++ kubeconfig | 0 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/deployment.yaml create mode 100644 kubeconfig diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml new file mode 100644 index 000000000..1748f43ce --- /dev/null +++ b/.github/workflows/deployment.yaml @@ -0,0 +1,59 @@ +name: deployment +on: push +jobs: + + Setup-kubeconfig: + runs-on: ubuntu-latest + steps: + - uses: actions/checkoutv4 + + - name: Set up kubectl + uses: azure/setup-kubectl@v3 + with: + version: latest + - name: Set up kubeconfig + run: echo "${{ secrets.KUBECONFIG }}" | base64 -d > kubeconfig + + Redis: + runs-on: ubuntu-latest + steps: + - uses: actions/checkoutv4 + - name: deploy-redis + run: kubectl --kubeconfig kubeconfig kubectl apply -f redis-deployment.yaml + + - name: redis-services + run: kubectl --kubeconfig kubeconfig kubectl apply -f redis-svc.yaml + + - name: redis-persitance + run: kubectl --kubeconfig kubeconfig kubectl apply -f redis-pvc.yaml + + Backend: + runs-on: ubuntu-latest + needs: Redis + steps: + - uses: actions/checkoutv4 + - name: deploy-backend + run: kubectl --kubeconfig kubeconfig kubectl apply -f backend-deployment.yaml + + - name: backend-services + run: kubectl --kubeconfig kubeconfig kubectl apply -f backend-svc.yaml + + - name: backend-persitance + run: kubectl --kubeconfig kubeconfig kubectl apply -f backend-pvc.yaml + + Frontend: + runs-on: ubuntu-latest + needs: Backend + steps: + - uses: actions/checkoutv4 + - name: deploy-frontend + run: kubectl --kubeconfig kubeconfig kubectl apply -f frontend-deployment.yaml + + - name: frontend-services + run: kubectl --kubeconfig kubeconfig kubectl apply -f frontend-svc.yaml + + - name: frontend-persitance + run: kubectl --kubeconfig kubeconfig kubectl apply -f frontend-pvc.yaml + + + diff --git a/kubeconfig b/kubeconfig new file mode 100644 index 000000000..e69de29bb From 8291be8e6094c10ca48e91c22169ac2f67b4f228 Mon Sep 17 00:00:00 2001 From: Jeppe Holm Andersen <144018621+JeppeHA@users.noreply.github.com> Date: Fri, 15 Aug 2025 12:50:47 +0200 Subject: [PATCH 13/18] deployment workflow (#9) --- .github/workflows/deployment.yaml | 59 +++++++++++++++++++++++++++++++ kubeconfig | 0 2 files changed, 59 insertions(+) create mode 100644 .github/workflows/deployment.yaml create mode 100644 kubeconfig diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml new file mode 100644 index 000000000..1748f43ce --- /dev/null +++ b/.github/workflows/deployment.yaml @@ -0,0 +1,59 @@ +name: deployment +on: push +jobs: + + Setup-kubeconfig: + runs-on: ubuntu-latest + steps: + - uses: actions/checkoutv4 + + - name: Set up kubectl + uses: azure/setup-kubectl@v3 + with: + version: latest + - name: Set up kubeconfig + run: echo "${{ secrets.KUBECONFIG }}" | base64 -d > kubeconfig + + Redis: + runs-on: ubuntu-latest + steps: + - uses: actions/checkoutv4 + - name: deploy-redis + run: kubectl --kubeconfig kubeconfig kubectl apply -f redis-deployment.yaml + + - name: redis-services + run: kubectl --kubeconfig kubeconfig kubectl apply -f redis-svc.yaml + + - name: redis-persitance + run: kubectl --kubeconfig kubeconfig kubectl apply -f redis-pvc.yaml + + Backend: + runs-on: ubuntu-latest + needs: Redis + steps: + - uses: actions/checkoutv4 + - name: deploy-backend + run: kubectl --kubeconfig kubeconfig kubectl apply -f backend-deployment.yaml + + - name: backend-services + run: kubectl --kubeconfig kubeconfig kubectl apply -f backend-svc.yaml + + - name: backend-persitance + run: kubectl --kubeconfig kubeconfig kubectl apply -f backend-pvc.yaml + + Frontend: + runs-on: ubuntu-latest + needs: Backend + steps: + - uses: actions/checkoutv4 + - name: deploy-frontend + run: kubectl --kubeconfig kubeconfig kubectl apply -f frontend-deployment.yaml + + - name: frontend-services + run: kubectl --kubeconfig kubeconfig kubectl apply -f frontend-svc.yaml + + - name: frontend-persitance + run: kubectl --kubeconfig kubeconfig kubectl apply -f frontend-pvc.yaml + + + diff --git a/kubeconfig b/kubeconfig new file mode 100644 index 000000000..e69de29bb From dd65856855c3e419a99e5a714520b8bd3099a1f5 Mon Sep 17 00:00:00 2001 From: Jeppe Date: Fri, 15 Aug 2025 11:07:01 +0000 Subject: [PATCH 14/18] workflowtest --- workflowtest.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 workflowtest.txt diff --git a/workflowtest.txt b/workflowtest.txt new file mode 100644 index 000000000..21bcb5544 --- /dev/null +++ b/workflowtest.txt @@ -0,0 +1 @@ +workflowtest From 64b87092b761bc1c905a85a27c0899788a39d5d6 Mon Sep 17 00:00:00 2001 From: Jeppe Date: Fri, 15 Aug 2025 11:22:45 +0000 Subject: [PATCH 15/18] deployment workflow update --- .github/workflows/deployment.yaml | 43 +++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index 1748f43ce..1f90c85a3 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -5,7 +5,7 @@ jobs: Setup-kubeconfig: runs-on: ubuntu-latest steps: - - uses: actions/checkoutv4 + - uses: actions/checkout@v4 - name: Set up kubectl uses: azure/setup-kubectl@v3 @@ -13,47 +13,64 @@ jobs: version: latest - name: Set up kubeconfig run: echo "${{ secrets.KUBECONFIG }}" | base64 -d > kubeconfig + + - name: Upload kubeconfig artifact + uses: actions/upload-artifact@v4 + with: + name: kubeconfig + path: config Redis: + needs: Setup-kubeconfig runs-on: ubuntu-latest steps: - - uses: actions/checkoutv4 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: kubeconfig + - name: deploy-redis - run: kubectl --kubeconfig kubeconfig kubectl apply -f redis-deployment.yaml + run: kubectl --kubeconfig kubeconfig apply -f redis-deployment.yaml - name: redis-services - run: kubectl --kubeconfig kubeconfig kubectl apply -f redis-svc.yaml + run: kubectl --kubeconfig kubeconfig apply -f redis-svc.yaml - name: redis-persitance - run: kubectl --kubeconfig kubeconfig kubectl apply -f redis-pvc.yaml + run: kubectl --kubeconfig kubeconfig apply -f redis-pvc.yaml Backend: runs-on: ubuntu-latest needs: Redis steps: - - uses: actions/checkoutv4 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: kubeconfig - name: deploy-backend - run: kubectl --kubeconfig kubeconfig kubectl apply -f backend-deployment.yaml + run: kubectl --kubeconfig kubeconfig apply -f backend-deployment.yaml - name: backend-services - run: kubectl --kubeconfig kubeconfig kubectl apply -f backend-svc.yaml + run: kubectl --kubeconfig kubeconfig apply -f backend-svc.yaml - name: backend-persitance - run: kubectl --kubeconfig kubeconfig kubectl apply -f backend-pvc.yaml + run: kubectl --kubeconfig kubeconfig apply -f backend-pvc.yaml Frontend: runs-on: ubuntu-latest needs: Backend steps: - - uses: actions/checkoutv4 + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: kubeconfig - name: deploy-frontend - run: kubectl --kubeconfig kubeconfig kubectl apply -f frontend-deployment.yaml + run: kubectl --kubeconfig kubeconfig apply -f frontend-deployment.yaml - name: frontend-services - run: kubectl --kubeconfig kubeconfig kubectl apply -f frontend-svc.yaml + run: kubectl --kubeconfig kubeconfig apply -f frontend-svc.yaml - name: frontend-persitance - run: kubectl --kubeconfig kubeconfig kubectl apply -f frontend-pvc.yaml + run: kubectl --kubeconfig kubeconfig apply -f frontend-pvc.yaml From 2f3bd9ea782dbeea8192a34510cafcf7a5a32f57 Mon Sep 17 00:00:00 2001 From: Jeppe Date: Fri, 15 Aug 2025 11:32:20 +0000 Subject: [PATCH 16/18] deployment workflow kubeconfig path update --- .github/workflows/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index 1f90c85a3..51c7f2249 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -18,7 +18,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: kubeconfig - path: config + path: kubeconfig Redis: needs: Setup-kubeconfig From 1e02659d764494e0456c4dcdd0b320923d4c8511 Mon Sep 17 00:00:00 2001 From: Jeppe Date: Fri, 15 Aug 2025 11:34:35 +0000 Subject: [PATCH 17/18] No pvc in front and backend --- .github/workflows/deployment.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index 51c7f2249..9dc4b6cda 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -52,9 +52,6 @@ jobs: - name: backend-services run: kubectl --kubeconfig kubeconfig apply -f backend-svc.yaml - - name: backend-persitance - run: kubectl --kubeconfig kubeconfig apply -f backend-pvc.yaml - Frontend: runs-on: ubuntu-latest needs: Backend @@ -69,8 +66,6 @@ jobs: - name: frontend-services run: kubectl --kubeconfig kubeconfig apply -f frontend-svc.yaml - - name: frontend-persitance - run: kubectl --kubeconfig kubeconfig apply -f frontend-pvc.yaml From f230124beb0f46d605a82f86e1bf6bdbbea3866d Mon Sep 17 00:00:00 2001 From: Jeppe Date: Fri, 15 Aug 2025 13:01:36 +0000 Subject: [PATCH 18/18] Running test added --- .github/workflows/deployment.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deployment.yaml b/.github/workflows/deployment.yaml index 9dc4b6cda..d5a883d94 100644 --- a/.github/workflows/deployment.yaml +++ b/.github/workflows/deployment.yaml @@ -1,7 +1,6 @@ name: deployment on: push jobs: - Setup-kubeconfig: runs-on: ubuntu-latest steps: @@ -66,6 +65,21 @@ jobs: - name: frontend-services run: kubectl --kubeconfig kubeconfig apply -f frontend-svc.yaml + Test-runnig: + runs-on: ubuntu-latest + needs: Frontend + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + name: kubeconfig + - name: test-frontend-deployment + run: kubectl --kubeconfig kubeconfig get pods -l app=frontend + - name: test-backend-deployment + run: kubectl --kubeconfig kubeconfig get pods -l app=backend + - name: test-redis-deployment + run: kubectl --kubeconfig kubeconfig get pods -l app=redis +