From e58be34daa6887eba2db98a6febd7bbcaa28a5e8 Mon Sep 17 00:00:00 2001 From: Paul Czarkowski Date: Thu, 17 Jan 2019 06:32:19 -0600 Subject: [PATCH] [stable/spinnaker] add external secret support for GCS (#10716) * [stable/spinnaker] add external secret support for GCS Allow user to supply their own pre-created secret for GCS storage Signed-off-by: Paul Czarkowski * fix faulty if statements Signed-off-by: Paul Czarkowski --- stable/spinnaker/Chart.yaml | 2 +- stable/spinnaker/templates/secrets/gcs.yaml | 6 +++++- stable/spinnaker/templates/statefulsets/halyard.yaml | 4 ++++ stable/spinnaker/values.yaml | 5 +++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/stable/spinnaker/Chart.yaml b/stable/spinnaker/Chart.yaml index 04b019799a..1292b7e2c4 100644 --- a/stable/spinnaker/Chart.yaml +++ b/stable/spinnaker/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Open source, multi-cloud continuous delivery platform for releasing software changes with high velocity and confidence. name: spinnaker -version: 1.1.8 +version: 1.2.0 appVersion: 1.9.1 home: http://spinnaker.io/ sources: diff --git a/stable/spinnaker/templates/secrets/gcs.yaml b/stable/spinnaker/templates/secrets/gcs.yaml index 7dc34784b8..f036e48f75 100644 --- a/stable/spinnaker/templates/secrets/gcs.yaml +++ b/stable/spinnaker/templates/secrets/gcs.yaml @@ -1,8 +1,12 @@ -{{ if .Values.gcs.enabled }} +{{ if and .Values.gcs.enabled .Values.gcs.jsonKey }} apiVersion: v1 kind: Secret metadata: +{{- if .Values.gcs.secret }} + name: {{ .Values.gcs.secret }} +{{- else }} name: {{ template "spinnaker.fullname" . }}-gcs +{{- end }} labels: {{ include "spinnaker.standard-labels" . | indent 4 }} component: halyard diff --git a/stable/spinnaker/templates/statefulsets/halyard.yaml b/stable/spinnaker/templates/statefulsets/halyard.yaml index 9e5549d459..14e4723900 100644 --- a/stable/spinnaker/templates/statefulsets/halyard.yaml +++ b/stable/spinnaker/templates/statefulsets/halyard.yaml @@ -54,7 +54,11 @@ spec: {{- if .Values.gcs.enabled }} - name: gcs-key secret: + {{- if .Values.gcs.secretName }} + secretName: {{ .Values.gce.secretName }} + {{- else }} secretName: {{ template "spinnaker.fullname" . }}-gcs + {{- end }} {{- end }} - name: reg-secrets secret: diff --git a/stable/spinnaker/values.yaml b/stable/spinnaker/values.yaml index f8b02e4989..79da2d0e27 100644 --- a/stable/spinnaker/values.yaml +++ b/stable/spinnaker/values.yaml @@ -131,7 +131,12 @@ gcs: enabled: false project: my-project-name bucket: "" + ## if jsonKey is set, will create a secret containing it jsonKey: '' + ## override the name of the secret to use for jsonKey, if `jsonKey` + ## is empty, it will not create a secret assuming you are creating one + ## external to the chart. the key for that secret should be `key.json`. + secretName: # AWS Simple Storage Service s3: