From aa02ddcb9aae6420f281ac0ee688a70b1c23c0a6 Mon Sep 17 00:00:00 2001 From: ArchiFleKs Date: Fri, 16 Jun 2017 11:57:37 +0200 Subject: [PATCH] Add OpenStack LBaaS support --- inventory/group_vars/all.yml | 8 ++++++++ .../preinstall/templates/openstack-cloud-config.j2 | 9 +++++++++ 2 files changed, 17 insertions(+) diff --git a/inventory/group_vars/all.yml b/inventory/group_vars/all.yml index 6388ca7af..bf3a331a5 100644 --- a/inventory/group_vars/all.yml +++ b/inventory/group_vars/all.yml @@ -74,6 +74,14 @@ bin_dir: /usr/local/bin #azure_vnet_name: #azure_route_table_name: +## When OpenStack is used, if LBaaSv2 is available you can enable it with the following variables. +#openstack_lbaas_enabled: True +#openstack_lbaas_subnet_id: "the Neutron subnet id where the LBaaS VIP is, often same network as instances" +#openstack_lbaas_create_monitor: "yes" +#openstack_lbaas_monitor_delay: "1m" +#openstack_lbaas_monitor_timeout: "30s" +#openstack_lbaas_monitor_max_retries: "3" + ## Set these proxy values in order to update docker daemon to use proxies #http_proxy: "" #https_proxy: "" diff --git a/roles/kubernetes/preinstall/templates/openstack-cloud-config.j2 b/roles/kubernetes/preinstall/templates/openstack-cloud-config.j2 index 8f13fc6b9..18d75130e 100644 --- a/roles/kubernetes/preinstall/templates/openstack-cloud-config.j2 +++ b/roles/kubernetes/preinstall/templates/openstack-cloud-config.j2 @@ -7,3 +7,12 @@ tenant-id={{ openstack_tenant_id }} {% if openstack_domain_name is defined and openstack_domain_name != "" %} domain-name={{ openstack_domain_name }} {% endif %} + +{% if openstack_lbaas_enabled %} +[LoadBalancer] +subnet-id={{ openstack_lbaas_subnet_id }} +create-monitor={{ openstack_lbaas_create_monitor }} +monitor-delay={{ openstack_lbaas_monitor_delay }} +monitor-timeout={{ openstack_lbaas_monitor_timeout }} +monitor-max-retries={{ openstack_lbaas_monitor_max_retries }} +{% endif %}