Add initcontainer to heat

Change-Id: I2e839e67018059d5466337c8f1e6ab7cec60d1b8
This commit is contained in:
okozachenko 2020-06-16 11:57:20 +03:00
parent 4fbc6361f9
commit df34aa8794
2 changed files with 17 additions and 4 deletions

View File

@ -219,10 +219,6 @@ function init_heat {
if is_service_enabled $DATABASE_BACKENDS; then
# (re)create heat database
recreate_database heat
time_start "dbsync"
sudo docker run -v $HEAT_CONF_DIR:$HEAT_CONF_DIR vexxhost/heat-engine:latest heat-manage db_sync
time_stop "dbsync"
fi
}

View File

@ -28,6 +28,11 @@ metadata:
{{ labels("heat", name, component) | indent(4) }}
spec:
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector:
matchLabels:
{{ labels("heat", name, component) | indent(6) }}
@ -38,6 +43,18 @@ spec:
annotations:
checksum/config: "{{ config_hash }}"
spec:
{% if 'engine' in component %}
initContainers:
- name: db-sync
image: vexxhost/heat-{{ component }}:latest
imagePullPolicy: Always
command:
- heat-manage
- db_sync
volumeMounts:
- mountPath: /etc/heat
name: config
{% endif %}
containers:
- name: heat-{{ component }}
image: vexxhost/heat-{{ component }}:latest