From 8d545bdafb065a03b17351818ef7626367b5c79a Mon Sep 17 00:00:00 2001 From: viktoryathegreat Date: Sat, 23 Apr 2022 14:39:21 +0400 Subject: [PATCH] DMVP-129 Added env, command parts to deployment. --- charts/base/Chart.yaml | 4 ++-- charts/base/README.md | 12 ++++++------ charts/base/templates/deployment.yaml | 15 +++++++++++++++ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/charts/base/Chart.yaml b/charts/base/Chart.yaml index 7a3f096..de59fbf 100644 --- a/charts/base/Chart.yaml +++ b/charts/base/Chart.yaml @@ -15,10 +15,10 @@ 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.23 +version: 0.1.24 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. # It is recommended to use it with quotes. -appVersion: "0.1.23" +appVersion: "0.1.24" diff --git a/charts/base/README.md b/charts/base/README.md index 18ebd0a..dbf4666 100644 --- a/charts/base/README.md +++ b/charts/base/README.md @@ -1,7 +1,7 @@ ``` dependencies: - name: base - version: 0.1.21 + version: 0.1.24 repository: https://dasmeta.github.io/helm ``` @@ -94,9 +94,9 @@ Here are 2 examples about this: **Alias is not specified, name, version and appVersion are not overridden by parent chart** In this case, labels will be like this:** -- `helm.sh/chart: base-0.1.21` +- `helm.sh/chart: base-0.1.24` - `app.kubernetes.io/name: base` -- `app.kubernetes.io/version: 0.1.21` +- `app.kubernetes.io/version: 0.1.24` Chart.yaml ``` @@ -109,7 +109,7 @@ appVersion: "0.1.0" dependencies: - name: base - version: 0.1.21 + version: 0.1.24 repository: https://dasmeta.github.io/helm ``` @@ -145,7 +145,7 @@ appVersion: "0.1.0" dependencies: - name: base - version: 0.1.21 + version: 0.1.24 repository: https://dasmeta.github.io/helm alias: my-app-base ``` @@ -173,7 +173,7 @@ appVersion: "0.1.0" dependencies: - name: base - version: 0.1.21 + version: 0.1.24 repository: https://dasmeta.github.io/helm ``` diff --git a/charts/base/templates/deployment.yaml b/charts/base/templates/deployment.yaml index 00b0d26..29e0434 100644 --- a/charts/base/templates/deployment.yaml +++ b/charts/base/templates/deployment.yaml @@ -38,12 +38,27 @@ spec: serviceAccountName: {{ include "base.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- if .Values.initContainers }} + initContainers: + {{- toYaml .Values.initContainers | nindent 6 }} + {{- end }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if $.Values.command }} + command: + {{ toYaml .Values.command | nindent 12 }} + {{- end }} + {{- if .Values.extraEnv }} + env: + {{- range $key, $value := .Values.extraEnv }} + - name: {{ $key | quote}} + value: {{ $value | quote }} + {{- end }} + {{- end }} ports: - name: http containerPort: {{ .Values.containerPort | default 80 }}