diff --git a/keystone/templates/_helpers.tpl b/keystone/templates/_helpers.tpl new file mode 100644 index 0000000000..d2f33bc897 --- /dev/null +++ b/keystone/templates/_helpers.tpl @@ -0,0 +1,3 @@ +{{- define "joinListWithColon" -}} +{{ range $k, $v := . }}{{ if $k }},{{ end }}{{ $v }}{{ end }} +{{- end -}} diff --git a/keystone/templates/db-sync.yaml b/keystone/templates/db-sync.yaml index a270d68a4e..ce4ee2ce8c 100644 --- a/keystone/templates/db-sync.yaml +++ b/keystone/templates/db-sync.yaml @@ -17,11 +17,11 @@ spec: }, { "name": "DEPENDENCY_SERVICE", - "value": "mariadb" + "value": "{{ include "joinListWithColon" .Values.dependencies.db_sync.service }}" }, { "name": "DEPENDENCY_JOBS", - "value": "mariadb-seed,keystone-init" + "value": "{{ include "joinListWithColon" .Values.dependencies.db_sync.jobs }}" }, { "name": "COMMAND", diff --git a/keystone/templates/deployment.yaml b/keystone/templates/deployment.yaml index 8c124df54d..f4945cb20b 100644 --- a/keystone/templates/deployment.yaml +++ b/keystone/templates/deployment.yaml @@ -20,15 +20,11 @@ spec: }, { "name": "DEPENDENCY_SERVICE", - "value": "mariadb,rabbitmq" + "value": "{{ include "joinListWithColon" .Values.dependencies.api.service }}" }, { "name": "DEPENDENCY_JOBS", - "value": "mariadb-seed" - }, - { - "name": "DEPENDENCY_CONFIG", - "value": "/etc/apache2/conf-enabled/wsgi-keystone.conf" + "value": "{{ include "joinListWithColon" .Values.dependencies.api.jobs }}" }, { "name": "COMMAND", diff --git a/keystone/templates/init.yaml b/keystone/templates/init.yaml index 5fc9b4776f..9a6b55fa3e 100644 --- a/keystone/templates/init.yaml +++ b/keystone/templates/init.yaml @@ -17,11 +17,11 @@ spec: }, { "name": "DEPENDENCY_SERVICE", - "value": "mariadb" + "value": "{{ include "joinListWithColon" .Values.dependencies.init.service }}" }, { "name": "DEPENDENCY_JOBS", - "value": "mariadb-seed" + "value": "{{ include "joinListWithColon" .Values.dependencies.init.jobs }}" }, { "name": "COMMAND", @@ -36,6 +36,9 @@ spec: - name: keystone-init image: {{ .Values.images.init }} imagePullPolicy: Always + command: + - bash + - /tmp/init.sh volumeMounts: - name: initsh mountPath: /tmp/init.sh diff --git a/keystone/values.yaml b/keystone/values.yaml index 27dac08811..173b2291a5 100644 --- a/keystone/values.yaml +++ b/keystone/values.yaml @@ -39,3 +39,22 @@ database: misc: workers: 8 debug: false + +dependencies: + api: + jobs: + - mariadb-seed + - keystone-init + service: + - mariadb + db_sync: + jobs: + - keystone-init + - mariadb-seed + service: + - mariadb + init: + jobs: + - mariadb-seed + service: + - mariadb