diff options
| author | Jenkins <jenkins@review.openstack.org> | 2016-08-10 02:17:55 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2016-08-10 02:17:55 +0000 |
| commit | 00c6fa87f71df754f921a748295506250571c8a6 (patch) | |
| tree | fac9753115d8166fcb05bd5e896f09601dec72b0 /docker | |
| parent | 559631815afed3a9bf51f89b2d121b0d1a34de12 (diff) | |
| parent | 41ec75b56734604ad548b354bc929105babbb538 (diff) | |
| download | kolla-00c6fa87f71df754f921a748295506250571c8a6.tar.gz kolla-00c6fa87f71df754f921a748295506250571c8a6.zip | |
Merge "Introduce a script to launch ovsdb-server process"
Diffstat (limited to 'docker')
| -rw-r--r-- | docker/openvswitch/openvswitch-db-server/Dockerfile.j2 | 5 | ||||
| -rw-r--r-- | docker/openvswitch/openvswitch-db-server/start_ovsdb_server.sh | 30 |
2 files changed, 34 insertions, 1 deletions
diff --git a/docker/openvswitch/openvswitch-db-server/Dockerfile.j2 b/docker/openvswitch/openvswitch-db-server/Dockerfile.j2 index 64d8fc46d..1cc28e168 100644 --- a/docker/openvswitch/openvswitch-db-server/Dockerfile.j2 +++ b/docker/openvswitch/openvswitch-db-server/Dockerfile.j2 @@ -3,7 +3,10 @@ MAINTAINER {{ maintainer }} COPY ovs_ensure_configured.sh /usr/local/bin/kolla_ensure_openvswitch_configured COPY extend_start.sh /usr/local/bin/kolla_openvswitch_extend_start -RUN chmod 755 /usr/local/bin/kolla_ensure_openvswitch_configured /usr/local/bin/kolla_openvswitch_extend_start +COPY start_ovsdb_server.sh /usr/local/bin/start-ovsdb-server +RUN chmod 755 /usr/local/bin/kolla_ensure_openvswitch_configured \ + /usr/local/bin/kolla_openvswitch_extend_start \ + /usr/local/bin/start-ovsdb-server {% block openvswitch_db_server_footer %}{% endblock %} {% block footer %}{% endblock %} diff --git a/docker/openvswitch/openvswitch-db-server/start_ovsdb_server.sh b/docker/openvswitch/openvswitch-db-server/start_ovsdb_server.sh new file mode 100644 index 000000000..27a4fa50a --- /dev/null +++ b/docker/openvswitch/openvswitch-db-server/start_ovsdb_server.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +# NOTE: (sbezverk) ovs_bridge and ovs_ext_intf variables get initialized only when +# this script is executed for kubernetes deployment. With Ansible deployment, only +# ovsdb-server gets launched and then the following workflow step will create +# an external bridge and plug an external interface. With Kubernetes we want to +# leverage its dynamic nature of automatic scaling up and down. It means all +# activities related to creating initial bridge, plugging external interface +# must be done by DaemonSet launched container. + +ovsdb_ip=$1 +ovs_bridge=$2 +ovs_ext_intf=$3 + +# NOTE: (sbezverk) The reason for introducing this script is to be able +# to launch ovsdb-server and to create the initial external bridge in one step. +# It is required in order to be able to use DaemonSet. + +if [ ! -e $ovs_bridge ] && [ ! -e $ovs_ext_intf ]; then +# NOTE: (sbezverk) This part is executed only by kubernetes deployment. +# Creating external bridge + /usr/sbin/ovsdb-server /etc/openvswitch/conf.db --remote=punix:/var/run/openvswitch/db.sock --run="ovs-vsctl --no-wait --db=unix:/var/run/openvswitch/db.sock add-br $ovs_bridge" +# Plug the external interface into the external bridge. + /usr/sbin/ovsdb-server /etc/openvswitch/conf.db --remote=punix:/var/run/openvswitch/db.sock --run="ovs-vsctl --no-wait --db=unix:/var/run/openvswitch/db.sock add-port $ovs_bridge $ovs_ext_intf" +# Run ovsdb server proces + /usr/sbin/ovsdb-server /etc/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/var/run/openvswitch/db.sock --log-file=/var/log/kolla/openvswitch/ovsdb-server.log +else +# NOTE: (sbezverk) This part is executed only by kolla-ansible deployment. + /usr/sbin/ovsdb-server /etc/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/run/openvswitch/db.sock --remote=ptcp:6640:$ovsdb_ip --log-file=/var/log/kolla/openvswitch/ovsdb-server.log +fi |
