diff --git a/devstack/lib/magnum b/devstack/lib/magnum index cc517c1f..4d3065e5 100644 --- a/devstack/lib/magnum +++ b/devstack/lib/magnum @@ -261,11 +261,6 @@ function init_magnum { if is_service_enabled $DATABASE_BACKENDS; then # (Re)create magnum database recreate_database magnum - - # Migrate magnum database - time_start "dbsync" - sudo docker run -v $MAGNUM_CONF_DIR:$MAGNUM_CONF_DIR vexxhost/magnum-conductor:latest magnum-db-manage upgrade - time_stop "dbsync" fi } diff --git a/images/magnum/Dockerfile b/images/magnum/Dockerfile index 74d4de6d..ab3fbea7 100644 --- a/images/magnum/Dockerfile +++ b/images/magnum/Dockerfile @@ -17,8 +17,8 @@ FROM docker.io/opendevorg/python-builder as builder COPY bindep.txt /tmp/src/bindep.txt ADD https://releases.openstack.org/constraints/upper/ussuri /tmp/src/upper-constraints.txt RUN assemble magnum==10.0.0 \ - python-memcached \ - PyMySQL + python-memcached \ + PyMySQL FROM docker.io/opendevorg/uwsgi-base AS magnum-api-base COPY --from=builder /output/ /output diff --git a/openstack_operator/templates/magnum/deployment.yml.j2 b/openstack_operator/templates/magnum/deployment.yml.j2 index 0d80589d..17e798fd 100644 --- a/openstack_operator/templates/magnum/deployment.yml.j2 +++ b/openstack_operator/templates/magnum/deployment.yml.j2 @@ -21,7 +21,12 @@ metadata: labels: {{ labels("magnum", name, component) | indent(4) }} spec: - replicas: 3 + replicas: 1 + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 selector: matchLabels: {{ labels("magnum", name, component) | indent(6) }} @@ -32,6 +37,18 @@ spec: annotations: checksum/config: "{{ config_hash }}" spec: + {% if 'conductor' in component %} + initContainers: + - name: db-sync + image: vexxhost/magnum-{{ component }}:latest + imagePullPolicy: Always + command: + - magnum-db-manage + - upgrade + volumeMounts: + - mountPath: /etc/magnum + name: config + {% endif %} containers: - name: magnum-{{ component }} image: vexxhost/magnum-{{ component }}:latest diff --git a/openstack_operator/templates/magnum/horizontalpodautoscaler.yml.j2 b/openstack_operator/templates/magnum/horizontalpodautoscaler.yml.j2 index 696af2b6..1239fc67 100644 --- a/openstack_operator/templates/magnum/horizontalpodautoscaler.yml.j2 +++ b/openstack_operator/templates/magnum/horizontalpodautoscaler.yml.j2 @@ -25,6 +25,6 @@ spec: apiVersion: apps/v1 kind: Deployment name: magnum-{{ component }} - minReplicas: 2 + minReplicas: 1 maxReplicas: 10 targetCPUUtilizationPercentage: 90