diff options
| author | Daneyon Hansen <danehans@cisco.com> | 2014-11-11 21:16:53 +0000 |
|---|---|---|
| committer | Daneyon Hansen <danehans@cisco.com> | 2014-11-25 17:30:41 +0000 |
| commit | fe28973675eeec96199f2c2c70ea65e2de9c561d (patch) | |
| tree | 8976de928602c6c50547150dd615f6c86181ae8a /docker/neutron/agents/linux-bridge | |
| parent | 1520f41a653b947817bbe2ca9c8910fb11ed538b (diff) | |
| download | kolla-fe28973675eeec96199f2c2c70ea65e2de9c561d.tar.gz kolla-fe28973675eeec96199f2c2c70ea65e2de9c561d.zip | |
Adds Neutron Networking Support
Implements: blueprint kube-neutron-container
Previously, only the neutron-server service was functional. This
patch adds support the the rest of the neutron services need by
Nova instances to function. The linux-bridge agent is used instead
of the OVS agent to realize network abstractions. This is because
the ovs-agent package will install the kernel module version of OVS
instead of the userspace version. Additionally, the OVS
userspace code is still very experimental and reduces performance.
Requires:
https://github.com/larsks/heat-kubernetes/pull/8
Change-Id: I5ef34ddeb48d4954934571a928cc82ae7f3a0f20
Diffstat (limited to 'docker/neutron/agents/linux-bridge')
| -rw-r--r-- | docker/neutron/agents/linux-bridge/Dockerfile | 15 | ||||
| l--------- | docker/neutron/agents/linux-bridge/build | 1 | ||||
| -rwxr-xr-x | docker/neutron/agents/linux-bridge/check.sh | 10 | ||||
| -rwxr-xr-x | docker/neutron/agents/linux-bridge/start.sh | 31 | ||||
| -rw-r--r-- | docker/neutron/agents/linux-bridge/sudoers.sh | 12 |
5 files changed, 69 insertions, 0 deletions
diff --git a/docker/neutron/agents/linux-bridge/Dockerfile b/docker/neutron/agents/linux-bridge/Dockerfile new file mode 100644 index 000000000..40e4d17a9 --- /dev/null +++ b/docker/neutron/agents/linux-bridge/Dockerfile @@ -0,0 +1,15 @@ +FROM kollaglue/fedora-rdo-neutron-base:l3_ovs_wip +MAINTAINER Kolla Project (https://launchpad.net/kolla) + +# Install required packages +RUN yum install -y openstack-neutron \ + openstack-neutron-linuxbridge \ + yum clean all; + +# Add required scripts +ADD ./start.sh /start.sh +ADD ./check.sh /check.sh +ADD ./sudoers.sh /sudoers.sh + +# Configure and run the service +CMD ["/start.sh"] diff --git a/docker/neutron/agents/linux-bridge/build b/docker/neutron/agents/linux-bridge/build new file mode 120000 index 000000000..8d652f7ee --- /dev/null +++ b/docker/neutron/agents/linux-bridge/build @@ -0,0 +1 @@ +../../../../tools/build-docker-image
\ No newline at end of file diff --git a/docker/neutron/agents/linux-bridge/check.sh b/docker/neutron/agents/linux-bridge/check.sh new file mode 100755 index 000000000..6b7db95e7 --- /dev/null +++ b/docker/neutron/agents/linux-bridge/check.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +RES=0 + +if ! /usr/sbin/brctl show; then + echo "ERROR: brctl show failed" >&2 + RES=1 +fi + +exit $RES diff --git a/docker/neutron/agents/linux-bridge/start.sh b/docker/neutron/agents/linux-bridge/start.sh new file mode 100755 index 000000000..e5982fe66 --- /dev/null +++ b/docker/neutron/agents/linux-bridge/start.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -e + +. /opt/kolla/config-neutron.sh +. /sudoers.sh + +: ${BRIDGE_PHYSICAL_INTERFACE:=eth1} +: ${ML2_FLAT_NETWORK:=physnet1} + +cfg=/etc/neutron/plugins/ml2/ml2_conf.ini + +# Configure ml2_conf.ini +crudini --set $cfg \ + ml2_type_flat \ + flat_networks \ + "${ML2_FLAT_NETWORK}" +crudini --set $cfg \ + vxlan \ + local_ip \ + "${PUBLIC_IP}" +crudini --set $cfg \ + linux_bridge \ + physical_interface_mappings \ + "${ML2_FLAT_NETWORK}:${BRIDGE_PHYSICAL_INTERFACE}" + +#Initialization scripts expect a symbolic link +/usr/bin/ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini + +# Start the linux bridge agent. +exec /usr/bin/neutron-linuxbridge-agent diff --git a/docker/neutron/agents/linux-bridge/sudoers.sh b/docker/neutron/agents/linux-bridge/sudoers.sh new file mode 100644 index 000000000..198420026 --- /dev/null +++ b/docker/neutron/agents/linux-bridge/sudoers.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Neutron uses rootwrap which requires a tty for sudo. +# Since the container is running in daemon mode, a tty +# is not present and requiretty must be commented out. +if [ ! -f /var/run/sudo-modified ]; then + chmod 0640 /etc/sudoers + sed -i '/Defaults requiretty/s/^/#/' /etc/sudoers + chmod 0440 /etc/sudoers +fi + +touch /var/run/sudo-modified |
