From 40e398d320d2d7b830943a37c96b5a95cb83efe8 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Date: Thu, 20 Aug 2020 16:34:14 +0200 Subject: [PATCH 1/4] Add external_openstack_lbaas_provider setting for occm --- inventory/sample/group_vars/all/openstack.yml | 1 + .../openstack/templates/external-openstack-cloud-config.j2 | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/inventory/sample/group_vars/all/openstack.yml b/inventory/sample/group_vars/all/openstack.yml index 71c392414ed..825f29e35f4 100644 --- a/inventory/sample/group_vars/all/openstack.yml +++ b/inventory/sample/group_vars/all/openstack.yml @@ -22,6 +22,7 @@ # external_openstack_lbaas_floating_subnet_id: "Neutron subnet ID to get floating IP from" # external_openstack_lbaas_use_octavia: true # external_openstack_lbaas_method: "ROUND_ROBIN" +# external_openstack_lbaas_provider: "amphora" # external_openstack_lbaas_create_monitor: false # external_openstack_lbaas_monitor_delay: "1m" # external_openstack_lbaas_monitor_timeout: "30s" diff --git a/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-config.j2 b/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-config.j2 index 25a3ab08931..7ef6d68b4e8 100644 --- a/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-config.j2 +++ b/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-config.j2 @@ -27,6 +27,9 @@ monitor-max-retries={{ external_openstack_lbaas_monitor_max_retries }} {% if external_openstack_lbaas_method is defined %} lb-method={{ external_openstack_lbaas_method }} {% endif %} +{% if external_openstack_lbaas_provider is defined %} +lb-provider={{ external_openstack_lbaas_provider }} +{% endif %} {% if external_openstack_lbaas_network_id is defined %} network-id={{ external_openstack_lbaas_network_id }} {% endif %} @@ -61,4 +64,4 @@ public-network-name="{{ network_name }}" [Metadata] {% if external_openstack_metadata_search_order is defined %} search-order="{{ external_openstack_metadata_search_order }}" -{% endif %} \ No newline at end of file +{% endif %} From 32eebccbdf8ac03ca796f7637eea0b117a7eeea6 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Date: Thu, 20 Aug 2020 17:20:33 +0200 Subject: [PATCH 2/4] Integrate with existing lbaas_provider block --- .../openstack/templates/external-openstack-cloud-config.j2 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-config.j2 b/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-config.j2 index 7ef6d68b4e8..8d92d7f4f4d 100644 --- a/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-config.j2 +++ b/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-config.j2 @@ -27,9 +27,6 @@ monitor-max-retries={{ external_openstack_lbaas_monitor_max_retries }} {% if external_openstack_lbaas_method is defined %} lb-method={{ external_openstack_lbaas_method }} {% endif %} -{% if external_openstack_lbaas_provider is defined %} -lb-provider={{ external_openstack_lbaas_provider }} -{% endif %} {% if external_openstack_lbaas_network_id is defined %} network-id={{ external_openstack_lbaas_network_id }} {% endif %} @@ -50,8 +47,11 @@ internal-lb={{ external_openstack_lbaas_internal_lb }} {% endif %} {% if external_openstack_lbaas_use_octavia is defined and external_openstack_lbaas_use_octavia %} lb-provider=octavia +{% elif external_openstack_lbaas_provider is defined %} +lb-provider={{ external_openstack_lbaas_provider }} {% endif %} + [Networking] ipv6-support-disabled={{ external_openstack_network_ipv6_disabled | string | lower }} {% for network_name in external_openstack_network_internal_networks %} From eeb6d6eca1a9c6dfef7864d02cfd6cb2cc492a64 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Date: Thu, 20 Aug 2020 18:20:22 +0200 Subject: [PATCH 3/4] Refactor lbaas_provider config template block --- .../templates/external-openstack-cloud-config.j2 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-config.j2 b/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-config.j2 index 8d92d7f4f4d..d3c9cf07bde 100644 --- a/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-config.j2 +++ b/roles/kubernetes-apps/external_cloud_controller/openstack/templates/external-openstack-cloud-config.j2 @@ -19,7 +19,6 @@ ca-file="{{ kube_config_dir }}/external-openstack-cacert.pem" {% endif %} [LoadBalancer] -use-octavia={{ external_openstack_lbaas_use_octavia | string | lower }} create-monitor={{ external_openstack_lbaas_create_monitor }} monitor-delay={{ external_openstack_lbaas_monitor_delay }} monitor-timeout={{ external_openstack_lbaas_monitor_timeout }} @@ -45,13 +44,14 @@ manage-security-groups={{ external_openstack_lbaas_manage_security_groups }} {% if external_openstack_lbaas_internal_lb is defined %} internal-lb={{ external_openstack_lbaas_internal_lb }} {% endif %} -{% if external_openstack_lbaas_use_octavia is defined and external_openstack_lbaas_use_octavia %} -lb-provider=octavia -{% elif external_openstack_lbaas_provider is defined %} +{% if external_openstack_lbaas_provider is defined %} lb-provider={{ external_openstack_lbaas_provider }} +use-octavia={{ external_openstack_lbaas_provider | lower == 'octavia' }} +{% else %} +lb-provider=octavia +use-octavia=true {% endif %} - [Networking] ipv6-support-disabled={{ external_openstack_network_ipv6_disabled | string | lower }} {% for network_name in external_openstack_network_internal_networks %} From 0b571785919d95eff30071fafb1b908da67bce2d Mon Sep 17 00:00:00 2001 From: Marc-Antoine Date: Thu, 20 Aug 2020 18:23:13 +0200 Subject: [PATCH 4/4] Remove external_openstack_lbaas_use_octavia from sample inventory --- inventory/sample/group_vars/all/openstack.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/inventory/sample/group_vars/all/openstack.yml b/inventory/sample/group_vars/all/openstack.yml index 825f29e35f4..3ee97df6226 100644 --- a/inventory/sample/group_vars/all/openstack.yml +++ b/inventory/sample/group_vars/all/openstack.yml @@ -20,9 +20,8 @@ # external_openstack_lbaas_subnet_id: "Neutron subnet ID to create LBaaS VIP" # external_openstack_lbaas_floating_network_id: "Neutron network ID to get floating IP from" # external_openstack_lbaas_floating_subnet_id: "Neutron subnet ID to get floating IP from" -# external_openstack_lbaas_use_octavia: true # external_openstack_lbaas_method: "ROUND_ROBIN" -# external_openstack_lbaas_provider: "amphora" +# external_openstack_lbaas_provider: "octavia" # external_openstack_lbaas_create_monitor: false # external_openstack_lbaas_monitor_delay: "1m" # external_openstack_lbaas_monitor_timeout: "30s"