Merge "Add initcontainer to heat"

This commit is contained in:
Zuul 2020-06-17 16:58:36 +00:00 committed by Gerrit Code Review
commit a38582dacc
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 if is_service_enabled $DATABASE_BACKENDS; then
# (re)create heat database # (re)create heat database
recreate_database heat 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 fi
} }

View File

@ -28,6 +28,11 @@ metadata:
{{ labels("heat", name, component) | indent(4) }} {{ labels("heat", name, component) | indent(4) }}
spec: spec:
replicas: 3 replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
selector: selector:
matchLabels: matchLabels:
{{ labels("heat", name, component) | indent(6) }} {{ labels("heat", name, component) | indent(6) }}
@ -38,6 +43,18 @@ spec:
annotations: annotations:
checksum/config: "{{ config_hash }}" checksum/config: "{{ config_hash }}"
spec: 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: containers:
- name: heat-{{ component }} - name: heat-{{ component }}
image: vexxhost/heat-{{ component }}:latest image: vexxhost/heat-{{ component }}:latest