Skip to content

fix: don't create outbound LB if using NatGateway #1589

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions api/v1alpha4/azurecluster_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,18 @@ func (c *AzureCluster) setNodeOutboundLBDefaults() {
return
}

var oneSubnetWithoutNatGateway bool
var needsOutboundLB bool
for _, subnet := range c.Spec.NetworkSpec.Subnets {
if subnet.Role == SubnetNode && !subnet.IsNatGatewayEnabled() {
oneSubnetWithoutNatGateway = true
needsOutboundLB = true
break
}
}

// If we don't default the outbound LB when there are some subnets with nat gateway,
// and some without, those without wouldn't have outbound traffic. So taking the
// safer route, we configure the outbound LB in that scenario.
if len(c.Spec.NetworkSpec.Subnets) > 0 && !oneSubnetWithoutNatGateway {
if !needsOutboundLB {
return
}

Expand Down
Loading