From df34aa87944adde1b06798066261cf37894ea04f Mon Sep 17 00:00:00 2001 From: okozachenko Date: Tue, 16 Jun 2020 11:57:20 +0300 Subject: [PATCH] Add initcontainer to heat Change-Id: I2e839e67018059d5466337c8f1e6ab7cec60d1b8 --- devstack/lib/heat | 4 ---- .../templates/heat/deployment.yml.j2 | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/devstack/lib/heat b/devstack/lib/heat index c8bb6813..cd109d9e 100644 --- a/devstack/lib/heat +++ b/devstack/lib/heat @@ -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 } diff --git a/openstack_operator/templates/heat/deployment.yml.j2 b/openstack_operator/templates/heat/deployment.yml.j2 index 04f57f12..bc84d07b 100644 --- a/openstack_operator/templates/heat/deployment.yml.j2 +++ b/openstack_operator/templates/heat/deployment.yml.j2 @@ -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