Refactoring init-containers

This commit is contained in:
pprokop 2016-11-29 08:33:08 +01:00
parent c0588c16d4
commit 9adb0f9670
5 changed files with 31 additions and 10 deletions

View File

@ -0,0 +1,3 @@
{{- define "joinListWithColon" -}}
{{ range $k, $v := . }}{{ if $k }},{{ end }}{{ $v }}{{ end }}
{{- end -}}

View File

@ -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",

View File

@ -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",

View File

@ -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

View File

@ -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