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
|
||||
# (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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
@ -25,6 +25,6 @@ spec:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: magnum-{{ component }}
|
||||
minReplicas: 2
|
||||
minReplicas: 1
|
||||
maxReplicas: 10
|
||||
targetCPUUtilizationPercentage: 90
|
||||
|
Loading…
Reference in New Issue
Block a user