Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.

Commit 4af97b0

Browse files
committed
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.
1 parent e24e335 commit 4af97b0

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

pkg/cloudprovider/providers/openstack/openstack.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ type LoadBalancerOpts struct {
8282
SubnetId string `gcfg:"subnet-id"` // overrides autodetection.
8383
FloatingNetworkId string `gcfg:"floating-network-id"` // If specified, will create floating ip for loadbalancer, or do not create floating ip.
8484
LBMethod string `gcfg:"lb-method"` // default to ROUND_ROBIN.
85+
LBProvider string `gcfg:"lb-provider"`
8586
CreateMonitor bool `gcfg:"create-monitor"`
8687
MonitorDelay MyDuration `gcfg:"monitor-delay"`
8788
MonitorTimeout MyDuration `gcfg:"monitor-timeout"`

pkg/cloudprovider/providers/openstack/openstack_loadbalancer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ func (lbaas *LbaasV2) createLoadBalancer(service *v1.Service, name string, inter
515515
Name: name,
516516
Description: fmt.Sprintf("Kubernetes external service %s", name),
517517
VipSubnetID: lbaas.opts.SubnetId,
518+
Provider: lbaas.opts.LBProvider,
518519
}
519520

520521
loadBalancerIP := service.Spec.LoadBalancerIP

pkg/cloudprovider/providers/openstack/openstack_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ func TestCheckOpenStackOpts(t *testing.T) {
169169
SubnetId: "6261548e-ffde-4bc7-bd22-59c83578c5ef",
170170
FloatingNetworkId: "38b8b5f9-64dc-4424-bf86-679595714786",
171171
LBMethod: "ROUND_ROBIN",
172+
LBProvider: "haproxy",
172173
CreateMonitor: true,
173174
MonitorDelay: delay,
174175
MonitorTimeout: timeout,

0 commit comments

Comments
 (0)