From a0cd5d9ca9712c6a882e2751c43efe184fdd1e24 Mon Sep 17 00:00:00 2001
From: slaventius <slaventius@mail.ru>
Date: Tue, 21 Feb 2023 12:26:43 +0300
Subject: [PATCH] add helm

---
 deploy/{ => .pre}/auth-postman-config.yaml    |  0
 .../{ => .pre}/auth-postman-deployment.yaml   |  0
 deploy/{ => .pre}/auth-postman-secret.yaml    |  0
 deploy/helm/Chart.yaml                        |  6 +++++
 deploy/helm/templates/config.yaml             | 11 ++++++++
 deploy/helm/templates/deployment.yaml         | 25 +++++++++++++++++++
 deploy/helm/templates/secret.yaml             |  9 +++++++
 deploy/helm/values.yaml                       |  2 ++
 8 files changed, 53 insertions(+)
 rename deploy/{ => .pre}/auth-postman-config.yaml (100%)
 rename deploy/{ => .pre}/auth-postman-deployment.yaml (100%)
 rename deploy/{ => .pre}/auth-postman-secret.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/values.yaml

diff --git a/deploy/auth-postman-config.yaml b/deploy/.pre/auth-postman-config.yaml
similarity index 100%
rename from deploy/auth-postman-config.yaml
rename to deploy/.pre/auth-postman-config.yaml
diff --git a/deploy/auth-postman-deployment.yaml b/deploy/.pre/auth-postman-deployment.yaml
similarity index 100%
rename from deploy/auth-postman-deployment.yaml
rename to deploy/.pre/auth-postman-deployment.yaml
diff --git a/deploy/auth-postman-secret.yaml b/deploy/.pre/auth-postman-secret.yaml
similarity index 100%
rename from deploy/auth-postman-secret.yaml
rename to deploy/.pre/auth-postman-secret.yaml
diff --git a/deploy/helm/Chart.yaml b/deploy/helm/Chart.yaml
new file mode 100644
index 0000000..1216850
--- /dev/null
+++ b/deploy/helm/Chart.yaml
@@ -0,0 +1,6 @@
+apiVersion: apps/v1
+name: auth-postman-HelmChart
+description: Helm Chart for auth-postman
+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..76a56b7
--- /dev/null
+++ b/deploy/helm/templates/config.yaml
@@ -0,0 +1,11 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: {{ .Release.Name }}-config
+data:
+  SMTP_HOST: "smtp.mail.ru"
+  SMTP_PORT: "587"
+  SMTP_SENDER: "test3kbotan@mail.ru"
+  KAFKA_HOST: "37.143.12.169"
+  KAFKA_PORT: "19092"
+  CHAT_ID: "150697696"
diff --git a/deploy/helm/templates/deployment.yaml b/deploy/helm/templates/deployment.yaml
new file mode 100644
index 0000000..e5aefb2
--- /dev/null
+++ b/deploy/helm/templates/deployment.yaml
@@ -0,0 +1,25 @@
+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
+          envFrom:
+            - secretRef:
+                name: {{ .Release.Name }}-secret
+            - configMapRef:
+                name: {{ .Release.Name }}-config
diff --git a/deploy/helm/templates/secret.yaml b/deploy/helm/templates/secret.yaml
new file mode 100644
index 0000000..bd7cb0e
--- /dev/null
+++ b/deploy/helm/templates/secret.yaml
@@ -0,0 +1,9 @@
+apiVersion: v1
+kind: Secret
+metadata:
+  name: {{ .Release.Name }}-secret
+type: Opaque
+data:
+  SMTP_PASSWORD: dlNKWWZVYnBhbWlVRmtLeDFESkE=
+  CHAT_TOKEN: NTk2MDU3NzM3NTpBQUVaWVBaVjQtRXJ4UWJYNnlQMDg0cEl6Q0IwQlB4TjdpZw==
+  SENTRY_DSN: aHR0cHM6Ly8zZjRiMzFkYmJkOWE0YTZiOGE3MWY5ODgxZDk2MmYyNUBvNDUwNDY1NDU2OTc5OTY4MC5pbmdlc3Quc2VudHJ5LmlvLzQ1MDQ2NTQ1NzI2ODMyNjQ=
diff --git a/deploy/helm/values.yaml b/deploy/helm/values.yaml
new file mode 100644
index 0000000..16713a8
--- /dev/null
+++ b/deploy/helm/values.yaml
@@ -0,0 +1,2 @@
+container:
+  image: slaventius/test3k_auth_postman:latest