From f6f05c67649608de3556b1b01a588edf881a5b24 Mon Sep 17 00:00:00 2001 From: kandrusyak Date: Tue, 18 Jul 2023 02:09:19 +0300 Subject: [PATCH] update deployment --- deploy/.env | 2 +- deploy/Chart.yaml | 4 +- deploy/templates/deployment.yaml | 74 ++++++++++++++++---------------- deploy/values.template.yaml | 2 + 4 files changed, 43 insertions(+), 39 deletions(-) diff --git a/deploy/.env b/deploy/.env index 2f9f9ec..057f697 100644 --- a/deploy/.env +++ b/deploy/.env @@ -1,2 +1,2 @@ SERVICE_REPLICAS=3 -SERVICE_PORT=8080 \ No newline at end of file +SERVICE_PORT=8080 diff --git a/deploy/Chart.yaml b/deploy/Chart.yaml index 5c02396..3ef0dc0 100644 --- a/deploy/Chart.yaml +++ b/deploy/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -name: astra-api-gateway +name: astra-users appVersion: latest description: A Helm chart to deploy app - astra @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.1 +version: 0.1.0 engine: gotpl diff --git a/deploy/templates/deployment.yaml b/deploy/templates/deployment.yaml index 501188f..06799b8 100644 --- a/deploy/templates/deployment.yaml +++ b/deploy/templates/deployment.yaml @@ -1,37 +1,39 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ .Values.app.fullName }} -spec: - replicas: {{ .Values.replicas }} - revisionHistoryLimit: 10 - selector: - matchLabels: - app: {{ .Values.app.fullName }} - strategy: - rollingUpdate: - maxSurge: 25% - maxUnavailable: 25% - type: RollingUpdate - template: - metadata: - labels: - app: {{ .Values.app.fullName }} - spec: - imagePullSecrets: - - name: {{ .Values.images.pullSecret }} - containers: - - name: {{ .Values.app.fullName }} - env: - - name: TZ - value: Europe/Moscow - - name: PORT - value: {{ .Values.app.server.port | quote }} - {{- .Values.envs | toYaml | nindent 12 }} - - image: {{ .Values.app.image }}:{{ .Chart.AppVersion }} #"docker-registry.dopcore.com/andrusyakka/urban-couscous:latest" - imagePullPolicy: Always - ports: - - name: http - containerPort: {{ .Values.app.server.port }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.app.fullName }} +spec: + replicas: {{ .Values.replicas }} + revisionHistoryLimit: 10 + selector: + matchLabels: + app: {{ .Values.app.fullName }} + strategy: + rollingUpdate: + maxSurge: 25% + maxUnavailable: 25% + type: RollingUpdate + template: + metadata: + labels: + app: {{ .Values.app.fullName }} + spec: + imagePullSecrets: + - name: {{ .Values.images.pullSecret }} + containers: + - name: {{ .Values.app.fullName }} + env: + - name: TZ + value: Europe/Moscow + - name: PORT + value: {{ .Values.app.server.port | quote }} + - name: CONNECTION_STRING + value: {{ .Values.app.db.connection_string }} + {{- .Values.envs | toYaml | nindent 12 }} + + image: {{ .Values.app.image }}:{{ .Chart.AppVersion }} + imagePullPolicy: Always + ports: + - name: http + containerPort: {{ .Values.app.server.port }} protocol: TCP \ No newline at end of file diff --git a/deploy/values.template.yaml b/deploy/values.template.yaml index 0adf226..aee6d6b 100644 --- a/deploy/values.template.yaml +++ b/deploy/values.template.yaml @@ -1,6 +1,8 @@ app: fullName: ${CI_PROJECT_TITLE} image: docker-registry.dopcore.com/${CI_PROJECT_PATH} + db: + connection_string: ${CONNECTION_STRING} server: port: ${SERVICE_PORT}