From b8dda9a60f43988702a8e44802396f868a958fd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20A=2E=20Gombeaud?= <1173317+LoicGombeaud@users.noreply.github.com> Date: Tue, 7 Jun 2022 10:09:00 +0200 Subject: [PATCH] Feat: existing secret (#100) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Loïc Antoine-Gombeaud --- README.md | 1 + charts/verdaccio/Chart.yaml | 2 +- charts/verdaccio/templates/deployment.yaml | 8 +++++++- charts/verdaccio/values.yaml | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2ebed6e..ed5e858 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,7 @@ and their default values. | `serviceAccount.name` | Service account Name | none | | `extraEnvVars` | Define environment variables to be passed to the container | `[]` | | `secretEnvVars` | Define sensitive environment variables to be passed to the container | `{}` | +| `existingSecret` | Existing secret containing environment variables to be passed to the container | `""` | | `extraInitContainers` | Define additional initContainers to be added to the deployment | `[]` | | `securityContext` | Define Container Security Context | `{runAsUser=10001}` | | `podSecurityContext` | Define Pod Security Context | `{fsGroup=101}` | diff --git a/charts/verdaccio/Chart.yaml b/charts/verdaccio/Chart.yaml index a168680..7abed1c 100644 --- a/charts/verdaccio/Chart.yaml +++ b/charts/verdaccio/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: A lightweight private node.js proxy registry name: verdaccio -version: 4.8.0 +version: 4.9.0 appVersion: 5.5.0 home: https://verdaccio.org icon: https://cdn.verdaccio.dev/logos/default.png diff --git a/charts/verdaccio/templates/deployment.yaml b/charts/verdaccio/templates/deployment.yaml index 31185c5..b7bd03f 100644 --- a/charts/verdaccio/templates/deployment.yaml +++ b/charts/verdaccio/templates/deployment.yaml @@ -42,10 +42,16 @@ spec: - name: {{ template "verdaccio.name" . }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} - {{- if .Values.secretEnvVars }} + {{- if or .Values.secretEnvVars .Values.existingSecret }} envFrom: + {{- if .Values.secretEnvVars }} - secretRef: name: {{ template "verdaccio.fullname" . }}-env + {{- end }} + {{- if .Values.existingSecret }} + - secretRef: + name: {{ .Values.existingSecret }} + {{- end }} {{- end }} ports: - containerPort: 4873 diff --git a/charts/verdaccio/values.yaml b/charts/verdaccio/values.yaml index d45036d..97582d6 100644 --- a/charts/verdaccio/values.yaml +++ b/charts/verdaccio/values.yaml @@ -115,6 +115,10 @@ secretEnvVars: {} # corp_artifactory: foo # npmjs: bar +## Existing Secret +## Existing secret containing environment variables to be passed to the container +existingSecret: "" + # Extra Init Containers - allows yaml definitions extraInitContainers: []