From 865d9e24e44024b17e9835024edb60eea649b0f9 Mon Sep 17 00:00:00 2001 From: slaventius Date: Mon, 13 Feb 2023 10:42:33 +0300 Subject: [PATCH 01/14] * --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ffc1171..4e0bbec 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # authDB * http://git.slaventius.ru/test3k/authDB.git -* docker build --no-cache --tag slaventius/test3k_auth_db:latest ./deploy/ +* docker build --no-cache --tag slaventius/test3k_auth_db:latest ./build/ * docker push slaventius/test3k_auth_db:latest \ No newline at end of file From 2721fb7104f865c3f9447cc5eac4382450d90850 Mon Sep 17 00:00:00 2001 From: slaventius Date: Tue, 14 Feb 2023 09:14:10 +0300 Subject: [PATCH 02/14] * --- deploy/auth-db-config.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/auth-db-config.yaml b/deploy/auth-db-config.yaml index ea9354f..88625ab 100644 --- a/deploy/auth-db-config.yaml +++ b/deploy/auth-db-config.yaml @@ -6,3 +6,4 @@ data: KAFKA_HOST: "37.143.12.169" KAFKA_PORT: "9092" APP_PORT: "9995" + SENTRY_DSN: "https://3f4b31dbbd9a4a6b8a71f9881d962f25@o4504654569799680.ingest.sentry.io/4504654572683264" From c4bb7fc554c21a29896765b83d2cdf66019b0485 Mon Sep 17 00:00:00 2001 From: slaventius Date: Tue, 14 Feb 2023 17:04:47 +0300 Subject: [PATCH 03/14] * --- .vscode/extensions.json | 6 +-- .vscode/launch.json | 6 +-- .vscode/settings.json | 48 ++++++++--------- .vscode/tasks.json | 117 ++++++++++++++++++++++------------------ 4 files changed, 94 insertions(+), 83 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 51fbfcc..d426dfb 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,5 +1,3 @@ { - "recommendations": [ - "johnpapa.vscode-peacock" - ] -} \ No newline at end of file + "recommendations": ["johnpapa.vscode-peacock"] +} diff --git a/.vscode/launch.json b/.vscode/launch.json index cb09d93..9b0ae6f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,9 +11,9 @@ "mode": "debug", "program": "${workspaceRoot}/cmd/main.go", "env": { - "APP_PORT":"9995", - "KAFKA_PORT":"9092", - "KAFKA_HOST":"37.143.12.169", + "APP_PORT": "9995", + "KAFKA_PORT": "9092", + "KAFKA_HOST": "37.143.12.169", "SENTRY_DSN": "https://3f4b31dbbd9a4a6b8a71f9881d962f25@o4504654569799680.ingest.sentry.io/4504654572683264" }, "args": [] diff --git a/.vscode/settings.json b/.vscode/settings.json index bf19f1d..1de8427 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,25 +1,25 @@ { - "workbench.colorCustomizations": { - "activityBar.activeBackground": "#0bba5d", - "activityBar.activeBorder": "#eee1fd", - "activityBar.background": "#0bba5d", - "activityBarBadge.background": "#eee1fd", - "activityBarBadge.foreground": "#15202b", - "statusBar.background": "#088a45", - "statusBarItem.hoverBackground": "#0bba5d", - "titleBar.activeBackground": "#088a45", - "titleBar.inactiveBackground": "#088a4599", - "activityBar.foreground": "#e7e7e7", - "activityBar.inactiveForeground": "#e7e7e799", - "statusBar.foreground": "#e7e7e7", - "titleBar.activeForeground": "#e7e7e7", - "titleBar.inactiveForeground": "#e7e7e799", - "statusBarItem.remoteBackground": "#088a45", - "statusBarItem.remoteForeground": "#e7e7e7", - "sash.hoverBorder": "#0bba5d", - "commandCenter.border": "#e7e7e799" - }, - "peacock.color": "#088a45", - "todo-tree.tree.disableCompactFolders": false, - "todo-tree.tree.showBadges": true -} \ No newline at end of file + "workbench.colorCustomizations": { + "activityBar.activeBackground": "#0bba5d", + "activityBar.activeBorder": "#eee1fd", + "activityBar.background": "#0bba5d", + "activityBarBadge.background": "#eee1fd", + "activityBarBadge.foreground": "#15202b", + "statusBar.background": "#088a45", + "statusBarItem.hoverBackground": "#0bba5d", + "titleBar.activeBackground": "#088a45", + "titleBar.inactiveBackground": "#088a4599", + "activityBar.foreground": "#e7e7e7", + "activityBar.inactiveForeground": "#e7e7e799", + "statusBar.foreground": "#e7e7e7", + "titleBar.activeForeground": "#e7e7e7", + "titleBar.inactiveForeground": "#e7e7e799", + "statusBarItem.remoteBackground": "#088a45", + "statusBarItem.remoteForeground": "#e7e7e7", + "sash.hoverBorder": "#0bba5d", + "commandCenter.border": "#e7e7e799" + }, + "peacock.color": "#088a45", + "todo-tree.tree.disableCompactFolders": false, + "todo-tree.tree.showBadges": true +} diff --git a/.vscode/tasks.json b/.vscode/tasks.json index cd64240..7b8b3c4 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -1,55 +1,68 @@ { - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "build linux", - "type": "shell", - "group": { - "kind": "build", - "isDefault": true - }, - "presentation": { - "echo": true, - "panel": "new" - }, - "options": { - "cwd": "${workspaceRoot}", - "env": { - "APP": "pakitara", - "GOOS": "linux", - "GOARCH": "amd64", - "GOBIN": "${env:GOPATH}/bin" - }, - "args": [ - "ldflags '-s -w'" - ] - }, - "command": "go build -o $GOBIN/$APP-$GOOS-$GOARCH -ldflags \"-s -w\" $APP.go", - "problemMatcher": [] + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "type": "shell", + "group": { + "kind": "build", + "isDefault": true + }, + "presentation": { + "echo": true, + "panel": "new" + }, + "options": { + "cwd": "${workspaceRoot}", + "env": { + "APP": "authDBService", + "GOOS": "linux", + "GOARCH": "amd64", + "GOBIN": "${env:GOPATH}/bin" }, - { - "label": "build windows", - "type": "shell", - "group": "build", - "presentation": { - "echo": true, - "panel": "new" - }, - "options": { - "cwd": "${workspaceRoot}", - "env": { - "APP": "pakitara", - "GOOS": "windows", - "GOARCH": "amd64", - "GOBIN": "${env:GOPATH}/bin" - }, - "args": [ - "ldflags '-s -w'" - ] - }, - "command": "go build -o $GOBIN\\$APP-$GOOS-$GOARCH.exe -ldflags \"-s -w\" $APP.go" + "args": ["ldflags '-s -w'"] + }, + "command": "go build -o $GOBIN/$APP-$GOOS-$GOARCH -ldflags \"-s -w\" ./cmd/main.go", + "problemMatcher": [] + }, + { + "label": "docker-build", + "type": "shell", + "group": { + "kind": "build" + }, + "presentation": { + "echo": true, + "panel": "new" + }, + "options": { + "cwd": "${workspaceRoot}", + "env": { + "TAG": "slaventius/test3k_auth_db:latest" + }, + "args": ["--no-cache", "--tag $TAG"] + }, + "command": "sudo docker build --no-cache --tag $TAG ./build/", + "problemMatcher": [] + }, + { + "label": "docker-push", + "type": "shell", + "group": { + "kind": "build" + }, + "presentation": { + "echo": true, + "panel": "new" + }, + "options": { + "cwd": "${workspaceRoot}", + "env": { + "TAG": "slaventius/test3k_auth_db:latest" } - ] -} \ No newline at end of file + }, + "command": "sudo docker push $TAG", + "problemMatcher": [] + } + ] +} From bdf458614b768a2ec039dc1ce359a29d5b7978f4 Mon Sep 17 00:00:00 2001 From: slaventius Date: Tue, 14 Feb 2023 18:46:15 +0300 Subject: [PATCH 04/14] * --- build/Makefile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 build/Makefile diff --git a/build/Makefile b/build/Makefile new file mode 100644 index 0000000..f7d56a0 --- /dev/null +++ b/build/Makefile @@ -0,0 +1,25 @@ +.DEFAULT_GOAL := build + +GOOS=linux +GOARCH=amd64 +GOBIN=$(shell go env GOPATH)/bin +APP=authDBService +APP_BINARY=${GOBIN}/${APP}-${GOOS}-${GOARCH} +APP_TAG=slaventius/test3k_auth_db:latest + +clean: + @echo "cleaning ${APP_BINARY}" + @go clean + @rm ${APP_BINARY} + +build: clean + @echo "building ${APP_BINARY}" + @go build -o ${APP_BINARY} -ldflags "-s -w" ../cmd/main.go + +docker-build: + @echo "building docker-image ${APP_TAG}" + @sudo docker build --no-cache --tag ${APP_TAG} . + +docker-push: docker-build + @echo "pushing docker-image ${APP_TAG}" + @sudo docker push ${APP_TAG} \ No newline at end of file From 1b8091f3b680491ad039acb57561858be87a4116 Mon Sep 17 00:00:00 2001 From: slaventius Date: Tue, 14 Feb 2023 18:49:40 +0300 Subject: [PATCH 05/14] * --- README.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/README.md b/README.md index 4e0bbec..ccc1b87 100644 --- a/README.md +++ b/README.md @@ -1,5 +1 @@ -# authDB - -* http://git.slaventius.ru/test3k/authDB.git -* docker build --no-cache --tag slaventius/test3k_auth_db:latest ./build/ -* docker push slaventius/test3k_auth_db:latest \ No newline at end of file +# authDB \ No newline at end of file From 7cdee31ce11c47b6d6ae80aa2104bee8c1d67976 Mon Sep 17 00:00:00 2001 From: slaventius Date: Wed, 15 Feb 2023 08:42:36 +0300 Subject: [PATCH 06/14] * --- .vscode/tasks.json | 2 ++ build/Makefile | 6 +++--- scripts/start.sh | 14 +++++++++----- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 7b8b3c4..779ff68 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -16,6 +16,8 @@ "cwd": "${workspaceRoot}", "env": { "APP": "authDBService", + // "GOOS": "${env:GOOS}", + // "GOARCH": "${env:GOARCH}", "GOOS": "linux", "GOARCH": "amd64", "GOBIN": "${env:GOPATH}/bin" diff --git a/build/Makefile b/build/Makefile index f7d56a0..5102dee 100644 --- a/build/Makefile +++ b/build/Makefile @@ -1,7 +1,7 @@ .DEFAULT_GOAL := build -GOOS=linux -GOARCH=amd64 +GOOS=$(shell go env GOOS) +GOARCH=$(shell go env GOARCH) GOBIN=$(shell go env GOPATH)/bin APP=authDBService APP_BINARY=${GOBIN}/${APP}-${GOOS}-${GOARCH} @@ -10,7 +10,7 @@ APP_TAG=slaventius/test3k_auth_db:latest clean: @echo "cleaning ${APP_BINARY}" @go clean - @rm ${APP_BINARY} + @rm -f ${APP_BINARY} build: clean @echo "building ${APP_BINARY}" diff --git a/scripts/start.sh b/scripts/start.sh index 5beb329..c7b6c43 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -1,9 +1,13 @@ #!/bin/sh export APP_PORT=9995 -# export KAFKA_PORT=9092 -export KAFKA_PORT=19092 -export KAFKA_HOST=127.0.0.1 -# export KAFKA_HOST=37.143.12.169 +export KAFKA_PORT=9092 +export KAFKA_HOST=37.143.12.169 +export SENTRY_DSN="https://3f4b31dbbd9a4a6b8a71f9881d962f25@o4504654569799680.ingest.sentry.io/4504654572683264" -./authDBService +export GOOS=$(eval go env GOOS) +export GOARCH=$(eval go env GOARCH) +export GOBIN=$(eval go env GOPATH)/bin +export APPBINARY=${GOBIN}/authDBService-${GOOS}-${GOARCH} + +${APPBINARY} \ No newline at end of file From 29266ec1fb6b45c294628dba933c6133da4ad1ee Mon Sep 17 00:00:00 2001 From: slaventius Date: Wed, 15 Feb 2023 08:47:25 +0300 Subject: [PATCH 07/14] * --- scripts/start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/start.sh b/scripts/start.sh index c7b6c43..acb262f 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -5,9 +5,9 @@ export KAFKA_PORT=9092 export KAFKA_HOST=37.143.12.169 export SENTRY_DSN="https://3f4b31dbbd9a4a6b8a71f9881d962f25@o4504654569799680.ingest.sentry.io/4504654572683264" +export APP=authDBService export GOOS=$(eval go env GOOS) export GOARCH=$(eval go env GOARCH) export GOBIN=$(eval go env GOPATH)/bin -export APPBINARY=${GOBIN}/authDBService-${GOOS}-${GOARCH} -${APPBINARY} \ No newline at end of file +${GOBIN}/${APP}-${GOOS}-${GOARCH} \ No newline at end of file From 4bbec0f8ee33957f4159efc476dd18f1c9829e50 Mon Sep 17 00:00:00 2001 From: slaventius Date: Wed, 15 Feb 2023 15:35:14 +0300 Subject: [PATCH 08/14] =?UTF-8?q?=D1=80=D0=B0=D0=B7=D1=80=D0=B5=D1=88?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=B2=D1=85=D0=BE=D0=B4=D1=8F=D1=89=D0=B8=D0=B5?= =?UTF-8?q?=20=D0=B4=D0=BB=D1=8F=20redpanda?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/redpanda/docker-compose.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deploy/redpanda/docker-compose.yaml b/deploy/redpanda/docker-compose.yaml index 82f90ae..b2e52b1 100644 --- a/deploy/redpanda/docker-compose.yaml +++ b/deploy/redpanda/docker-compose.yaml @@ -20,7 +20,8 @@ services: # # address the broker advertises to clients that connect to the Kafka API. - --advertise-kafka-addr - - internal://redpanda-0:9092,external://localhost:19092 + # # - internal://redpanda-0:9092,external://localhost:19092 + - internal://redpanda-0:9092,outside://37.143.12.169:19092 - --pandaproxy-addr - internal://0.0.0.0:8082,external://0.0.0.0:18082 # address the broker advertises to clients that connect to PandaProxy. From dd5f3db0d7db86b585328f8bf28875c5c4b3623d Mon Sep 17 00:00:00 2001 From: slaventius Date: Wed, 15 Feb 2023 15:35:38 +0300 Subject: [PATCH 09/14] * --- deploy/auth-db-deployment.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/deploy/auth-db-deployment.yaml b/deploy/auth-db-deployment.yaml index d8c5c02..ca47dcb 100644 --- a/deploy/auth-db-deployment.yaml +++ b/deploy/auth-db-deployment.yaml @@ -23,3 +23,17 @@ spec: envFrom: - configMapRef: name: auth-db-config + livenessProbe: + grpc: + port: 9995 + periodSeconds: 1 + initialDelaySeconds: 2 + failureThreshold: 3 + successThreshold: 1 + readinessProbe: + grpc: + port: 9995 + periodSeconds: 1 + initialDelaySeconds: 4 + failureThreshold: 3 + successThreshold: 1 From 5fb026208962da11efb9d65a8eb96ef16fb262df Mon Sep 17 00:00:00 2001 From: slaventius Date: Wed, 15 Feb 2023 15:50:02 +0300 Subject: [PATCH 10/14] * --- scripts/start.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/start.sh b/scripts/start.sh index acb262f..f019d85 100755 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -1,7 +1,7 @@ #!/bin/sh export APP_PORT=9995 -export KAFKA_PORT=9092 +export KAFKA_PORT=19092 export KAFKA_HOST=37.143.12.169 export SENTRY_DSN="https://3f4b31dbbd9a4a6b8a71f9881d962f25@o4504654569799680.ingest.sentry.io/4504654572683264" From 66d9d21714aba502c7b402ba4477e2e9039ed0c1 Mon Sep 17 00:00:00 2001 From: slaventius Date: Thu, 16 Feb 2023 08:01:51 +0300 Subject: [PATCH 11/14] * --- deploy/auth-db-config.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/auth-db-config.yaml b/deploy/auth-db-config.yaml index 88625ab..874f821 100644 --- a/deploy/auth-db-config.yaml +++ b/deploy/auth-db-config.yaml @@ -4,6 +4,6 @@ metadata: name: auth-db-config data: KAFKA_HOST: "37.143.12.169" - KAFKA_PORT: "9092" + KAFKA_PORT: "19092" APP_PORT: "9995" SENTRY_DSN: "https://3f4b31dbbd9a4a6b8a71f9881d962f25@o4504654569799680.ingest.sentry.io/4504654572683264" From f318339c2388cd4152fda1ff058963786a555cea Mon Sep 17 00:00:00 2001 From: slaventius Date: Fri, 17 Feb 2023 14:50:19 +0300 Subject: [PATCH 12/14] * --- deploy/auth-db-config.yaml | 1 - deploy/auth-db-deployment.yaml | 30 ++++++++++++++++-------------- deploy/auth-db-secret.yaml | 7 +++++++ 3 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 deploy/auth-db-secret.yaml diff --git a/deploy/auth-db-config.yaml b/deploy/auth-db-config.yaml index 874f821..d9d167b 100644 --- a/deploy/auth-db-config.yaml +++ b/deploy/auth-db-config.yaml @@ -6,4 +6,3 @@ data: KAFKA_HOST: "37.143.12.169" KAFKA_PORT: "19092" APP_PORT: "9995" - SENTRY_DSN: "https://3f4b31dbbd9a4a6b8a71f9881d962f25@o4504654569799680.ingest.sentry.io/4504654572683264" diff --git a/deploy/auth-db-deployment.yaml b/deploy/auth-db-deployment.yaml index ca47dcb..a9b2ac4 100644 --- a/deploy/auth-db-deployment.yaml +++ b/deploy/auth-db-deployment.yaml @@ -21,19 +21,21 @@ spec: ports: - containerPort: 9995 envFrom: + - secretRef: + name: auth-db-secret - configMapRef: name: auth-db-config - livenessProbe: - grpc: - port: 9995 - periodSeconds: 1 - initialDelaySeconds: 2 - failureThreshold: 3 - successThreshold: 1 - readinessProbe: - grpc: - port: 9995 - periodSeconds: 1 - initialDelaySeconds: 4 - failureThreshold: 3 - successThreshold: 1 +# livenessProbe: +# grpc: +# port: 9995 +# periodSeconds: 1 +# initialDelaySeconds: 2 +# failureThreshold: 3 +# successThreshold: 1 +# readinessProbe: +# grpc: +# port: 9995 +# periodSeconds: 1 +# initialDelaySeconds: 4 +# failureThreshold: 3 +# successThreshold: 1 diff --git a/deploy/auth-db-secret.yaml b/deploy/auth-db-secret.yaml new file mode 100644 index 0000000..54f3ec9 --- /dev/null +++ b/deploy/auth-db-secret.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Secret +metadata: + name: auth-db-secret +type: Opaque +data: + SENTRY_DSN: aHR0cHM6Ly8zZjRiMzFkYmJkOWE0YTZiOGE3MWY5ODgxZDk2MmYyNUBvNDUwNDY1NDU2OTc5OTY4MC5pbmdlc3Quc2VudHJ5LmlvLzQ1MDQ2NTQ1NzI2ODMyNjQ= From f68e494b3a04bed807d4586a4af7b9a9b6865cd9 Mon Sep 17 00:00:00 2001 From: slaventius Date: Tue, 21 Feb 2023 12:26:22 +0300 Subject: [PATCH 13/14] add helm --- deploy/{ => .pre}/auth-db-config.yaml | 0 deploy/{ => .pre}/auth-db-deployment.yaml | 0 deploy/{ => .pre}/auth-db-secret.yaml | 0 deploy/{ => .pre}/auth-db-service.yaml | 0 deploy/helm/Chart.yaml | 6 ++++ deploy/helm/templates/config.yaml | 8 +++++ deploy/helm/templates/deployment.yaml | 41 +++++++++++++++++++++++ deploy/helm/templates/secret.yaml | 7 ++++ deploy/helm/templates/service.yaml | 14 ++++++++ deploy/helm/values.yaml | 3 ++ 10 files changed, 79 insertions(+) rename deploy/{ => .pre}/auth-db-config.yaml (100%) rename deploy/{ => .pre}/auth-db-deployment.yaml (100%) rename deploy/{ => .pre}/auth-db-secret.yaml (100%) rename deploy/{ => .pre}/auth-db-service.yaml (100%) create mode 100644 deploy/helm/Chart.yaml create mode 100644 deploy/helm/templates/config.yaml create mode 100644 deploy/helm/templates/deployment.yaml create mode 100644 deploy/helm/templates/secret.yaml create mode 100644 deploy/helm/templates/service.yaml create mode 100644 deploy/helm/values.yaml diff --git a/deploy/auth-db-config.yaml b/deploy/.pre/auth-db-config.yaml similarity index 100% rename from deploy/auth-db-config.yaml rename to deploy/.pre/auth-db-config.yaml diff --git a/deploy/auth-db-deployment.yaml b/deploy/.pre/auth-db-deployment.yaml similarity index 100% rename from deploy/auth-db-deployment.yaml rename to deploy/.pre/auth-db-deployment.yaml diff --git a/deploy/auth-db-secret.yaml b/deploy/.pre/auth-db-secret.yaml similarity index 100% rename from deploy/auth-db-secret.yaml rename to deploy/.pre/auth-db-secret.yaml diff --git a/deploy/auth-db-service.yaml b/deploy/.pre/auth-db-service.yaml similarity index 100% rename from deploy/auth-db-service.yaml rename to deploy/.pre/auth-db-service.yaml diff --git a/deploy/helm/Chart.yaml b/deploy/helm/Chart.yaml new file mode 100644 index 0000000..9504190 --- /dev/null +++ b/deploy/helm/Chart.yaml @@ -0,0 +1,6 @@ +apiVersion: apps/v1 +name: auth-db-HelmChart +description: Helm Chart for auth-db +type: application +version: 0.1.0 +appVersion: "1.0.0" diff --git a/deploy/helm/templates/config.yaml b/deploy/helm/templates/config.yaml new file mode 100644 index 0000000..cea488d --- /dev/null +++ b/deploy/helm/templates/config.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-config +data: + KAFKA_HOST: "37.143.12.169" + KAFKA_PORT: "19092" + APP_PORT: "9995" diff --git a/deploy/helm/templates/deployment.yaml b/deploy/helm/templates/deployment.yaml new file mode 100644 index 0000000..50db5fc --- /dev/null +++ b/deploy/helm/templates/deployment.yaml @@ -0,0 +1,41 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-application + labels: + app: {{ .Release.Name }}-application +spec: + replicas: 1 + selector: + matchLabels: + app: {{ .Release.Name }}-application + template: + metadata: + labels: + app: {{ .Release.Name }}-application + spec: + containers: + - name: {{ .Release.Name }}-application + image: {{ .Values.container.image }} + imagePullPolicy: Always + ports: + - containerPort: {{ .Values.container.port }} + envFrom: + - secretRef: + name: {{ .Release.Name }}-secret + - configMapRef: + name: {{ .Release.Name }}-config +# livenessProbe: +# grpc: +# port: {{ .Values.container.port }} +# periodSeconds: 1 +# initialDelaySeconds: 2 +# failureThreshold: 3 +# successThreshold: 1 +# readinessProbe: +# grpc: +# port: {{ .Values.container.port }} +# periodSeconds: 1 +# initialDelaySeconds: 4 +# failureThreshold: 3 +# successThreshold: 1 diff --git a/deploy/helm/templates/secret.yaml b/deploy/helm/templates/secret.yaml new file mode 100644 index 0000000..85c3dac --- /dev/null +++ b/deploy/helm/templates/secret.yaml @@ -0,0 +1,7 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Release.Name }}-secret +type: Opaque +data: + SENTRY_DSN: aHR0cHM6Ly8zZjRiMzFkYmJkOWE0YTZiOGE3MWY5ODgxZDk2MmYyNUBvNDUwNDY1NDU2OTc5OTY4MC5pbmdlc3Quc2VudHJ5LmlvLzQ1MDQ2NTQ1NzI2ODMyNjQ= diff --git a/deploy/helm/templates/service.yaml b/deploy/helm/templates/service.yaml new file mode 100644 index 0000000..9385617 --- /dev/null +++ b/deploy/helm/templates/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-service + labels: + app: {{ .Release.Name }}-application +spec: + type: ClusterIP + selector: + app: {{ .Release.Name }}-application + ports: + - protocol: TCP + port: {{ .Values.container.port }} + targetPort: {{ .Values.container.port }} diff --git a/deploy/helm/values.yaml b/deploy/helm/values.yaml new file mode 100644 index 0000000..82d2a2a --- /dev/null +++ b/deploy/helm/values.yaml @@ -0,0 +1,3 @@ +container: + image: slaventius/test3k_auth_db:latest + port: 9995 From 2eb21d80f40161d8e7684994f1e45d620acd08e3 Mon Sep 17 00:00:00 2001 From: slaventius Date: Tue, 21 Feb 2023 15:14:30 +0300 Subject: [PATCH 14/14] * --- deploy/helm/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deploy/helm/Chart.yaml b/deploy/helm/Chart.yaml index 9504190..93571e1 100644 --- a/deploy/helm/Chart.yaml +++ b/deploy/helm/Chart.yaml @@ -1,4 +1,4 @@ -apiVersion: apps/v1 +apiVersion: v2 name: auth-db-HelmChart description: Helm Chart for auth-db type: application