From 0ea9be7ade457c3b41a9190225bd290722cf7532 Mon Sep 17 00:00:00 2001 From: John Haan Date: Wed, 22 May 2019 14:29:38 +0900 Subject: [PATCH] Rafactoring volume mount variables in db sync job This patch make the db sync job template follows the same pattern that other templates utilize the variables to make in a predictable pattern. Change-Id: Idbedd046c6b4fd001cf63004ffac792173a5778b Story: 2005754 Task: 33457 --- aodh/templates/job-db-sync.yaml | 1 + aodh/values.yaml | 4 ++++ barbican/templates/job-db-sync.yaml | 2 +- barbican/values.yaml | 4 ++++ ceilometer/templates/job-db-sync.yaml | 2 +- ceilometer/values.yaml | 4 ++++ cinder/templates/job-db-sync.yaml | 2 +- cinder/values.yaml | 4 ++++ congress/templates/job-db-sync.yaml | 1 + congress/values.yaml | 5 +++++ glance/templates/job-db-sync.yaml | 6 +++--- glance/values.yaml | 4 ++++ heat/templates/job-db-sync.yaml | 2 +- heat/values.yaml | 4 ++++ ironic/templates/job-db-sync.yaml | 2 +- ironic/values.yaml | 4 ++++ magnum/templates/job-db-sync.yaml | 2 +- magnum/values.yaml | 4 ++++ mistral/templates/job-db-sync.yaml | 2 +- mistral/values.yaml | 4 ++++ neutron/templates/job-db-sync.yaml | 3 +-- neutron/values.yaml | 8 ++++++++ nova/templates/job-db-sync.yaml | 2 +- nova/values.yaml | 4 ++++ panko/templates/job-db-sync.yaml | 2 +- panko/values.yaml | 4 ++++ senlin/templates/job-db-sync.yaml | 2 +- senlin/values.yaml | 4 ++++ 28 files changed, 77 insertions(+), 15 deletions(-) diff --git a/aodh/templates/job-db-sync.yaml b/aodh/templates/job-db-sync.yaml index a642f19432..11f14fa373 100644 --- a/aodh/templates/job-db-sync.yaml +++ b/aodh/templates/job-db-sync.yaml @@ -16,5 +16,6 @@ limitations under the License. {{- if .Values.manifests.job_db_sync }} {{- $dbSyncJob := dict "envAll" . "serviceName" "aodh" -}} +{{- $dbSyncJob := dict "envAll" . "serviceName" "aodh" "podVolMounts" .Values.pod.mounts.aodh_db_sync.aodh_db_sync.volumeMounts "podVols" .Values.pod.mounts.aodh_db_sync.aodh_db_sync.volumes -}} {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/aodh/values.yaml b/aodh/values.yaml index 093695c6fe..381e45694d 100644 --- a/aodh/values.yaml +++ b/aodh/values.yaml @@ -133,6 +133,10 @@ pod: aodh_tests: volumeMounts: volumes: + aodh_db_sync: + aodh_db_sync: + volumeMounts: + volumes: replicas: api: 1 evaluator: 1 diff --git a/barbican/templates/job-db-sync.yaml b/barbican/templates/job-db-sync.yaml index 014406e1dc..5c23765787 100644 --- a/barbican/templates/job-db-sync.yaml +++ b/barbican/templates/job-db-sync.yaml @@ -15,6 +15,6 @@ limitations under the License. */}} {{- if .Values.manifests.job_db_sync }} -{{- $dbSyncJob := dict "envAll" . "serviceName" "barbican" -}} +{{- $dbSyncJob := dict "envAll" . "serviceName" "barbican" "podVolMounts" .Values.pod.mounts.barbican_db_sync.barbican_db_sync.volumeMounts "podVols" .Values.pod.mounts.barbican_db_sync.barbican_db_sync.volumes -}} {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/barbican/values.yaml b/barbican/values.yaml index 09210a4c72..3e7d022a8d 100644 --- a/barbican/values.yaml +++ b/barbican/values.yaml @@ -77,6 +77,10 @@ pod: barbican_tests: volumeMounts: volumes: + barbican_db_sync: + barbican_db_sync: + volumeMounts: + volumes: replicas: api: 1 lifecycle: diff --git a/ceilometer/templates/job-db-sync.yaml b/ceilometer/templates/job-db-sync.yaml index d31a32928b..0f364c93eb 100644 --- a/ceilometer/templates/job-db-sync.yaml +++ b/ceilometer/templates/job-db-sync.yaml @@ -15,6 +15,6 @@ limitations under the License. */}} {{- if .Values.manifests.job_db_sync }} -{{- $dbSyncJob := dict "envAll" . "serviceName" "ceilometer" -}} +{{- $dbSyncJob := dict "envAll" . "serviceName" "ceilometer" "podVolMounts" .Values.pod.mounts.ceilometer_db_sync.ceilometer_db_sync.volumeMounts "podVols" .Values.pod.mounts.ceilometer_db_sync.ceilometer_db_sync.volumes -}} {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/ceilometer/values.yaml b/ceilometer/values.yaml index c42ea46cca..26faa1dc16 100644 --- a/ceilometer/values.yaml +++ b/ceilometer/values.yaml @@ -1956,6 +1956,10 @@ pod: ceilometer_notification: volumeMounts: volumes: + ceilometer_db_sync: + ceilometer_db_sync: + volumeMounts: + volumes: replicas: api: 1 central: 1 diff --git a/cinder/templates/job-db-sync.yaml b/cinder/templates/job-db-sync.yaml index 7e20e82e4f..bb609ce5d0 100644 --- a/cinder/templates/job-db-sync.yaml +++ b/cinder/templates/job-db-sync.yaml @@ -15,6 +15,6 @@ limitations under the License. */}} {{- if .Values.manifests.job_db_sync }} -{{- $dbSyncJob := dict "envAll" . "serviceName" "cinder" -}} +{{- $dbSyncJob := dict "envAll" . "serviceName" "cinder" "podVolMounts" .Values.pod.mounts.cinder_db_sync.cinder_db_sync.volumeMounts "podVols" .Values.pod.mounts.cinder_db_sync.cinder_db_sync.volumes -}} {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/cinder/values.yaml b/cinder/values.yaml index e05f2b17a2..1c8c3f8e5f 100644 --- a/cinder/values.yaml +++ b/cinder/values.yaml @@ -134,6 +134,10 @@ pod: cinder_tests: volumeMounts: volumes: + cinder_db_sync: + cinder_db_sync: + volumeMounts: + volumes: replicas: api: 1 volume: 1 diff --git a/congress/templates/job-db-sync.yaml b/congress/templates/job-db-sync.yaml index 6d87e91513..0a4e8792b6 100644 --- a/congress/templates/job-db-sync.yaml +++ b/congress/templates/job-db-sync.yaml @@ -16,5 +16,6 @@ limitations under the License. {{- if .Values.manifests.job_db_sync }} {{- $dbSyncJob := dict "envAll" . "serviceName" "congress" -}} +{{- $dbSyncJob := dict "envAll" . "serviceName" "congress" "podVolMounts" .Values.pod.mounts.congress_db_sync.congress_db_sync.volumeMounts "podVols" .Values.pod.mounts.congress_db_sync.congress_db_sync.volumes -}} {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/congress/values.yaml b/congress/values.yaml index b06d946d60..9a3908ec4f 100644 --- a/congress/values.yaml +++ b/congress/values.yaml @@ -477,6 +477,11 @@ pod: default: kubernetes.io/hostname weight: default: 10 + mounts: + congress_db_sync: + congress_db_sync: + volumeMounts: + volumes: replicas: api: 1 policy_engine: 1 diff --git a/glance/templates/job-db-sync.yaml b/glance/templates/job-db-sync.yaml index 5ee2c83ab4..2f98d34d99 100644 --- a/glance/templates/job-db-sync.yaml +++ b/glance/templates/job-db-sync.yaml @@ -15,8 +15,8 @@ limitations under the License. */}} {{- if .Values.manifests.job_db_sync }} -{{- $serviceName := "glance" -}} -{{- $dbToSync := index . "dbToSync" | default ( dict "configFile" (printf "/etc/%s/%s.conf" $serviceName "glance-api" ) "logConfigFile" (printf "/etc/%s/logging.conf" $serviceName ) "image" ( index .Values.images.tags ( printf "%s_db_sync" $serviceName )) ) -}} -{{- $dbSyncJob := dict "envAll" . "serviceName" $serviceName "dbToSync" $dbToSync -}} +{{- $dbToSync := index . "dbToSync" | default ( dict "configFile" (printf "/etc/%s/%s.conf" "glance" "glance-api" ) "logConfigFile" (printf "/etc/%s/logging.conf" "glance" ) "image" ( index .Values.images.tags ( printf "%s_db_sync" "glance" )) ) -}} +{{- $dbSyncJob := dict "envAll" . "serviceName" "glance" "podVolMounts" .Values.pod.mounts.glance_db_sync.glance_db_sync.volumeMounts "podVols" .Values.pod.mounts.glance_db_sync.glance_db_sync.volumes "dbToSync" $dbToSync -}} + {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/glance/values.yaml b/glance/values.yaml index 09ae97ad59..a5289f7d19 100644 --- a/glance/values.yaml +++ b/glance/values.yaml @@ -842,6 +842,10 @@ pod: glance_tests: volumeMounts: volumes: + glance_db_sync: + glance_db_sync: + volumeMounts: + volumes: replicas: api: 1 registry: 1 diff --git a/heat/templates/job-db-sync.yaml b/heat/templates/job-db-sync.yaml index 08f3281f08..6a7823e084 100644 --- a/heat/templates/job-db-sync.yaml +++ b/heat/templates/job-db-sync.yaml @@ -15,6 +15,6 @@ limitations under the License. */}} {{- if .Values.manifests.job_db_sync }} -{{- $dbSyncJob := dict "envAll" . "serviceName" "heat" -}} +{{- $dbSyncJob := dict "envAll" . "serviceName" "heat" "podVolMounts" .Values.pod.mounts.heat_db_sync.heat_db_sync.volumeMounts "podVols" .Values.pod.mounts.heat_db_sync.heat_db_sync.volumes -}} {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/heat/values.yaml b/heat/values.yaml index dc0c82100b..d32f8d62b9 100644 --- a/heat/values.yaml +++ b/heat/values.yaml @@ -1079,6 +1079,10 @@ pod: heat_tests: volumeMounts: volumes: + heat_db_sync: + heat_db_sync: + volumeMounts: + volumes: replicas: api: 1 cfn: 1 diff --git a/ironic/templates/job-db-sync.yaml b/ironic/templates/job-db-sync.yaml index bcd91907f3..060d1740bd 100644 --- a/ironic/templates/job-db-sync.yaml +++ b/ironic/templates/job-db-sync.yaml @@ -15,6 +15,6 @@ limitations under the License. */}} {{- if .Values.manifests.job_db_sync }} -{{- $dbSyncJob := dict "envAll" . "serviceName" "ironic" -}} +{{- $dbSyncJob := dict "envAll" . "serviceName" "ironic" "podVolMounts" .Values.pod.mounts.ironic_db_sync.ironic_db_sync.volumeMounts "podVols" .Values.pod.mounts.ironic_db_sync.ironic_db_sync.volumes -}} {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/ironic/values.yaml b/ironic/values.yaml index 2425661065..3af3b434ac 100644 --- a/ironic/values.yaml +++ b/ironic/values.yaml @@ -581,6 +581,10 @@ pod: ironic_bootstrap: volumeMounts: volumes: + ironic_db_sync: + ironic_db_sync: + volumeMounts: + volumes: replicas: api: 1 conductor: 1 diff --git a/magnum/templates/job-db-sync.yaml b/magnum/templates/job-db-sync.yaml index 5ffe50deb7..c7d9d51db0 100644 --- a/magnum/templates/job-db-sync.yaml +++ b/magnum/templates/job-db-sync.yaml @@ -15,6 +15,6 @@ limitations under the License. */}} {{- if .Values.manifests.job_db_sync }} -{{- $dbSyncJob := dict "envAll" . "serviceName" "magnum" -}} +{{- $dbSyncJob := dict "envAll" . "serviceName" "magnum" "podVolMounts" .Values.pod.mounts.magnum_db_sync.magnum_db_sync.volumeMounts "podVols" .Values.pod.mounts.magnum_db_sync.magnum_db_sync.volumes -}} {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/magnum/values.yaml b/magnum/values.yaml index ce3e510b8e..e4928cb1e8 100644 --- a/magnum/values.yaml +++ b/magnum/values.yaml @@ -506,6 +506,10 @@ pod: magnum_bootstrap: volumeMounts: volumes: + magnum_db_sync: + magnum_db_sync: + volumeMounts: + volumes: replicas: api: 1 conductor: 1 diff --git a/mistral/templates/job-db-sync.yaml b/mistral/templates/job-db-sync.yaml index ac5c5071bb..c8282d6c4f 100644 --- a/mistral/templates/job-db-sync.yaml +++ b/mistral/templates/job-db-sync.yaml @@ -16,6 +16,6 @@ limitations under the License. */}} {{- if .Values.manifests.job_db_sync }} -{{- $dbSyncJob := dict "envAll" . "serviceName" "mistral" -}} +{{- $dbSyncJob := dict "envAll" . "serviceName" "mistral" "podVolMounts" .Values.pod.mounts.mistral_db_sync.mistral_db_sync.volumeMounts "podVols" .Values.pod.mounts.mistral_db_sync.mistral_db_sync.volumes -}} {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/mistral/values.yaml b/mistral/values.yaml index c5367e8c9b..81e3f19127 100644 --- a/mistral/values.yaml +++ b/mistral/values.yaml @@ -570,6 +570,10 @@ pod: mistral_tests: volumeMounts: volumes: + mistral_db_sync: + mistral_db_sync: + volumeMounts: + volumes: replicas: api: 1 engine: 1 diff --git a/neutron/templates/job-db-sync.yaml b/neutron/templates/job-db-sync.yaml index cb723998d0..5699b049f4 100644 --- a/neutron/templates/job-db-sync.yaml +++ b/neutron/templates/job-db-sync.yaml @@ -15,7 +15,6 @@ limitations under the License. */}} {{- if .Values.manifests.job_db_sync }} -{{- $podVolMounts := list (dict "name" "db-sync-conf" "mountPath" "/etc/neutron/plugins/ml2/ml2_conf.ini" "subPath" "ml2_conf.ini" "readOnly" true )}} -{{- $dbSyncJob := dict "envAll" . "serviceName" "neutron" "podVolMounts" $podVolMounts -}} +{{- $dbSyncJob := dict "envAll" . "serviceName" "neutron" "podVolMounts" .Values.pod.mounts.neutron_db_sync.neutron_db_sync.volumeMounts "podVols" .Values.pod.mounts.neutron_db_sync.neutron_db_sync.volumes -}} {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/neutron/values.yaml b/neutron/values.yaml index 6437208db1..ebd1ad5216 100644 --- a/neutron/values.yaml +++ b/neutron/values.yaml @@ -358,6 +358,14 @@ pod: neutron_bootstrap: volumeMounts: volumes: + neutron_db_sync: + neutron_db_sync: + volumeMounts: + - name: db-sync-conf + mountPath: /etc/neutron/plugins/ml2/ml2_conf.ini + subPath: ml2_conf.ini + readOnly: true + volumes: replicas: server: 1 lifecycle: diff --git a/nova/templates/job-db-sync.yaml b/nova/templates/job-db-sync.yaml index 706fdb9863..e88778a55d 100644 --- a/nova/templates/job-db-sync.yaml +++ b/nova/templates/job-db-sync.yaml @@ -15,6 +15,6 @@ limitations under the License. */}} {{- if .Values.manifests.job_db_sync }} -{{- $dbSyncJob := dict "envAll" . "serviceName" "nova" -}} +{{- $dbSyncJob := dict "envAll" . "serviceName" "nova" "podVolMounts" .Values.pod.mounts.nova_db_sync.nova_db_sync.volumeMounts "podVols" .Values.pod.mounts.nova_db_sync.nova_db_sync.volumes -}} {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/nova/values.yaml b/nova/values.yaml index 2ae52a61cb..9169766fab 100644 --- a/nova/values.yaml +++ b/nova/values.yaml @@ -2183,6 +2183,10 @@ pod: nova_spiceproxy: volumeMounts: volumes: + nova_db_sync: + nova_db_sync: + volumeMounts: + volumes: replicas: api_metadata: 1 compute_ironic: 1 diff --git a/panko/templates/job-db-sync.yaml b/panko/templates/job-db-sync.yaml index 0a22cc0cc3..8fb62f1313 100644 --- a/panko/templates/job-db-sync.yaml +++ b/panko/templates/job-db-sync.yaml @@ -15,6 +15,6 @@ limitations under the License. */}} {{- if .Values.manifests.job_db_sync }} -{{- $dbSyncJob := dict "envAll" . "serviceName" "panko" -}} +{{- $dbSyncJob := dict "envAll" . "serviceName" "panko" "podVolMounts" .Values.pod.mounts.panko_db_sync.panko_db_sync.volumeMounts "podVols" .Values.pod.mounts.panko_db_sync.panko_db_sync.volumes -}} {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/panko/values.yaml b/panko/values.yaml index 7195dc3f57..cc56a8bab4 100644 --- a/panko/values.yaml +++ b/panko/values.yaml @@ -480,6 +480,10 @@ pod: panko_tests: volumeMounts: volumes: + panko_db_sync: + panko_db_sync: + volumeMounts: + volumes: replicas: api: 1 lifecycle: diff --git a/senlin/templates/job-db-sync.yaml b/senlin/templates/job-db-sync.yaml index 6e830f8003..e273e77b98 100644 --- a/senlin/templates/job-db-sync.yaml +++ b/senlin/templates/job-db-sync.yaml @@ -15,6 +15,6 @@ limitations under the License. */}} {{- if .Values.manifests.job_db_sync }} -{{- $dbSyncJob := dict "envAll" . "serviceName" "senlin" -}} +{{- $dbSyncJob := dict "envAll" . "serviceName" "senlin" "podVolMounts" .Values.pod.mounts.senlin_db_sync.senlin_db_sync.volumeMounts "podVols" .Values.pod.mounts.senlin_db_sync.senlin_db_sync.volumes -}} {{ $dbSyncJob | include "helm-toolkit.manifests.job_db_sync" }} {{- end }} diff --git a/senlin/values.yaml b/senlin/values.yaml index ecf0f69855..3f04394530 100644 --- a/senlin/values.yaml +++ b/senlin/values.yaml @@ -535,6 +535,10 @@ pod: senlin_tests: volumeMounts: volumes: + senlin_db_sync: + senlin_db_sync: + volumeMounts: + volumes: replicas: api: 1 engine: 1