Skip to content

Commit

Permalink
fix nlb firewall rules, operations and alias network subnets
Browse files Browse the repository at this point in the history
  • Loading branch information
upodroid committed Jan 20, 2024
1 parent eb0a1c3 commit 3386976
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 2 additions & 0 deletions pkg/model/gcemodel/firewall.go
Expand Up @@ -62,6 +62,8 @@ func (b *FirewallModelBuilder) Build(c *fi.CloudupModelBuilderContext) error {
// https://cloud.google.com/load-balancing/docs/health-checks
"35.191.0.0/16",
"130.211.0.0/22",
"209.85.204.0/22",
"209.85.152.0/22",
},
TargetTags: []string{b.GCETagForRole(kops.InstanceGroupRoleControlPlane)},
Allowed: []string{"tcp"},
Expand Down
4 changes: 2 additions & 2 deletions upup/pkg/fi/cloudup/gce/network.go
Expand Up @@ -167,12 +167,12 @@ func performNetworkAssignmentsIPAliases(ctx context.Context, c *kops.Cluster, cl
return err
}

serviceCIDR, err := used.Allocate(networkCIDR, net.CIDRMask(20, 32))
serviceCIDR, err := used.Allocate(networkCIDR, net.CIDRMask(16, 32))
if err != nil {
return err
}

nodeCIDR, err := used.Allocate(networkCIDR, net.CIDRMask(20, 32))
nodeCIDR, err := used.Allocate(networkCIDR, net.CIDRMask(19, 32))
if err != nil {
return err
}
Expand Down
9 changes: 5 additions & 4 deletions upup/pkg/fi/cloudup/gce/op.go
Expand Up @@ -58,7 +58,7 @@ func waitForZoneOp(client *compute.Service, op *compute.Operation) error {
}

return waitForOp(op, func(operationName string) (*compute.Operation, error) {
return client.ZoneOperations.Get(u.Project, u.Zone, operationName).Do()
return client.ZoneOperations.Wait(u.Project, u.Zone, operationName).Do()
})
}

Expand All @@ -69,7 +69,7 @@ func waitForRegionOp(client *compute.Service, op *compute.Operation) error {
}

return waitForOp(op, func(operationName string) (*compute.Operation, error) {
return client.RegionOperations.Get(u.Project, u.Region, operationName).Do()
return client.RegionOperations.Wait(u.Project, u.Region, operationName).Do()
})
}

Expand All @@ -80,7 +80,7 @@ func waitForGlobalOp(client *compute.Service, op *compute.Operation) error {
}

return waitForOp(op, func(operationName string) (*compute.Operation, error) {
return client.GlobalOperations.Get(u.Project, operationName).Do()
return client.GlobalOperations.Wait(u.Project, operationName).Do()
})
}

Expand Down Expand Up @@ -108,7 +108,8 @@ func waitForOp(op *compute.Operation, getOperation func(operationName string) (*
}
pollOp, err := getOperation(opName)
if err != nil {
klog.Warningf("GCE poll operation %s failed: pollOp: [%v] err: [%v] getErrorFromOp: [%v]", opName, pollOp, err, getErrorFromOp(pollOp))
klog.Warningf("GCE poll operation %s failed: pollOp: [%v] err: [%v]", opName, pollOp, err)
klog.Infof("getErrorFromOp: [%v]", getErrorFromOp(pollOp))
}
done := opIsDone(pollOp)
if done {
Expand Down

0 comments on commit 3386976

Please sign in to comment.