From 4e74fa8ff27a45d23dedd13c61d07cb4dbc85a30 Mon Sep 17 00:00:00 2001 From: Phil Sphicas Date: Thu, 19 Mar 2020 17:37:45 -0700 Subject: [PATCH] Fix rendering for volumes and mounts in Armada pod Rendering for custom volume mounts in the Armada deployment is broken: the tiller container is missing the volumeMounts: key, and the volume mounts are not being applied at all to the armada_api container. This change allows distinct volume mounts for the containers, defined under: .pod.mounts.armada_api.armada_api.volumeMounts .pod.mounts.armada_api.tiller.volumeMounts The pod's volumes: key includes a concatenation of whatever is defined under these keys (without any deduplication): .pod.mounts.armada_api.armada_api.volumes .pod.mounts.armada_api.tiller.volumes Change-Id: I7b5dd491df01cf30be9f2f2c2b25c427472832fb --- charts/armada/templates/deployment-api.yaml | 8 +++++++- charts/armada/values.yaml | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/charts/armada/templates/deployment-api.yaml b/charts/armada/templates/deployment-api.yaml index a48c8b64..644147fe 100644 --- a/charts/armada/templates/deployment-api.yaml +++ b/charts/armada/templates/deployment-api.yaml @@ -39,6 +39,7 @@ httpGet: {{- $labels := tuple $envAll "armada" "api" | include "helm-toolkit.snippets.kubernetes_metadata_labels" -}} {{- $mounts_armada_api := .Values.pod.mounts.armada_api.armada_api }} {{- $mounts_armada_api_init := .Values.pod.mounts.armada_api.init_container }} +{{- $mounts_armada_api_tiller := .Values.pod.mounts.armada_api.tiller }} {{- $prometheus_annotations := $envAll.Values.monitoring.prometheus.armada }} {{- $serviceAccountName := "armada-api" }} {{ tuple $envAll "api" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} @@ -154,6 +155,7 @@ spec: mountPath: /etc/armada/policy.yaml subPath: policy.yaml readOnly: true +{{ if $mounts_armada_api.volumeMounts }}{{ toYaml $mounts_armada_api.volumeMounts | indent 12 }}{{ end }} {{- if .Values.conf.tiller.enabled }} - name: tiller {{ tuple $envAll "tiller" | include "helm-toolkit.snippets.image" | indent 10 }} @@ -194,8 +196,9 @@ spec: protocol: TCP {{ dict "envAll" $envAll "component" "armada" "container" "tiller" "type" "readiness" "probeTemplate" (include "tillerReadinessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }} {{ dict "envAll" $envAll "component" "armada" "container" "tiller" "type" "liveness" "probeTemplate" (include "tillerLivenessProbeTemplate" $envAll | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }} + volumeMounts: +{{ if $mounts_armada_api_tiller.volumeMounts }}{{ toYaml $mounts_armada_api_tiller.volumeMounts | indent 12 }}{{ end }} {{- end }} -{{ if $mounts_armada_api.volumeMounts }}{{ toYaml $mounts_armada_api.volumeMounts | indent 12 }}{{ end }} volumes: - name: pod-tmp emptyDir: {} @@ -210,4 +213,7 @@ spec: name: armada-etc defaultMode: 0444 {{ if $mounts_armada_api.volumes }}{{ toYaml $mounts_armada_api.volumes | indent 8 }}{{ end }} +{{- if .Values.conf.tiller.enabled }} +{{ if $mounts_armada_api_tiller.volumes }}{{ toYaml $mounts_armada_api_tiller.volumes | indent 8 }}{{ end }} +{{- end }} {{- end }} diff --git a/charts/armada/values.yaml b/charts/armada/values.yaml index 4c1e603e..97fa6407 100644 --- a/charts/armada/values.yaml +++ b/charts/armada/values.yaml @@ -300,6 +300,12 @@ pod: mounts: armada_api: init_container: null + armada_api: + volumes: [] + volumeMounts: [] + tiller: + volumes: [] + volumeMounts: [] affinity: anti: type: