Skip to content

Commit f62c419

Browse files
authored
Add octavia.flavor-id option to octavia-ingress-controller (kubernetes#2076)
Signed-off-by: Hugo Larcher <[email protected]>
1 parent eee43de commit f62c419

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
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
@@ -145,6 +145,13 @@ Here are several other config options are not included in the example configurat
145145
- The security group has tags: `["octavia.ingress.kubernetes.io", "<ingress-namespace>_<ingress-name>"]`
146146
- The security group is associated with all the Neutron ports of the Kubernetes worker nodes.
147147

148+
- Options to select a flavor id. The octavia-ingress-controller will use that flavor to create the Octavia load balancer. If not specified, the default flavor will be used.
149+
150+
```yaml
151+
octavia:
152+
flavor-id: a07528cf-4a99-4f8a-94de-691e0b3e2076
153+
```
154+
148155
### Deploy octavia-ingress-controller
149156

150157
```shell

pkg/ingress/config/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,8 @@ type octaviaConfig struct {
5353
// (Optional) If the ingress controller should manage the security groups attached to the cluster nodes.
5454
// Default is false.
5555
ManageSecurityGroups bool `mapstructure:"manage-security-groups"`
56+
57+
// (Optional) Flavor ID to create the load balancer.
58+
// If empty, the default flavor will be used.
59+
FlavorID string `mapstructure:"flavor-id"`
5660
}

pkg/ingress/controller/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ func (c *Controller) ensureIngress(ing *nwv1.Ingress) error {
680680
return fmt.Errorf("TLS Ingress not supported because of Key Manager service unavailable")
681681
}
682682

683-
lb, err := c.osClient.EnsureLoadBalancer(resName, c.config.Octavia.SubnetID, ingNamespace, ingName, clusterName)
683+
lb, err := c.osClient.EnsureLoadBalancer(resName, c.config.Octavia.SubnetID, ingNamespace, ingName, clusterName, c.config.Octavia.FlavorID)
684684
if err != nil {
685685
return err
686686
}

pkg/ingress/controller/openstack/octavia.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ func (os *OpenStack) waitLoadbalancerActiveProvisioningStatus(loadbalancerID str
282282
}
283283

284284
// EnsureLoadBalancer creates a loadbalancer in octavia if it does not exist, wait for the loadbalancer to be ACTIVE.
285-
func (os *OpenStack) EnsureLoadBalancer(name string, subnetID string, ingNamespace string, ingName string, clusterName string) (*loadbalancers.LoadBalancer, error) {
285+
func (os *OpenStack) EnsureLoadBalancer(name string, subnetID string, ingNamespace string, ingName string, clusterName string, flavorId string) (*loadbalancers.LoadBalancer, error) {
286286
logger := log.WithFields(log.Fields{"ingress": fmt.Sprintf("%s/%s", ingNamespace, ingName)})
287287

288288
loadbalancer, err := openstackutil.GetLoadbalancerByName(os.Octavia, name)
@@ -303,6 +303,7 @@ func (os *OpenStack) EnsureLoadBalancer(name string, subnetID string, ingNamespa
303303
Description: fmt.Sprintf("Kubernetes ingress %s in namespace %s from cluster %s", ingName, ingNamespace, clusterName),
304304
VipSubnetID: subnetID,
305305
Provider: provider,
306+
FlavorID: flavorId,
306307
}
307308
loadbalancer, err = loadbalancers.Create(os.Octavia, createOpts).Extract()
308309
if err != nil {

0 commit comments

Comments
 (0)