ovs,neutron: use auto_bridge_add for external bridge and interface
Also changed ovs-agent-init to take care of configuring default external bridge and interface for cosistency with lb-agent. Change-Id: I1d893b73a784f55594c30f17ef022348d68f0f1b
This commit is contained in:
parent
bc4712f121
commit
896fc6b8d2
@ -18,20 +18,6 @@ limitations under the License.
|
|||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
# configure external bridge
|
|
||||||
external_bridge="{{- .Values.network.external_bridge -}}"
|
|
||||||
external_interface="{{- .Values.network.interface.external -}}"
|
|
||||||
if [ -n "${external_bridge}" ] ; then
|
|
||||||
# adding existing bridge would break out the script when -e is set
|
|
||||||
set +e
|
|
||||||
ip link add name $external_bridge type bridge
|
|
||||||
set -e
|
|
||||||
ip link set dev $external_bridge up
|
|
||||||
if [ -n "$external_interface" ] ; then
|
|
||||||
ip link set dev $external_interface master $external_bridge
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# configure all bridge mappings defined in config
|
# configure all bridge mappings defined in config
|
||||||
{{- range $br, $phys := .Values.network.auto_bridge_add }}
|
{{- range $br, $phys := .Values.network.auto_bridge_add }}
|
||||||
if [ -n "{{- $br -}}" ] ; then
|
if [ -n "{{- $br -}}" ] ; then
|
||||||
|
@ -90,18 +90,7 @@ network:
|
|||||||
# allowing agents to be restarted without packet loss and simpler
|
# allowing agents to be restarted without packet loss and simpler
|
||||||
# debugging. This feature requires mount propagation support.
|
# debugging. This feature requires mount propagation support.
|
||||||
share_namespaces: true
|
share_namespaces: true
|
||||||
external_bridge: br-ex
|
# auto_bridge_add is a table of "bridge: interface" pairs
|
||||||
ip_address: 0.0.0.0
|
|
||||||
interface:
|
|
||||||
# External interface will be automatically added to external_bridge.
|
|
||||||
# Tunnel interface will be used for VXLAN tunneling. If null
|
|
||||||
# (default) there is a fallback mechanism to search for interface
|
|
||||||
# with default routing.
|
|
||||||
external: null
|
|
||||||
tunnel: null
|
|
||||||
# auto_bridge_add is a table of "bridge: interface" pairs, by
|
|
||||||
# default empty
|
|
||||||
auto_bridge_add: {}
|
|
||||||
# To automatically add a physical interfaces to a specific bridges,
|
# To automatically add a physical interfaces to a specific bridges,
|
||||||
# for example eth3 to bridge br-physnet1, if0 to br0 and iface_two
|
# for example eth3 to bridge br-physnet1, if0 to br0 and iface_two
|
||||||
# to br1 do something like:
|
# to br1 do something like:
|
||||||
@ -110,6 +99,14 @@ network:
|
|||||||
# br-physnet1: eth3
|
# br-physnet1: eth3
|
||||||
# br0: if0
|
# br0: if0
|
||||||
# br1: iface_two
|
# br1: iface_two
|
||||||
|
# br-ex will be added by default
|
||||||
|
auto_bridge_add:
|
||||||
|
br-ex: null
|
||||||
|
interface:
|
||||||
|
# Tunnel interface will be used for VXLAN tunneling. If null
|
||||||
|
# (default) there is a fallback mechanism to search for interface
|
||||||
|
# with default routing.
|
||||||
|
tunnel: null
|
||||||
sriov:
|
sriov:
|
||||||
# To perform setup of network interfaces using the SR-IOV init
|
# To perform setup of network interfaces using the SR-IOV init
|
||||||
# container you can use a section similar to:
|
# container you can use a section similar to:
|
||||||
|
@ -36,18 +36,6 @@ function start () {
|
|||||||
|
|
||||||
ovs-vsctl --no-wait show
|
ovs-vsctl --no-wait show
|
||||||
|
|
||||||
external_bridge="{{- .Values.network.external_bridge -}}"
|
|
||||||
external_interface="{{- .Values.network.interface.external -}}"
|
|
||||||
if [ -n "${external_bridge}" ] ; then
|
|
||||||
# create bridge device
|
|
||||||
ovs-vsctl --no-wait --may-exist add-br $external_bridge
|
|
||||||
if [ -n "$external_interface" ] ; then
|
|
||||||
# add external interface to the bridge
|
|
||||||
ovs-vsctl --no-wait --may-exist add-port $external_bridge $external_interface
|
|
||||||
ip link set dev $external_interface up
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# handle any bridge mappings
|
# handle any bridge mappings
|
||||||
{{- range $br, $phys := .Values.network.auto_bridge_add }}
|
{{- range $br, $phys := .Values.network.auto_bridge_add }}
|
||||||
if [ -n "{{- $br -}}" ] ; then
|
if [ -n "{{- $br -}}" ] ; then
|
||||||
|
@ -38,14 +38,8 @@ labels:
|
|||||||
node_selector_value: enabled
|
node_selector_value: enabled
|
||||||
|
|
||||||
network:
|
network:
|
||||||
external_bridge: br-ex
|
|
||||||
ip_address: 0.0.0.0
|
|
||||||
interface:
|
|
||||||
# External interface will be automatically added to external_bridge. Default is null.
|
|
||||||
external: null
|
|
||||||
# auto_bridge_add is a table of "bridge: interface" pairs, by
|
# auto_bridge_add is a table of "bridge: interface" pairs, by
|
||||||
# default empty
|
# default empty
|
||||||
auto_bridge_add: {}
|
|
||||||
# To automatically add a physical interfaces to a specific bridges,
|
# To automatically add a physical interfaces to a specific bridges,
|
||||||
# for example eth3 to bridge br-physnet1, if0 to br0 and iface_two
|
# for example eth3 to bridge br-physnet1, if0 to br0 and iface_two
|
||||||
# to br1 do something like:
|
# to br1 do something like:
|
||||||
@ -54,6 +48,7 @@ network:
|
|||||||
# br-physnet1: eth3
|
# br-physnet1: eth3
|
||||||
# br0: if0
|
# br0: if0
|
||||||
# br1: iface_two
|
# br1: iface_two
|
||||||
|
auto_bridge_add: {}
|
||||||
|
|
||||||
pod:
|
pod:
|
||||||
lifecycle:
|
lifecycle:
|
||||||
|
@ -81,6 +81,7 @@ network:
|
|||||||
num_vfs: 32
|
num_vfs: 32
|
||||||
promisc: false
|
promisc: false
|
||||||
auto_bridge_add:
|
auto_bridge_add:
|
||||||
|
br-ex: null
|
||||||
br-physnet3: ${OVSBR}
|
br-physnet3: ${OVSBR}
|
||||||
conf:
|
conf:
|
||||||
neutron:
|
neutron:
|
||||||
|
Loading…
Reference in New Issue
Block a user