Merge "Add initcontainer to magnum"

This commit is contained in:
Zuul 2020-06-22 19:28:07 +00:00 committed by Gerrit Code Review
commit 64ffad11d2
4 changed files with 21 additions and 9 deletions

View File

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

View File

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

View File

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

View File

@ -25,6 +25,6 @@ spec:
apiVersion: apps/v1
kind: Deployment
name: magnum-{{ component }}
minReplicas: 2
minReplicas: 1
maxReplicas: 10
targetCPUUtilizationPercentage: 90