Skip to content

Commit 6021fec

Browse files
authored
Do not default Octavia provider to "octavia" (#2208)
In Octavia the names of the providers are completely free-form and up to cloud administrator. While the standard names are "amphora" (aliased as "octavia") and "ovn", we cannot be guaranteed these names will work with every OpenStack cloud. This commit makes sure we do not default the Provider name to "octavia" when creating an LB for the ingress-controller as this may not work for every cloud. Instead when option is unset we will pass an empty value causing Octavia to use whatever is configured as the cloud's default. I also added docs explaining that option a bit better.
1 parent e8d89e5 commit 6021fec

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

docs/octavia-ingress-controller/using-octavia-ingress-controller.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,13 @@ Here are several other config options are not included in the example configurat
152152
flavor-id: a07528cf-4a99-4f8a-94de-691e0b3e2076
153153
```
154154

155+
- Option to set which Octavia provider to use. If unset octavia-ingress-controller will leave it unset so the load balancers will be created with the default provider configured for that OpenStack cloud, decided by the cloud administrator. You can use `openstack loadbalancer provider list` to check available Octavia providers. Please note that currently only Amphora provider is supporting all the features required for octavia-ingress-controller to work correctly. That provider can be named differently in the cloud you use.
156+
157+
```yaml
158+
octavia:
159+
provider: amphora
160+
```
161+
155162
### Deploy octavia-ingress-controller
156163

157164
```shell

pkg/ingress/controller/openstack/octavia.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,18 +291,11 @@ func (os *OpenStack) EnsureLoadBalancer(name string, subnetID string, ingNamespa
291291
return nil, fmt.Errorf("error getting loadbalancer %s: %v", name, err)
292292
}
293293

294-
var provider string
295-
if os.config.Octavia.Provider == "" {
296-
provider = "octavia"
297-
} else {
298-
provider = os.config.Octavia.Provider
299-
}
300-
301294
createOpts := loadbalancers.CreateOpts{
302295
Name: name,
303296
Description: fmt.Sprintf("Kubernetes ingress %s in namespace %s from cluster %s", ingName, ingNamespace, clusterName),
304297
VipSubnetID: subnetID,
305-
Provider: provider,
298+
Provider: os.config.Octavia.Provider,
306299
FlavorID: flavorId,
307300
}
308301
loadbalancer, err = loadbalancers.Create(os.Octavia, createOpts).Extract()

0 commit comments

Comments
 (0)