Add ovs to neutron repo
In upstream we don't have a separated ovs repo. Change-Id: If027e953f38408aabcdcce475b9742a6fb26ec04
This commit is contained in:
parent
1c7e104ade
commit
3bd0e9ed94
7
docker/openvswitch-base/Dockerfile.j2
Normal file
7
docker/openvswitch-base/Dockerfile.j2
Normal file
@ -0,0 +1,7 @@
|
||||
FROM {{ namespace }}/base-tools:{{ tag }}
|
||||
MAINTAINER {{ maintainer }}
|
||||
|
||||
RUN apt-get -y install --no-install-recommends \
|
||||
openvswitch-switch \
|
||||
&& apt-get clean
|
||||
|
2
docker/openvswitch-db/Dockerfile.j2
Normal file
2
docker/openvswitch-db/Dockerfile.j2
Normal file
@ -0,0 +1,2 @@
|
||||
FROM {{ namespace }}/openvswitch-base:{{ tag }}
|
||||
MAINTAINER {{ maintainer }}
|
3
docker/openvswitch-vswitchd/Dockerfile.j2
Normal file
3
docker/openvswitch-vswitchd/Dockerfile.j2
Normal file
@ -0,0 +1,3 @@
|
||||
FROM {{ namespace }}/openvswitch-base:{{ tag }}
|
||||
MAINTAINER {{ maintainer }}
|
||||
|
6
service/files/openvswitch-db-bootstrap.sh
Normal file
6
service/files/openvswitch-db-bootstrap.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
mkdir -p "/run/openvswitch"
|
||||
if [[ ! -e "/etc/openvswitch/conf.db" ]]; then
|
||||
ovsdb-tool create "/etc/openvswitch/conf.db"
|
||||
fi
|
17
service/files/ovs-ensure-configured.sh
Normal file
17
service/files/ovs-ensure-configured.sh
Normal file
@ -0,0 +1,17 @@
|
||||
#!/bin/bash
|
||||
|
||||
bridge=$1
|
||||
port=$2
|
||||
|
||||
ovs-vsctl br-exists $bridge; rc=$?
|
||||
if [[ $rc == 2 ]]; then
|
||||
changed=changed
|
||||
ovs-vsctl --no-wait add-br $bridge
|
||||
fi
|
||||
|
||||
if [[ ! $(ovs-vsctl list-ports $bridge) =~ $(echo "\<$port\>") ]]; then
|
||||
changed=changed
|
||||
ovs-vsctl --no-wait add-port $bridge $port
|
||||
fi
|
||||
|
||||
echo $changed
|
31
service/openvswitch-db.yaml
Normal file
31
service/openvswitch-db.yaml
Normal file
@ -0,0 +1,31 @@
|
||||
service:
|
||||
name: openvswitch-db
|
||||
host-net: true
|
||||
daemonset: true
|
||||
node-selector:
|
||||
openstack-compute-controller: "true"
|
||||
containers:
|
||||
- name: openvswitch-db
|
||||
image: openvswitch-db
|
||||
probes:
|
||||
readiness: "true"
|
||||
liveness: "true"
|
||||
volumes:
|
||||
- name: run
|
||||
type: host
|
||||
path: /run
|
||||
pre:
|
||||
- name: ovs-bootstrap
|
||||
command: /opt/ccp/bin/openvswitch-db-bootstrap.sh
|
||||
dependencies:
|
||||
- rabbitmq
|
||||
- neutron-db-sync
|
||||
daemon:
|
||||
command: /usr/sbin/ovsdb-server /etc/openvswitch/conf.db -vconsole:emer -vsyslog:err -vfile:info --remote=punix:/run/openvswitch/db.sock --log-file=/var/log/openvswitch/ovsdb-server.log
|
||||
files:
|
||||
- openvswitch-db-bootstrap.sh
|
||||
files:
|
||||
openvswitch-db-bootstrap.sh:
|
||||
path: /opt/ccp/bin/openvswitch-db-bootstrap.sh
|
||||
content: openvswitch-db-bootstrap.sh
|
||||
perm: "0755"
|
41
service/openvswitch-vswitchd.yaml
Normal file
41
service/openvswitch-vswitchd.yaml
Normal file
@ -0,0 +1,41 @@
|
||||
service:
|
||||
name: openvswitch-vswitchd
|
||||
host-net: true
|
||||
daemonset: true
|
||||
node-selector:
|
||||
openstack-compute-controller: "true"
|
||||
containers:
|
||||
- name: openvswitch-vswitchd
|
||||
image: openvswitch-vswitchd
|
||||
privileged: true
|
||||
probes:
|
||||
readiness: "true"
|
||||
liveness: "true"
|
||||
volumes:
|
||||
- name: run
|
||||
type: host
|
||||
path: /run
|
||||
- name: modules
|
||||
type: host
|
||||
path: /lib/modules
|
||||
pre:
|
||||
- name: vswitchd-bootstrap
|
||||
command: modprobe openvswitch
|
||||
- name: vswitchd-check-ovs-db
|
||||
command: ovs-vsctl --no-wait show
|
||||
dependencies:
|
||||
- vswitchd-bootstrap
|
||||
- openvswitch-db
|
||||
- name: vswitchd-setup-ovs-bridge
|
||||
command: /usr/local/bin/ovs-ensure-configured.sh {{ neutron_bridge_name }} {{ neutron_external_interface }}
|
||||
dependencies:
|
||||
- vswitchd-check-ovs-db
|
||||
daemon:
|
||||
command: /usr/sbin/ovs-vswitchd unix:/run/openvswitch/db.sock --mlockall
|
||||
files:
|
||||
- ovs-ensure-configured.sh
|
||||
files:
|
||||
ovs-ensure-configured.sh:
|
||||
path: /usr/local/bin/ovs-ensure-configured.sh
|
||||
content: ovs-ensure-configured.sh
|
||||
perm: "0755"
|
Loading…
Reference in New Issue
Block a user