devstack: set neutron_defaults

Current VIFHandler drivers require several options to be set in
kuryr.conf. This patch updates devstack plugin to configure those
options before running kuryr-kubernetes.

Change-Id: I223f17f98ffe10eb89a38995142c7b699ade2fba
Partially-Implements: blueprint kuryr-k8s-integration
This commit is contained in:
Ilya Chukhnakov 2016-11-23 09:27:28 +03:00
parent 4c78d6e51a
commit 7930332391
2 changed files with 21 additions and 0 deletions

View File

@ -83,6 +83,22 @@ function configure_kuryr {
fi
}
function configure_neutron_defaults {
local project_id=$(get_or_create_project \
"$KURYR_NEUTRON_DEFAULT_PROJECT" default)
local pod_subnet_id=$(neutron subnet-show -c id -f value \
"$KURYR_NEUTRON_DEFAULT_POD_SUBNET")
local sg_ids=$(echo $(neutron security-group-list \
--project-id "$project_id" -c id -f value) | tr ' ' ',')
iniset "$KURYR_CONFIG" neutron_defaults project "$project_id"
iniset "$KURYR_CONFIG" neutron_defaults pod_subnet "$pod_subnet_id"
iniset "$KURYR_CONFIG" neutron_defaults pod_security_groups "$sg_ids"
if [ -n "$OVS_BRIDGE" ]; then
iniset "$KURYR_CONFIG" neutron_defaults ovs_bridge "$OVS_BRIDGE"
fi
}
function check_docker {
if is_ubuntu; then
dpkg -s docker-engine > /dev/null 2>&1
@ -335,6 +351,7 @@ if is_service_enabled kuryr-kubernetes; then
fi
if [[ "$1" == "stack" && "$2" == "extra" ]]; then
configure_neutron_defaults
# FIXME(limao): When Kuryr start up, it need to detect if neutron
# support tag plugin.
#

View File

@ -10,6 +10,10 @@ KURYR_POOL_PREFIX_LEN=${KURYR_POOL_PREFIX_LEN:-24}
KURYR_DOCKER_ENGINE_PORT=${KURYR_DOCKER_ENGINE_PORT:-2375}
KURYR_DOCKER_ENGINE_SOCKET_FILE=${KURYR_DOCKER_ENGINE_SOCKET_FILE:-/var/run/docker.sock}
# Neutron defaults
KURYR_NEUTRON_DEFAULT_PROJECT=demo
KURYR_NEUTRON_DEFAULT_POD_SUBNET=${PRIVATE_SUBNET_NAME}
# Etcd
KURYR_ETCD_IMAGE=${KURYR_ETCD_IMAGE:-quay.io/coreos/etcd}
KURYR_ETCD_VERSION=${KURYR_ETCD_VERSION:-v3.0.8}