Commit 62b8a628 authored by Daniel Gonzalez's avatar Daniel Gonzalez

Make OpenStack LBaaS v2 Provider configurable

Add option 'lb-provider' to the Loadbalancer section of the OpenStack cloudprovider configuration to allow using a different LBaaS v2 provider than the default.
parent b3a9b802
...@@ -82,6 +82,7 @@ type LoadBalancerOpts struct { ...@@ -82,6 +82,7 @@ type LoadBalancerOpts struct {
SubnetId string `gcfg:"subnet-id"` // overrides autodetection. SubnetId string `gcfg:"subnet-id"` // overrides autodetection.
FloatingNetworkId string `gcfg:"floating-network-id"` // If specified, will create floating ip for loadbalancer, or do not create floating ip. FloatingNetworkId string `gcfg:"floating-network-id"` // If specified, will create floating ip for loadbalancer, or do not create floating ip.
LBMethod string `gcfg:"lb-method"` // default to ROUND_ROBIN. LBMethod string `gcfg:"lb-method"` // default to ROUND_ROBIN.
LBProvider string `gcfg:"lb-provider"`
CreateMonitor bool `gcfg:"create-monitor"` CreateMonitor bool `gcfg:"create-monitor"`
MonitorDelay MyDuration `gcfg:"monitor-delay"` MonitorDelay MyDuration `gcfg:"monitor-delay"`
MonitorTimeout MyDuration `gcfg:"monitor-timeout"` MonitorTimeout MyDuration `gcfg:"monitor-timeout"`
......
...@@ -515,6 +515,7 @@ func (lbaas *LbaasV2) createLoadBalancer(service *v1.Service, name string, inter ...@@ -515,6 +515,7 @@ func (lbaas *LbaasV2) createLoadBalancer(service *v1.Service, name string, inter
Name: name, Name: name,
Description: fmt.Sprintf("Kubernetes external service %s", name), Description: fmt.Sprintf("Kubernetes external service %s", name),
VipSubnetID: lbaas.opts.SubnetId, VipSubnetID: lbaas.opts.SubnetId,
Provider: lbaas.opts.LBProvider,
} }
loadBalancerIP := service.Spec.LoadBalancerIP loadBalancerIP := service.Spec.LoadBalancerIP
......
...@@ -169,6 +169,7 @@ func TestCheckOpenStackOpts(t *testing.T) { ...@@ -169,6 +169,7 @@ func TestCheckOpenStackOpts(t *testing.T) {
SubnetId: "6261548e-ffde-4bc7-bd22-59c83578c5ef", SubnetId: "6261548e-ffde-4bc7-bd22-59c83578c5ef",
FloatingNetworkId: "38b8b5f9-64dc-4424-bf86-679595714786", FloatingNetworkId: "38b8b5f9-64dc-4424-bf86-679595714786",
LBMethod: "ROUND_ROBIN", LBMethod: "ROUND_ROBIN",
LBProvider: "haproxy",
CreateMonitor: true, CreateMonitor: true,
MonitorDelay: delay, MonitorDelay: delay,
MonitorTimeout: timeout, MonitorTimeout: timeout,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment