diff --git a/devstack/local.conf.df.sample b/devstack/local.conf.df.sample index 5545b280c..c7211faab 100644 --- a/devstack/local.conf.df.sample +++ b/devstack/local.conf.df.sample @@ -147,3 +147,34 @@ enable_service kubelet # part of the codebase that connects to the Kubernetes API server to read the # resource events and convert them to Neutron actions enable_service kuryr-kubernetes + +# Kuryr POD VIF Driver +# ==================== +# +# Set up the VIF Driver to be used. The default one is the neutron-vif, but if +# a nested deployment is desired, the corresponding driver need to be set, +# e.g.: nested-vlan or nested-macvlan +# KURYR_POD_VIF_DRIVER=neutron-vif + +# Kuryr Ports Pools +# ================= +# +# To speed up containers boot time the kuryr ports pool driver can be enabled +# by uncommenting the next line, so that neutron port resources are precreated +# and ready to be used by the pods when needed +# KURYR_USE_PORTS_POOLS=True +# +# By default the pool driver is noop, i.e., there is no pool. If pool +# optimizations want to be used you need to set it to 'neutron' for the +# baremetal case, or to 'nested' for the nested case +# KURYR_VIF_POOL_DRIVER=noop +# +# There are extra configuration options for the pools that can be set to decide +# on the minimum number of ports that should be ready to use at each pool, the +# maximum (0 to unset), and the batch size for the repopulation actions, i.e., +# the number of neutron ports to create in bulk operations. Finally, the update +# frequency between actions over the pool can be set too +# KURYR_VIF_POOL_MIN=5 +# KURYR_VIF_POOL_MAX=0 +# KURYR_VIF_POOL_BATCH=10 +# KURYR_VIF_POOL_UPDATE_FREQ=20 diff --git a/devstack/local.conf.odl.sample b/devstack/local.conf.odl.sample index c035d6a63..679476337 100644 --- a/devstack/local.conf.odl.sample +++ b/devstack/local.conf.odl.sample @@ -146,3 +146,34 @@ enable_service kubelet # part of the codebase that connects to the Kubernetes API server to read the # resource events and convert them to Neutron actions enable_service kuryr-kubernetes + +# Kuryr POD VIF Driver +# ==================== +# +# Set up the VIF Driver to be used. The default one is the neutron-vif, but if +# a nested deployment is desired, the corresponding driver need to be set, +# e.g.: nested-vlan or nested-macvlan +# KURYR_POD_VIF_DRIVER=neutron-vif + +# Kuryr Ports Pools +# ================= +# +# To speed up containers boot time the kuryr ports pool driver can be enabled +# by uncommenting the next line, so that neutron port resources are precreated +# and ready to be used by the pods when needed +# KURYR_USE_PORTS_POOLS=True +# +# By default the pool driver is noop, i.e., there is no pool. If pool +# optimizations want to be used you need to set it to 'neutron' for the +# baremetal case, or to 'nested' for the nested case +# KURYR_VIF_POOL_DRIVER=noop +# +# There are extra configuration options for the pools that can be set to decide +# on the minimum number of ports that should be ready to use at each pool, the +# maximum (0 to unset), and the batch size for the repopulation actions, i.e., +# the number of neutron ports to create in bulk operations. Finally, the update +# frequency between actions over the pool can be set too +# KURYR_VIF_POOL_MIN=5 +# KURYR_VIF_POOL_MAX=0 +# KURYR_VIF_POOL_BATCH=10 +# KURYR_VIF_POOL_UPDATE_FREQ=20 diff --git a/devstack/local.conf.pod-in-vm.overcloud.sample b/devstack/local.conf.pod-in-vm.overcloud.sample index 7aea8ceb2..7b4e3e506 100644 --- a/devstack/local.conf.pod-in-vm.overcloud.sample +++ b/devstack/local.conf.pod-in-vm.overcloud.sample @@ -38,3 +38,28 @@ enable_service kubernetes-controller-manager enable_service kubernetes-scheduler enable_service kubelet enable_service kuryr-kubernetes + +KURYR_POD_VIF_DRIVER=nested-vlan + +# Kuryr Ports Pools +# ================= +# +# To speed up containers boot time the kuryr ports pool driver can be enabled +# by uncommenting the next line, so that neutron port resources are precreated +# and ready to be used by the pods when needed +# KURYR_USE_PORTS_POOLS=True +# +# By default the pool driver is noop, i.e., there is no pool. If pool +# optimizations want to be used you need to set it to 'neutron' for the +# baremetal case, or to 'nested' for the nested case +KURYR_VIF_POOL_DRIVER=nested +# +# There are extra configuration options for the pools that can be set to decide +# on the minimum number of ports that should be ready to use at each pool, the +# maximum (0 to unset), and the batch size for the repopulation actions, i.e., +# the number of neutron ports to create in bulk operations. Finally, the update +# frequency between actions over the pool can be set too +# KURYR_VIF_POOL_MIN=5 +# KURYR_VIF_POOL_MAX=0 +# KURYR_VIF_POOL_BATCH=10 +# KURYR_VIF_POOL_UPDATE_FREQ=20 diff --git a/devstack/local.conf.sample b/devstack/local.conf.sample index 41143a1f8..b3f84a4c3 100644 --- a/devstack/local.conf.sample +++ b/devstack/local.conf.sample @@ -184,6 +184,37 @@ enable_service kuryr-kubernetes # Kuryr services as pods on Kubernetes uncomment next line. # KURYR_K8S_CONTAINERIZED_DEPLOYMENT=True +# Kuryr POD VIF Driver +# ==================== +# +# Set up the VIF Driver to be used. The default one is the neutron-vif, but if +# a nested deployment is desired, the corresponding driver need to be set, +# e.g.: nested-vlan or nested-macvlan +# KURYR_POD_VIF_DRIVER=neutron-vif + +# Kuryr Ports Pools +# ================= +# +# To speed up containers boot time the kuryr ports pool driver can be enabled +# by uncommenting the next line, so that neutron port resources are precreated +# and ready to be used by the pods when needed +# KURYR_USE_PORTS_POOLS=True +# +# By default the pool driver is noop, i.e., there is no pool. If pool +# optimizations want to be used you need to set it to 'neutron' for the +# baremetal case, or to 'nested' for the nested case +# KURYR_VIF_POOL_DRIVER=noop +# +# There are extra configuration options for the pools that can be set to decide +# on the minimum number of ports that should be ready to use at each pool, the +# maximum (0 to unset), and the batch size for the repopulation actions, i.e., +# the number of neutron ports to create in bulk operations. Finally, the update +# frequency between actions over the pool can be set too +# KURYR_VIF_POOL_MIN=5 +# KURYR_VIF_POOL_MAX=0 +# KURYR_VIF_POOL_BATCH=10 +# KURYR_VIF_POOL_UPDATE_FREQ=20 + # Increase Octavia amphorae timeout so that the first LB amphora has time to # build and boot if [[ "$KURYR_K8S_LBAAS_USE_OCTAVIA" == "True" ]]; then diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 76317f22e..2de3e99ba 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -66,6 +66,14 @@ function configure_kuryr { if is_service_enabled kuryr-kubernetes; then configure_auth_token_middleware "$KURYR_CONFIG" kuryr \ "$KURYR_AUTH_CACHE_DIR" neutron + iniset "$KURYR_CONFIG" kubernetes pod_vif_driver "$KURYR_POD_VIF_DRIVER" + if [ "$KURYR_USE_PORTS_POOLS" ]; then + iniset "$KURYR_CONFIG" kubernetes vif_pool_driver "$KURYR_VIF_POOL_DRIVER" + iniset "$KURYR_CONFIG" vif_pool ports_pool_min "$KURYR_VIF_POOL_MIN" + iniset "$KURYR_CONFIG" vif_pool ports_pool_max "$KURYR_VIF_POOL_MAX" + iniset "$KURYR_CONFIG" vif_pool ports_pool_batch "$KURYR_VIF_POOL_BATCH" + iniset "$KURYR_CONFIG" vif_pool ports_pool_update_frequency "$KURYR_VIF_POOL_UPDATE_FREQ" + fi fi } diff --git a/devstack/settings b/devstack/settings index 338db74e8..529219695 100644 --- a/devstack/settings +++ b/devstack/settings @@ -51,3 +51,14 @@ KURYR_CONFIGURE_BAREMETAL_KUBELET_IFACE=${KURYR_CONFIGURE_BAREMETAL_KUBELET_IFAC # Kubernetes containerized deployment KURYR_K8S_CONTAINERIZED_DEPLOYMENT=${KURYR_K8S_CONTAINERIZED_DEPLOYMENT:-False} + +# Kuryr VIF driver +KURYR_POD_VIF_DRIVER=${KURYR_POD_VIF_DRIVER:-neutron-vif} + +# Kuryr Pool Driver +KURYR_USE_PORTS_POOLS=${KURYR_USE_PORTS_POOLS:-False} +KURYR_VIF_POOL_DRIVER=${KURYR_VIF_POOL_DRIVER:-noop} +KURYR_VIF_POOL_MIN=${KURYR_VIF_POOL_MIN:-5} +KURYR_VIF_POOL_MAX=${KURYR_VIF_POOL_MAX:-0} +KURYR_VIF_POOL_BATCH=${KURYR_VIF_POOL_BATCH:-10} +KURYR_VIF_POOL_UPDATE_FREQ=${KURYR_VIF_POOL_UPDATE_FREQ:-20} diff --git a/doc/source/installation/devstack/dragonflow_support.rst b/doc/source/installation/devstack/dragonflow_support.rst index 11912674f..5515045c7 100644 --- a/doc/source/installation/devstack/dragonflow_support.rst +++ b/doc/source/installation/devstack/dragonflow_support.rst @@ -62,6 +62,12 @@ Feel free to edit it if you'd like, but it should work as-is. $ cd devstack $ cp ../kuryr-kubernetes/devstack/local.conf.df.sample local.conf + +Optionally, the ports pool funcionality can be enabled by following: +`How to enable ports pool with devstack`_. + +.. _How to enable ports pool with devstack: https://docs.openstack.org/kuryr-kubernetes/latest/installation/devstack/ports-pool.html + 5. Run DevStack. Expect it to take a while. It installs required packages, clones a bunch diff --git a/doc/source/installation/devstack/index.rst b/doc/source/installation/devstack/index.rst index cf2f034af..eaf6314b2 100644 --- a/doc/source/installation/devstack/index.rst +++ b/doc/source/installation/devstack/index.rst @@ -35,3 +35,4 @@ ML2 drivers. odl_support dragonflow_support containerized + ports-pool diff --git a/doc/source/installation/devstack/nested-vlan.rst b/doc/source/installation/devstack/nested-vlan.rst index f3bb3f7eb..ee5b8a0b2 100644 --- a/doc/source/installation/devstack/nested-vlan.rst +++ b/doc/source/installation/devstack/nested-vlan.rst @@ -34,6 +34,15 @@ running. 4GB memory and 2 vCPUs, is the minimum resource requirement for the VM: KURYR_NEUTRON_DEFAULT_SUBNETPOOL_ID=UNDERCLOUD_SUBNETPOOL_V4_ID KURYR_NEUTRON_DEFAULT_ROUTER=router1 + - Ensure the nested-vlan driver is going to be set by setting:: + + KURYR_POD_VIF_DRIVER=nested-vlan + + - Optionally, the ports pool funcionality can be enabled by following: + `How to enable ports pool with devstack`_. + + .. _How to enable ports pool with devstack: https://docs.openstack.org/kuryr-kubernetes/latest/installation/devstack/ports-pools.html + 4. Once devstack is done and all services are up inside VM. Next steps are to configure the missing information at ``/etc/kuryr/kuryr.conf``: @@ -43,11 +52,6 @@ running. 4GB memory and 2 vCPUs, is the minimum resource requirement for the VM: [pod_vif_nested] worker_nodes_subnet = - - Configure "pod_vif_driver" as "nested-vlan":: - - [kubernetes] - pod_vif_driver = nested-vlan - - Configure binding section:: [binding] diff --git a/doc/source/installation/devstack/odl_support.rst b/doc/source/installation/devstack/odl_support.rst index 3dbbba50e..13f2bae1a 100644 --- a/doc/source/installation/devstack/odl_support.rst +++ b/doc/source/installation/devstack/odl_support.rst @@ -57,6 +57,12 @@ Feel free to edit it if you'd like, but it should work as-is. $ cd devstack $ cp ../kuryr-kubernetes/devstack/local.conf.odl.sample local.conf + +Optionally, the ports pool funcionality can be enabled by following: +`How to enable ports pool with devstack`_. + +.. _How to enable ports pool with devstack: https://docs.openstack.org/kuryr-kubernetes/latest/installation/devstack/ports-pool.html + 5. Run DevStack. This is going to take a while. It installs a bunch of packages, clones a bunch diff --git a/doc/source/installation/devstack/ports-pool.rst b/doc/source/installation/devstack/ports-pool.rst new file mode 100644 index 000000000..e9979fc6f --- /dev/null +++ b/doc/source/installation/devstack/ports-pool.rst @@ -0,0 +1,34 @@ +How to enable ports pool with devstack +====================================== + +To enable the utilization of the ports pool feature through devstack, the next +options needs to be set at the local.conf file: + +1. First, you need to enable the pools by setting:: + + KURYR_USE_PORT_POOLS=True + + +2. Then, the proper pool driver needs to be set. This means that for the + baremetal case you need to ensure the pod vif driver and the vif pool driver + are set to the right baremetal drivers, for instance:: + + KURYR_POD_VIF_DRIVER=neutron-vif + KURYR_PORT_POOL_DRIVER=neutron + + + And if the use case is the nested one, then they should be set to:: + + KURYR_POD_VIF_DRIVER=nested-vlan + KURYR_PORT_POOL_DRIVER=nested + + +3. Then, in case you want to set a limit to the maximum number of ports, or + increase/reduce the default one for the mininum number, as well as to modify + the way the pools are repopulated, both in time as well as regarding bulk + operation sizes, the next option can be included and modified accordingly:: + + KURYR_PORT_POOL_MIN=5 + KURYR_PORT_POOL_MAX=0 + KURYR_PORT_POOL_BATCH=10 + KURYR_PORT_POOL_UPDATE_FREQ=20