From a4cc41651184e38bb7060014350c15e755b66990 Mon Sep 17 00:00:00 2001 From: Sergey Mikhaltsov Date: Thu, 25 Feb 2021 22:25:25 +0300 Subject: [PATCH] =?UTF-8?q?use=20external=5Fopenstack=5Flbaas=5Fuse=5Focta?= =?UTF-8?q?via=20for=20template=20openstack-cloud=E2=80=A6=20(#7298)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * use external_openstack_lbaas_use_octavia for template openstack-cloud-config * Delete external_openstack_lbaas_use_octavia from default values. Added description and default values of variables to docs * markdown fix * make this simple * set external_openstack_lbaas_use_octavia in default values * duplicated variable in doc --- docs/openstack.md | 21 ++++++++++++++++++- .../external-openstack-cloud-config.j2 | 2 +- roles/kubespray-defaults/defaults/main.yaml | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/docs/openstack.md b/docs/openstack.md index fa7e0d067..9acca4ed8 100644 --- a/docs/openstack.md +++ b/docs/openstack.md @@ -125,10 +125,29 @@ The new cloud provider is configured to have Octavia by default in Kubespray. ``` - You can override the default OpenStack metadata configuration (see [#6338](https://github.com/kubernetes-sigs/kubespray/issues/6338) for explanation): - + ```yaml external_openstack_metadata_search_order: "configDrive,metadataService" ``` +- Available variables for configuring lbaas: + + ```yaml + external_openstack_lbaas_create_monitor: false + external_openstack_lbaas_monitor_delay: "1m" + external_openstack_lbaas_monitor_timeout: "30s" + external_openstack_lbaas_monitor_max_retries: "3" + external_openstack_lbaas_provider: octavia + external_openstack_lbaas_use_octavia: false + external_openstack_lbaas_network_id: "Neutron network ID to create LBaaS VIP" + 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_method: "ROUND_ROBIN" + external_openstack_lbaas_manage_security_groups: false + external_openstack_lbaas_internal_lb: false + + ``` + - Run `source path/to/your/openstack-rc` to read your OpenStack credentials like `OS_AUTH_URL`, `OS_USERNAME`, `OS_PASSWORD`, etc. Those variables are used for accessing OpenStack from the external cloud provider. - Run the `cluster.yml` playbook 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 eda2d9720..ba631e5da 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 @@ -57,7 +57,7 @@ internal-lb={{ external_openstack_lbaas_internal_lb }} {% endif %} {% if external_openstack_lbaas_provider is defined %} lb-provider={{ external_openstack_lbaas_provider }} -use-octavia={{ external_openstack_lbaas_provider | lower == 'octavia' }} +use-octavia={{ external_openstack_lbaas_use_octavia }} {% else %} lb-provider=octavia use-octavia=true diff --git a/roles/kubespray-defaults/defaults/main.yaml b/roles/kubespray-defaults/defaults/main.yaml index 61e713858..ccb1c1bae 100644 --- a/roles/kubespray-defaults/defaults/main.yaml +++ b/roles/kubespray-defaults/defaults/main.yaml @@ -381,12 +381,12 @@ openstack_lbaas_monitor_max_retries: "3" openstack_cacert: "{{ lookup('env','OS_CACERT') }}" # Default values for the external OpenStack Cloud Controller -external_openstack_lbaas_use_octavia: true external_openstack_lbaas_create_monitor: false external_openstack_lbaas_monitor_delay: "1m" external_openstack_lbaas_monitor_timeout: "30s" external_openstack_lbaas_monitor_max_retries: "3" external_openstack_network_ipv6_disabled: false +external_openstack_lbaas_use_octavia: false external_openstack_network_internal_networks: - "" external_openstack_network_public_networks: