From f68e494b3a04bed807d4586a4af7b9a9b6865cd9 Mon Sep 17 00:00:00 2001 From: slaventius Date: Tue, 21 Feb 2023 12:26:22 +0300 Subject: [PATCH] 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