From f03dfad4173a1131ec1c08b1c5fa6cb36c39ed95 Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Wed, 15 Jul 2015 15:34:58 -0400 Subject: [PATCH] Add load balancers in front of kube-master node Add a load balancer for kube-apiserver and another one for etcd server. We are going to support multiple master nodes and the introduction of load balancers is the first step. Change-Id: I1c4b4e3d801d4f955bfd48c26e36c340cff8da19 Partially-Implements: blueprint make-master-ha --- .../heat-kubernetes/kubecluster.yaml | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/magnum/templates/heat-kubernetes/kubecluster.yaml b/magnum/templates/heat-kubernetes/kubecluster.yaml index 59e1505eb5..b9c51d8361 100644 --- a/magnum/templates/heat-kubernetes/kubecluster.yaml +++ b/magnum/templates/heat-kubernetes/kubecluster.yaml @@ -302,6 +302,67 @@ resources: floating_network: {get_param: external_network} port_id: {get_resource: kube_master_eth0} + ###################################################################### + # + # load balancers. + # + + api_monitor: + type: OS::Neutron::HealthMonitor + properties: + type: TCP + delay: 5 + max_retries: 5 + timeout: 5 + + api_pool: + type: OS::Neutron::Pool + properties: + protocol: HTTP + monitors: [{get_resource: api_monitor}] + subnet: {get_resource: fixed_subnet} + lb_method: ROUND_ROBIN + vip: + protocol_port: 8080 + + api_pool_member: + type: OS::Neutron::PoolMember + properties: + pool_id: {get_resource: api_pool} + address: {get_attr: [kube_master_eth0, fixed_ips, 0, ip_address]} + protocol_port: 8080 + + api_pool_floating: + type: OS::Neutron::FloatingIP + properties: + floating_network: {get_param: external_network} + port_id: {get_attr: [api_pool, vip, port_id]} + + etcd_monitor: + type: OS::Neutron::HealthMonitor + properties: + type: TCP + delay: 5 + max_retries: 5 + timeout: 5 + + etcd_pool: + type: OS::Neutron::Pool + properties: + protocol: HTTP + monitors: [{get_resource: etcd_monitor}] + subnet: {get_resource: fixed_subnet} + lb_method: ROUND_ROBIN + vip: + protocol_port: 4001 + + etcd_pool_member: + type: OS::Neutron::PoolMember + properties: + pool_id: {get_resource: etcd_pool} + address: {get_attr: [kube_master_eth0, fixed_ips, 0, ip_address]} + protocol_port: 4001 + ###################################################################### # # kubernetes minions. This is an autoscaling group that will initially @@ -333,6 +394,15 @@ resources: outputs: + api_address: + value: + str_replace: + template: api_ip_address:8080 + params: + api_ip_address: {get_attr: [api_pool_floating, floating_ip_address]} + description: > + This is the IP address and port of the Kubernetes API server. + kube_master: value: {get_attr: [kube_master_floating, floating_ip_address]} description: >