Merge "Add initcontainer to magnum"
This commit is contained in:
commit
64ffad11d2
@ -261,11 +261,6 @@ function init_magnum {
|
|||||||
if is_service_enabled $DATABASE_BACKENDS; then
|
if is_service_enabled $DATABASE_BACKENDS; then
|
||||||
# (Re)create magnum database
|
# (Re)create magnum database
|
||||||
recreate_database magnum
|
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
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,8 +17,8 @@ FROM docker.io/opendevorg/python-builder as builder
|
|||||||
COPY bindep.txt /tmp/src/bindep.txt
|
COPY bindep.txt /tmp/src/bindep.txt
|
||||||
ADD https://releases.openstack.org/constraints/upper/ussuri /tmp/src/upper-constraints.txt
|
ADD https://releases.openstack.org/constraints/upper/ussuri /tmp/src/upper-constraints.txt
|
||||||
RUN assemble magnum==10.0.0 \
|
RUN assemble magnum==10.0.0 \
|
||||||
python-memcached \
|
python-memcached \
|
||||||
PyMySQL
|
PyMySQL
|
||||||
|
|
||||||
FROM docker.io/opendevorg/uwsgi-base AS magnum-api-base
|
FROM docker.io/opendevorg/uwsgi-base AS magnum-api-base
|
||||||
COPY --from=builder /output/ /output
|
COPY --from=builder /output/ /output
|
||||||
|
@ -21,7 +21,12 @@ metadata:
|
|||||||
labels:
|
labels:
|
||||||
{{ labels("magnum", name, component) | indent(4) }}
|
{{ labels("magnum", name, component) | indent(4) }}
|
||||||
spec:
|
spec:
|
||||||
replicas: 3
|
replicas: 1
|
||||||
|
strategy:
|
||||||
|
type: RollingUpdate
|
||||||
|
rollingUpdate:
|
||||||
|
maxSurge: 1
|
||||||
|
maxUnavailable: 0
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{ labels("magnum", name, component) | indent(6) }}
|
{{ labels("magnum", name, component) | indent(6) }}
|
||||||
@ -32,6 +37,18 @@ spec:
|
|||||||
annotations:
|
annotations:
|
||||||
checksum/config: "{{ config_hash }}"
|
checksum/config: "{{ config_hash }}"
|
||||||
spec:
|
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:
|
containers:
|
||||||
- name: magnum-{{ component }}
|
- name: magnum-{{ component }}
|
||||||
image: vexxhost/magnum-{{ component }}:latest
|
image: vexxhost/magnum-{{ component }}:latest
|
||||||
|
@ -25,6 +25,6 @@ spec:
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
name: magnum-{{ component }}
|
name: magnum-{{ component }}
|
||||||
minReplicas: 2
|
minReplicas: 1
|
||||||
maxReplicas: 10
|
maxReplicas: 10
|
||||||
targetCPUUtilizationPercentage: 90
|
targetCPUUtilizationPercentage: 90
|
||||||
|
Loading…
Reference in New Issue
Block a user