Skip to content

Commit b6c09c4

Browse files
authored
Merge pull request #1589 from jackfrancis/nat-gateway-lb-fix
fix: don't create outbound LB if using NatGateway
2 parents e9a2f2a + 573f76b commit b6c09c4

File tree

6 files changed

+533
-25
lines changed

6 files changed

+533
-25
lines changed

api/v1alpha4/azurecluster_default.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -202,18 +202,18 @@ func (c *AzureCluster) setNodeOutboundLBDefaults() {
202202
return
203203
}
204204

205-
var oneSubnetWithoutNatGateway bool
205+
var needsOutboundLB bool
206206
for _, subnet := range c.Spec.NetworkSpec.Subnets {
207207
if subnet.Role == SubnetNode && !subnet.IsNatGatewayEnabled() {
208-
oneSubnetWithoutNatGateway = true
208+
needsOutboundLB = true
209209
break
210210
}
211211
}
212212

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

0 commit comments

Comments
 (0)