kuryr-kubernetes/kuryr_kubernetes/tests/unit/controller/drivers
Luis Tomas Bolivar e8c418c196 Pools support with Network Policies
This patch adapts the pools support to the use of Network Policies.
Unlike with the other drivers, when Network Policies are applied the
pods' ports changes their security groups while being used. That means
their original pool will not fit them anymore with the next two
consequences:
1.- Ports will have their original SG reapplied when pods are deleted,
with the consequent performance impact do to increasing the number of
calls to neutron
2.- Original pools may become useless, as different SGs are being used,
therefore wasting neutron ports

To accomodate for network policies, this patch removes the SG ids from
the pool key, merging all the pools with same network/project/host ids
but with different security groups into the same pool. This will not
change the behavior of the other drivers as there was a unique pool per
network/project/host ids already, i.e., the same SG ids were being used.
However, this will helps to avoid problem 1) as it is no longer
re-applying the SG, but simply putting the port back into its current
pool. And it will fix problem 2) as it will pick a port for an existing
pool that matches network/project/host ids. First it will search for one
with already matching SGs, and if not found, it will recycle one of the
others by reapplying the needed SGs (note it picks a port from one of
the pools that are less frequently used -- assumes they may belong to
a deleted NP that it is not needed anymore, thus removing the port
wastage problem)

Partially Implements: blueprint k8s-network-policies
Change-Id: I2c1e47fd5112c64b8e9984e5ac5d8572d91ac202
2019-02-08 17:18:45 +01:00
..
__init__.py Controller driver base and pod project driver 2016-11-18 17:46:55 +03:00
test_base.py Refactor DriverBase.get_instance() 2018-09-12 10:27:11 +09:00
test_default_project.py Ensure project id is returned for DefaultNamespaceProjectDriver 2018-08-02 13:29:31 +02:00
test_default_security_groups.py K8s Services support: LBaaSSpecHandler 2017-02-03 15:05:45 +03:00
test_default_subnet.py Move function get_subnet to kuryr_kubernetes.utils 2018-08-13 07:06:52 -04:00
test_lb_public_ip.py Make ext subnet config optional 2018-02-20 15:09:54 +02:00
test_lbaasv2.py Add Network Policy support to services 2019-01-08 06:35:55 -05:00
test_multi_vif.py Refactor DriverBase.get_instance() 2018-09-12 10:27:11 +09:00
test_namespace_security_groups.py Fix CRD update when NP has namespaceSelectors 2019-01-23 16:07:17 +00:00
test_namespace_subnet.py Move function get_subnet to kuryr_kubernetes.utils 2018-08-13 07:06:52 -04:00
test_nested_macvlan_vif.py NestedMacvlanPodVIFDriver gets host port before request vif 2018-02-20 10:22:11 +09:00
test_nested_vif.py Enforce E128 pep8 check 2017-06-13 14:22:51 +03:00
test_nested_vlan_vif.py dict_object.keys() is not required for *in* operator 2018-12-19 17:33:41 +05:30
test_network_policy.py Ensure host to pod connectivity for NP 2019-01-23 17:44:40 +01:00
test_network_policy_security_groups.py Fix CRD update when NP has namespaceSelectors 2019-01-23 16:07:17 +00:00
test_neutron_vif.py Separate helper function for pod 2018-08-10 11:23:58 +00:00
test_public_ip.py Ensure floatingip information is retrieved 2018-11-15 14:16:31 +01:00
test_sriov.py Drop unnecessary import 2018-09-26 17:12:33 +02:00
test_vif_pool.py Pools support with Network Policies 2019-02-08 17:18:45 +01:00