Skip to content
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

gce: fix nlb firewall rules, operations and alias network subnets #16265

Merged
merged 1 commit into from
Jan 20, 2024
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
2 changes: 2 additions & 0 deletions pkg/model/gcemodel/firewall.go
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ resource "google_compute_firewall" "lb-health-checks-minimal-gce-example-com" {
disabled = false
name = "lb-health-checks-minimal-gce-example-com"
network = google_compute_network.minimal-gce-example-com.name
source_ranges = ["35.191.0.0/16", "130.211.0.0/22"]
source_ranges = ["35.191.0.0/16", "130.211.0.0/22", "209.85.204.0/22", "209.85.152.0/22"]
target_tags = ["minimal-gce-example-com-k8s-io-role-control-plane"]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ resource "google_compute_firewall" "lb-health-checks-minimal-gce-ilb-example-com
disabled = false
name = "lb-health-checks-minimal-gce-ilb-example-com"
network = google_compute_network.minimal-gce-ilb-example-com.name
source_ranges = ["35.191.0.0/16", "130.211.0.0/22"]
source_ranges = ["35.191.0.0/16", "130.211.0.0/22", "209.85.204.0/22", "209.85.152.0/22"]
target_tags = ["minimal-gce-ilb-example-com-k8s-io-role-control-plane"]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ resource "google_compute_firewall" "lb-health-checks-minimal-gce-with-a-very-ver
disabled = false
name = "lb-health-checks-minimal-gce-with-a-very-very-very-very--96dqvi"
network = google_compute_network.minimal-gce-with-a-very-very-very-very-very-long-name-ex-96dqvi.name
source_ranges = ["35.191.0.0/16", "130.211.0.0/22"]
source_ranges = ["35.191.0.0/16", "130.211.0.0/22", "209.85.204.0/22", "209.85.152.0/22"]
target_tags = ["minimal-gce-with-a-very-very-v-96dqvi-k8s-io-role-control-plane"]
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ resource "google_compute_firewall" "lb-health-checks-minimal-gce-plb-example-com
disabled = false
name = "lb-health-checks-minimal-gce-plb-example-com"
network = google_compute_network.minimal-gce-plb-example-com.name
source_ranges = ["35.191.0.0/16", "130.211.0.0/22"]
source_ranges = ["35.191.0.0/16", "130.211.0.0/22", "209.85.204.0/22", "209.85.152.0/22"]
target_tags = ["minimal-gce-plb-example-com-k8s-io-role-control-plane"]
}

Expand Down
4 changes: 2 additions & 2 deletions upup/pkg/fi/cloudup/gce/network.go
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
klog.Infof("getErrorFromOp: [%v]", getErrorFromOp(pollOp))
klog.Warningf("GCE poll getErrorFromOp: [%v]", getErrorFromOp(pollOp))

Copy link
Member Author

@upodroid upodroid Jan 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is the problem

W1231 23:57:40.606721   75771 op.go:111] GCE poll operation operation-1704067055308-60dd707814e11-4ceef041-b4b17b9e failed: pollOp: [<nil>] err: [googleapi: Error 403: Quota exceeded for quota metric 'Heavy-weight read requests' and limit 'Heavy-weight read requests per minute per region' of service 'compute.googleapis.com' for consumer 'project_number:189277497252'.
Details:
[
  {
    "@type": "type.googleapis.com/google.rpc.ErrorInfo",
    "domain": "googleapis.com",
    "metadatas": {
      "consumer": "projects/189277497252",
      "quota_limit": "HeavyWeightReadRequestsPerMinutePerProjectPerRegion",
      "quota_limit_value": "1500",
      "quota_location": "us-east1",
      "quota_metric": "compute.googleapis.com/heavy_weight_read_requests_per_region",
      "service": "compute.googleapis.com"
    },
    "reason": "RATE_LIMIT_EXCEEDED"
  },
  {
    "@type": "type.googleapis.com/google.rpc.Help",
    "links": [
      {
        "description": "Request a higher quota limit.",
        "url": "https://cloud.google.com/docs/quota#requesting_higher_quota"
      }
    ]
  }
]
, rateLimitExceeded]
I1231 23:57:40.606831   75771 op.go:112] getErrorFromOp: [<nil>]

I need to hide that json block as it bloats the log file. It is a transient error that disappears after a minute usually for operations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

}
done := opIsDone(pollOp)
if done {
Expand Down
Loading