From 6230e0da9139ea51c05128b2f0c292dceb9e459f Mon Sep 17 00:00:00 2001 From: pprokop Date: Thu, 24 Nov 2016 15:44:15 +0100 Subject: [PATCH] Switching jobs to init containers --- keystone/templates/db-sync.yaml | 26 ++++++++++++++++++++++++++ keystone/templates/deployment.yaml | 5 ++++- keystone/templates/init.yaml | 22 ++++++++++++++++++++++ 3 files changed, 52 insertions(+), 1 deletion(-) diff --git a/keystone/templates/db-sync.yaml b/keystone/templates/db-sync.yaml index f7ea254127..dc90102569 100644 --- a/keystone/templates/db-sync.yaml +++ b/keystone/templates/db-sync.yaml @@ -4,12 +4,38 @@ metadata: name: keystone-db-sync spec: template: + metadata: + annotations: + pod.beta.kubernetes.io/init-containers: '[ + { + "name": "init", + "image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0", + "env": [ + { + "name": "DEPENDENCY_SERVICE", + "value": "mariadb" + }, + { + "name": "DEPENDENCY_JOBS", + "value": "mariadb-seed,keystone-init" + }, + { + "name": "COMMAND", + "value": "echo done" + } + ] + } + ]' + spec: restartPolicy: OnFailure containers: - name: keystone-init image: {{ .Values.global.deployment.image.db_sync }} imagePullPolicy: Always + command: + - bash + - /tmp/db-sync.sh env: - name: INTERFACE_NAME value: "eth0" diff --git a/keystone/templates/deployment.yaml b/keystone/templates/deployment.yaml index 371cb172ac..eae3bbafd2 100644 --- a/keystone/templates/deployment.yaml +++ b/keystone/templates/deployment.yaml @@ -24,7 +24,7 @@ spec: }, { "name": "COMMAND", - "value": "echo Done" + "value": "echo done" } ] } @@ -35,6 +35,9 @@ spec: containers: - name: keystone-api image: {{ .Values.global.deployment.image.api }} + command: + - bash + - /tmp/start.sh env: - name: INTERFACE_NAME value: "eth0" diff --git a/keystone/templates/init.yaml b/keystone/templates/init.yaml index dc559c8822..a16ab4c84b 100644 --- a/keystone/templates/init.yaml +++ b/keystone/templates/init.yaml @@ -4,6 +4,28 @@ metadata: name: keystone-init spec: template: + metadata: + annotations: + pod.beta.kubernetes.io/init-containers: '[ + { + "name": "init", + "image": "quay.io/stackanetes/kubernetes-entrypoint:v0.1.0", + "env": [ + { + "name": "DEPENDENCY_SERVICE", + "value": "mariadb" + }, + { + "name": "DEPENDENCY_JOBS", + "value": "mariadb-seed,keystone-init" + }, + { + "name": "COMMAND", + "value": "echo done" + } + ] + } + ]' spec: restartPolicy: OnFailure containers: