From 54e14312022c681b176c37ca78f2da63ebc8dff0 Mon Sep 17 00:00:00 2001 From: Oleksandr Tsurenko Date: Tue, 25 Apr 2023 18:22:49 +0200 Subject: [PATCH] ServiceAccount and Port set to optional --- charts/common/Chart.yaml | 4 ++-- charts/common/templates/deployment.yaml | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/charts/common/Chart.yaml b/charts/common/Chart.yaml index 7ebf0f8..f0b1623 100644 --- a/charts/common/Chart.yaml +++ b/charts/common/Chart.yaml @@ -15,11 +15,11 @@ 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.0.2 +version: 0.0.3 # 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.0.2" +appVersion: "0.0.3" icon: https://cncf-branding.netlify.app/img/projects/helm/horizontal/color/helm-horizontal-color.png diff --git a/charts/common/templates/deployment.yaml b/charts/common/templates/deployment.yaml index b91123d..2439988 100644 --- a/charts/common/templates/deployment.yaml +++ b/charts/common/templates/deployment.yaml @@ -25,7 +25,9 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + {{- if .Values.serviceAccount.create -}} serviceAccountName: {{ include "common.serviceAccountName" . }} + {{- end }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: @@ -34,10 +36,12 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.service.containerPort }} ports: - name: http containerPort: {{ .Values.service.containerPort }} protocol: TCP + {{- end -}} env: {{- range $k, $v := .Values.env }} - name: {{ $k | quote }}