From 12044e3016b052c65a03ac7e874b3672fcd8c245 Mon Sep 17 00:00:00 2001 From: Daniel Panzella Date: Thu, 24 Oct 2024 08:40:00 -0700 Subject: [PATCH] feat: add envFrom for deployment and statefulset, add githash to chart version --- .github/workflows/pr-release.yaml | 3 ++- charts/wandb-service/templates/deployment.yaml | 4 ++++ charts/wandb-service/templates/statefulset.yaml | 8 ++++++++ charts/wandb-service/values.yaml | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-release.yaml b/.github/workflows/pr-release.yaml index afbd9408..69461dc1 100644 --- a/.github/workflows/pr-release.yaml +++ b/.github/workflows/pr-release.yaml @@ -54,8 +54,9 @@ jobs: env: PR_NUMBER: ${{ github.event.number }} run: | + git_hash=$(git rev-parse --short "$GITHUB_SHA") for chart in $(ct list-changed --config ct.yaml); do - helm package --version=$(helm show chart ${chart} | yq .version)-PR${PR_NUMBER} -d .cr-release-packages ${chart} + helm package --version=$(helm show chart ${chart} | yq .version)-PR${PR_NUMBER}-${git_hash} -d .cr-release-packages ${chart} done shell: bash diff --git a/charts/wandb-service/templates/deployment.yaml b/charts/wandb-service/templates/deployment.yaml index bf1c500e..2f8bdc9f 100644 --- a/charts/wandb-service/templates/deployment.yaml +++ b/charts/wandb-service/templates/deployment.yaml @@ -33,6 +33,10 @@ spec: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} + {{ with .Values.envFrom }} + envFrom: + {{- toYaml . | nindent 12 }} + {{- end }} {{ with .Values.env }} env: {{- toYaml . | nindent 12 }} diff --git a/charts/wandb-service/templates/statefulset.yaml b/charts/wandb-service/templates/statefulset.yaml index 9b3fd99b..fe0b1759 100644 --- a/charts/wandb-service/templates/statefulset.yaml +++ b/charts/wandb-service/templates/statefulset.yaml @@ -33,6 +33,14 @@ spec: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} + {{ with .Values.envFrom }} + envFrom: + {{- toYaml . | nindent 12 }} + {{- end }} + {{ with .Values.env }} + env: + {{- toYaml . | nindent 12 }} + {{- end }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" diff --git a/charts/wandb-service/values.yaml b/charts/wandb-service/values.yaml index 8589915b..9cf810a5 100644 --- a/charts/wandb-service/values.yaml +++ b/charts/wandb-service/values.yaml @@ -22,6 +22,7 @@ nameOverride: "" fullnameOverride: "" env: [] +envFrom: [] # This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/ serviceAccount: