diff --git a/stable/spinnaker/Chart.yaml b/stable/spinnaker/Chart.yaml index aeacfd5089..16143b61ee 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.21.0 +version: 1.22.0 appVersion: 1.16.2 home: http://spinnaker.io/ sources: diff --git a/stable/spinnaker/templates/configmap/halyard-init-script.yaml b/stable/spinnaker/templates/configmap/halyard-init-script.yaml index f1291442ca..d7033d9249 100644 --- a/stable/spinnaker/templates/configmap/halyard-init-script.yaml +++ b/stable/spinnaker/templates/configmap/halyard-init-script.yaml @@ -11,6 +11,7 @@ data: # Override Halyard daemon's listen address cp /opt/halyard/config/* /tmp/config printf 'server.address: 0.0.0.0\n' > /tmp/config/halyard-local.yml + # Use Redis deployed via the dependent Helm chart rm -rf /tmp/spinnaker/.hal/default/service-settings mkdir -p /tmp/spinnaker/.hal/default/service-settings @@ -20,12 +21,24 @@ data: mkdir -p /tmp/spinnaker/.hal/default/profiles cp /tmp/additionalProfileConfigMaps/* /tmp/spinnaker/.hal/default/profiles/ + rm -rf /tmp/spinnaker/.hal/.boms + {{- if .Values.halyard.bom }} - rm -rf /tmp/spinnaker/.hal/.boms/bom mkdir -p /tmp/spinnaker/.hal/.boms/bom cp /tmp/halyard-bom/* /tmp/spinnaker/.hal/.boms/bom {{- end }} + {{- if .Values.halyard.serviceConfigs }} + for filename in /tmp/service-configs/*; do + basename=$(basename -- "$filename") + fname="${basename#*_}" + servicename="${basename%%_*}" + + mkdir -p "/tmp/spinnaker/.hal/.boms/$servicename" + cp "$filename" "/tmp/spinnaker/.hal/.boms/$servicename/$fname" + done + {{- end }} + {{- if hasKey .Values.halyard "additionalInitScript" }} # additionalInitScript {{ tpl .Values.halyard.additionalInitScript $ | indent 4 }} diff --git a/stable/spinnaker/templates/configmap/service-configs.yaml b/stable/spinnaker/templates/configmap/service-configs.yaml new file mode 100644 index 0000000000..58dd099551 --- /dev/null +++ b/stable/spinnaker/templates/configmap/service-configs.yaml @@ -0,0 +1,28 @@ +{{ if .Values.halyard.serviceConfigs -}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "spinnaker.fullname" . }}-service-configs + labels: +{{ include "spinnaker.standard-labels" . | indent 4 }} + +{{/* +Render local configuration for each service with values passed by +.Values.halyard.serviceConfigs +*/}} +{{- $settings := dict -}} + +{{- if .Values.halyard.serviceConfigs -}} +{{- $_ := mergeOverwrite $settings .Values.halyard.serviceConfigs -}} +{{- end -}} + +{{- /* Convert the content of settings key to YAML string */}} +{{- range $filename, $content := $settings -}} +{{- if not (typeIs "string" $content) -}} +{{- $_ := set $settings $filename ($content | toYaml) -}} +{{- end -}} +{{- end -}} + +data: +{{ $settings | toYaml | indent 2 }} +{{- end -}} diff --git a/stable/spinnaker/templates/statefulsets/halyard.yaml b/stable/spinnaker/templates/statefulsets/halyard.yaml index e32d8ab32e..9d4fce2a49 100644 --- a/stable/spinnaker/templates/statefulsets/halyard.yaml +++ b/stable/spinnaker/templates/statefulsets/halyard.yaml @@ -40,6 +40,10 @@ spec: mountPath: /tmp/config - name: service-settings mountPath: /tmp/service-settings + {{- if .Values.halyard.serviceConfigs }} + - name: service-configs + mountPath: /tmp/service-configs + {{- end }} - name: halyard-home mountPath: /tmp/spinnaker - name: additional-profile-config-maps @@ -121,6 +125,11 @@ spec: - name: service-settings configMap: name: {{ template "spinnaker.fullname" . }}-service-settings + {{- if .Values.halyard.serviceConfigs }} + - name: service-configs + configMap: + name: {{ template "spinnaker.fullname" . }}-service-configs + {{- end }} - name: halyard-initscript configMap: name: {{ template "spinnaker.fullname" . }}-halyard-init-script diff --git a/stable/spinnaker/values.yaml b/stable/spinnaker/values.yaml index 6efcf854d9..df7d8bcba8 100644 --- a/stable/spinnaker/values.yaml +++ b/stable/spinnaker/values.yaml @@ -78,6 +78,26 @@ halyard: # timestamp: '2019-09-16 18:18:44' # version: 1.16.1 + ## Define local configuration for Spinnaker services. + ## The contents of these files would be copies of the configuration normally retrieved from + ## `gs://halconfig/`, but instead need to be available locally on the halyard pod to facilitate + ## offline installation. This would typically be used along with a custom `bom:` with the `local:` prefix on a + ## service version. + ## Read more for details: + ## https://www.spinnaker.io/guides/operator/custom-boms/#boms-and-configuration-on-your-filesystem + ## The key for each entry must be the name of the service and a file name separated by the '_' character. + serviceConfigs: {} + # clouddriver_clouddriver-ro.yml: |- + # ... + # clouddriver_clouddriver-rw.yml: |- + # ... + # clouddriver_clouddriver.yml: |- + # ... + # deck_settings.json: |- + # ... + # echo_echo.yml: |- + # ... + ## Uncomment if you want to add extra commands to the init script ## run by the init container before halyard is started. ## The content will be passed through `tpl`, so value interpolation is supported.