Switching jobs to init containers

This commit is contained in:
pprokop 2016-11-24 15:44:15 +01:00
parent 6a11f5af7e
commit 6230e0da91
3 changed files with 52 additions and 1 deletions

View File

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

View File

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

View File

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