diff --git a/stable/spinnaker/Chart.yaml b/stable/spinnaker/Chart.yaml index 1661d7a3df..122b1b7551 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.15.0 +version: 1.16.0 appVersion: 1.12.5 home: http://spinnaker.io/ sources: diff --git a/stable/spinnaker/README.md b/stable/spinnaker/README.md index 25aa2d0f69..42fc5d61d8 100644 --- a/stable/spinnaker/README.md +++ b/stable/spinnaker/README.md @@ -36,6 +36,7 @@ $ helm install --name my-release -f values.yaml stable/spinnaker ## Adding Kubernetes Clusters to Spinnaker +### Configuring arbitrary clusters with a kubernetes secret By default, installing the chart only registers the local cluster as a deploy target for Spinnaker. If you want to add arbitrary clusters need to do the following: @@ -45,7 +46,7 @@ for Spinnaker. If you want to add arbitrary clusters need to do the following: $ kubectl create secret generic --from-file=$HOME/.kube/config my-kubeconfig ``` -1. Set the following values of the chart: +2. Set the following values of the chart: ```yaml kubeConfig: @@ -60,6 +61,30 @@ kubeConfig: deploymentContext: my-context ``` +### Configuring arbitrary clusters with s3 +By default, installing the chart only registers the local cluster as a deploy target +for Spinnaker. If you do not want to store your kubeconfig as a secret on the cluster, you +can also store in s3. Full documentation can be found [here](https://www.spinnaker.io/reference/halyard/secrets/s3-secrets/#secrets-in-s3). + +1. Upload your kubeconfig to a s3 bucket that halyard and spinnaker services can access. + + +2. Set the following values of the chart: + +```yaml +kubeConfig: + enabled: true + # secretName: my-kubeconfig + # secretKey: config + encryptedKubeconfig: encrypted:s3!r:us-west-2!b:mybucket!f:mykubeconfig + contexts: + # Names of contexts available in the uploaded kubeconfig + - my-context + # This is the context from the list above that you would like + # to deploy Spinnaker itself to. + deploymentContext: my-context +``` + ## Specifying Docker Registries and Valid Images (Repositories) Spinnaker will only give you access to Docker images that have been whitelisted, if you're using a private registry or a private repository you also need to provide credentials. Update the following values of the chart to do so: diff --git a/stable/spinnaker/templates/_helpers.tpl b/stable/spinnaker/templates/_helpers.tpl index 71370d4f21..2540b5edc3 100644 --- a/stable/spinnaker/templates/_helpers.tpl +++ b/stable/spinnaker/templates/_helpers.tpl @@ -55,3 +55,14 @@ Redis base URL for Spinnaker {{- printf "redis://%s:%s" .Values.redis.external.host (.Values.redis.external.port | toString) -}} {{- end }} {{- end }} + +{{/* +Create name of kubeconfig file to use when setting up kubernetes provider +*/}} +{{- define "spinnaker.kubeconfig" -}} +{{- if .Values.kubeconfig.encryptedKubeconfig }} +{{- printf .Values.kubeconfig.encryptedKubeconfig | toString -}} +{{- else }} +{{- printf "/opt/kube/%s" .Values.kubeConfig.secretKey | toString -}} +{{- end }} +{{- end }} diff --git a/stable/spinnaker/templates/configmap/halyard-config.yaml b/stable/spinnaker/templates/configmap/halyard-config.yaml index 3d79812385..8450fd309f 100644 --- a/stable/spinnaker/templates/configmap/halyard-config.yaml +++ b/stable/spinnaker/templates/configmap/halyard-config.yaml @@ -110,7 +110,7 @@ data: $HAL_COMMAND config provider kubernetes account $PROVIDER_COMMAND {{ $context }} --docker-registries dockerhub \ --context {{ $context }} {{ if not $.Values.kubeConfig.enabled }}--service-account true{{ end }} \ - {{ if $.Values.kubeConfig.enabled }}--kubeconfig-file /opt/kube/{{ $.Values.kubeConfig.secretKey }}{{ end }} \ + {{ if $.Values.kubeConfig.enabled }}--kubeconfig-file {{ template "spinnaker.kubeconfig" $ }}{{ end }} \ {{ if $.Values.kubeConfig.onlySpinnakerManaged.enabled }}--only-spinnaker-managed true{{ end }} \ --omit-namespaces={{ template "omittedNameSpaces" $ }} --provider-version v2 {{- end }} diff --git a/stable/spinnaker/values.yaml b/stable/spinnaker/values.yaml index c6c79a8d36..5fbae3237d 100644 --- a/stable/spinnaker/values.yaml +++ b/stable/spinnaker/values.yaml @@ -117,6 +117,11 @@ kubeConfig: enabled: false secretName: my-kubeconfig secretKey: config + # Use this when you want to configure halyard to reference a kubeconfig from s3 + # This allows you to keep your kubeconfig in an encrypted s3 bucket + # For more info visit: + # https://www.spinnaker.io/reference/halyard/secrets/s3-secrets/#secrets-in-s3 + # encryptedKubeconfig: encrypted:s3!r:us-west-2!b:mybucket!f:mykubeconfig # List of contexts from the kubeconfig to make available to Spinnaker contexts: - default