From f6dbc1d28c8c2d9e2760ba0cc9da240490755ed5 Mon Sep 17 00:00:00 2001 From: Tobias <31214870+memeToasty@users.noreply.github.com> Date: Wed, 6 Mar 2024 15:11:34 +0100 Subject: [PATCH] Enable local Kubernetes deployment (#269) --- Makefile | 10 ++++ docker-compose.build.yml | 50 +++++++++++++++++ deploy.sh => hacks/deploy.sh | 10 ++-- hacks/kind-up.sh | 21 ++++++++ hacks/values_local.yaml | 101 +++++++++++++++++++++++++++++++++++ helm/kioku/values.yaml | 6 +-- 6 files changed, 192 insertions(+), 6 deletions(-) create mode 100644 Makefile create mode 100644 docker-compose.build.yml rename deploy.sh => hacks/deploy.sh (77%) create mode 100755 hacks/kind-up.sh create mode 100644 hacks/values_local.yaml diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..9ad53ed4 --- /dev/null +++ b/Makefile @@ -0,0 +1,10 @@ +kind-up: + ./hacks/kind-up.sh + +deploy: + ./hacks/deploy.sh + +kind-deploy: + docker compose -f ./docker-compose.build.yml build + kind load docker-image kioku-frontend:latest kioku-carddeck_service:latest kioku-frontend_proxy:latest kioku-srs_service:latest kioku-user_service:latest kioku-collaboration_service:latest kioku-notification_service:latest + ./hacks/deploy.sh ./hacks/values_local.yaml \ No newline at end of file diff --git a/docker-compose.build.yml b/docker-compose.build.yml new file mode 100644 index 00000000..61a8f27f --- /dev/null +++ b/docker-compose.build.yml @@ -0,0 +1,50 @@ +version: "3" + +services: + frontend_proxy: + container_name: kioku-frontend_proxy + restart: always + build: + context: backend + dockerfile: services/frontend/Dockerfile + + user_service: + container_name: kioku-user_service + restart: always + build: + context: backend + dockerfile: services/user/Dockerfile + + carddeck_service: + container_name: kioku-carddeck_service + restart: always + build: + context: backend + dockerfile: services/carddeck/Dockerfile + + collaboration_service: + container_name: kioku-collaboration_service + restart: always + build: + context: backend + dockerfile: services/collaboration/Dockerfile + + srs_service: + container_name: kioku-srs_service + restart: always + build: + context: backend + dockerfile: services/srs/Dockerfile + + notification_service: + container_name: kioku-notification_service + restart: always + build: + context: backend + dockerfile: services/notification/Dockerfile + + frontend: + container_name: kioku-frontend + restart: always + build: + context: frontend diff --git a/deploy.sh b/hacks/deploy.sh similarity index 77% rename from deploy.sh rename to hacks/deploy.sh index 369bd6f6..fb439f8b 100755 --- a/deploy.sh +++ b/hacks/deploy.sh @@ -1,8 +1,12 @@ #!/bin/bash -# This script allows to deploy kioku to an external Kubernetes cluster +# This script allows to deploy kioku to a Kubernetes cluster # Assumptions: # - KUBECONFIG already targets the cluster -# - Script is executed from kioku-repo root folder +VALUE_STRING="" +if ! [ -z "$1" ]; then + VALUE_STRING="-f $1" + echo "$1" +fi # Get dependent repositories helm repo add postgres-operator-charts https://opensource.zalando.com/postgres-operator/charts/postgres-operator @@ -19,4 +23,4 @@ helm install postgres-operator postgres-operator-charts/postgres-operator # --create-namespace # Install Kioku -helm install kioku helm/kioku \ No newline at end of file +helm upgrade --install kioku helm/kioku $VALUE_STRING \ No newline at end of file diff --git a/hacks/kind-up.sh b/hacks/kind-up.sh new file mode 100755 index 00000000..d02da5ec --- /dev/null +++ b/hacks/kind-up.sh @@ -0,0 +1,21 @@ +cat <