From 4e38736324671a104d7f8fbf13bd03b53b16b12f Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Fri, 27 Nov 2020 11:18:29 +0000 Subject: [PATCH] Add support for choosing Octavia provider Story: 2008805 Task: 42225 Change-Id: I8c0ffd32f302fa06db420a183e8eed3e8640eddb (cherry picked from commit 4548f1ab9e28104f678d615ef3b54dcac0d1aa07) (cherry picked from commit d88e98afc05a396a68d2c5ad52d885d003a2facf) (cherry picked from commit d74c6c9ba4443c43f36bcf08975968e2345d86b2) --- doc/source/user/index.rst | 5 +++++ magnum/drivers/common/templates/lb_api.yaml | 1 + magnum/tests/unit/drivers/test_template_definition.py | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/doc/source/user/index.rst b/doc/source/user/index.rst index addb0fe4ef..a7f100c3c5 100644 --- a/doc/source/user/index.rst +++ b/doc/source/user/index.rst @@ -499,6 +499,8 @@ the table are linked to more details elsewhere in the user guide. +---------------------------------------+--------------------+---------------+ | `extra_security_group`_ | see below | see below | +---------------------------------------+--------------------+---------------+ +| `octavia_provider`_ | see below | amphora | ++---------------------------------------+--------------------+---------------+ .. _cluster: @@ -1682,6 +1684,9 @@ _`extra_security_group` Optional additional group name or UUID to add to network port. Only used when 'extra_network' is defined. Default: cluster node default security group. + +_`octavia_provider` + Octavia provider driver to be used for creating load balancers. External load balancer for services ----------------------------------- diff --git a/magnum/drivers/common/templates/lb_api.yaml b/magnum/drivers/common/templates/lb_api.yaml index 5e81b35924..df865f7603 100644 --- a/magnum/drivers/common/templates/lb_api.yaml +++ b/magnum/drivers/common/templates/lb_api.yaml @@ -38,6 +38,7 @@ parameters: octavia_provider: type: string + default: amphora description: Octavia provider to use for load balancer octavia_lb_algorithm: diff --git a/magnum/tests/unit/drivers/test_template_definition.py b/magnum/tests/unit/drivers/test_template_definition.py index 9acf8a4368..c4fbf23484 100644 --- a/magnum/tests/unit/drivers/test_template_definition.py +++ b/magnum/tests/unit/drivers/test_template_definition.py @@ -638,6 +638,7 @@ def test_k8s_get_params(self, mock_generate_csr_and_key, extra_network = mock_cluster.labels.get('extra_network') extra_subnet = mock_cluster.labels.get('extra_subnet') extra_security_group = mock_cluster.labels.get('extra_security_group') + octavia_provider = mock_cluster.labels.get('octavia_provider') k8s_def = k8sa_tdef.AtomicK8sTemplateDefinition() @@ -773,6 +774,7 @@ def test_k8s_get_params(self, mock_generate_csr_and_key, 'extra_network': extra_network, 'extra_subnet': extra_subnet, 'extra_security_group': extra_security_group, + 'octavia_provider': octavia_provider, }} mock_get_params.assert_called_once_with(mock_context, mock_cluster_template, @@ -1216,6 +1218,8 @@ def test_k8s_get_params_insecure(self, mock_generate_csr_and_key, octavia_lb_healthcheck = mock_cluster.labels.get( 'octavia_lb_healthcheck') + octavia_provider = mock_cluster.labels.get('octavia_provider') + k8s_def = k8sa_tdef.AtomicK8sTemplateDefinition() k8s_def.get_params(mock_context, mock_cluster_template, mock_cluster) @@ -1352,6 +1356,7 @@ def test_k8s_get_params_insecure(self, mock_generate_csr_and_key, 'extra_network': extra_network, 'extra_subnet': extra_subnet, 'extra_security_group': extra_security_group, + 'octavia_provider': octavia_provider, }} mock_get_params.assert_called_once_with(mock_context, mock_cluster_template,