Skip to content

NEEDS-JIRA: Fix node.kubernetes.io/exclude-from-external-load-balancers on masters#127

Open
mdbooth wants to merge 5 commits into
openshift:release-4.17from
mdbooth:OCPBUGS-84569-4.17
Open

NEEDS-JIRA: Fix node.kubernetes.io/exclude-from-external-load-balancers on masters#127
mdbooth wants to merge 5 commits into
openshift:release-4.17from
mdbooth:OCPBUGS-84569-4.17

Conversation

@mdbooth

@mdbooth mdbooth commented Jul 3, 2026

Copy link
Copy Markdown

We previously used allHaveNodePrefix() to ensure that if a master instance group contained the bootstrap machine this would not cause it to be excluded from re-use. This worked because the bootstrap machine's name has the same prefix as all other machines in the cluster.

However, this logic unconditionally always included the master instance group. If the masters are labelled with node.kubernetes.io/exclude-from-external-load-balancers the CCM framework code will have filtered the Nodes before passing them to provider-GCP. But this logic meant we added them anyway, sending unintended traffic to the control plane machines.

Manual backport of #121

Additionally backports some small test fixes required for the tests to compile and pass. Required so we can execute the new test added for the bugfix.

/hold until the parent PRs merge

mdbooth added 5 commits July 3, 2026 10:53
Cherry-picked from upstream kubernetes/cloud-provider-gcp
commit d3a674c
…akeGCECloud

NewFakeGCECloud sets fields on the Cloud struct from TestClusterValues
but was missing the mapping from vals.SubnetworkURL to
gce.unsafeSubnetworkURL. This caused g.SubnetworkURL() to return an
empty string in tests that set vals.SubnetworkURL, which in turn made
subnetNameFromURL() fail and skip node filtering entirely in
ensureInternalInstanceGroups.

This is the minimum required change from upstream commit
b8caeb9 (PR kubernetes#647: "Add
syncDefaultPodRanges change for Multi-networking default Param and
Network"), which introduced SubnetworkURL into TestClusterValues and
wired it through NewFakeGCECloud. Only that wiring is extracted here;
the rest of PR kubernetes#647 is unrelated to this branch.
…balancers on masters

We previously used allHaveNodePrefix() to ensure that if a master
instance group contained the bootstrap machine this would not cause it
to be excluded from re-use. This worked because the bootstrap machine's
name has the same prefix as all other machines in the cluster.

However, this logic unconditionally always included the master instance
group. If the masters are labelled with
node.kubernetes.io/exclude-from-external-load-balancers the CCM
framework code will have filtered the Nodes before passing them to
provider-GCP. But this logic meant we added them anyway, sending
unintended traffic to the control plane machines.

Manual backport of 52387cc
Commit f867d9c (UPSTREAM: 306: Disable GCE external load balancer when
services handled by Ingress-GCE) accidentally removed the
v1 "k8s.io/api/core/v1" import from gce_loadbalancer_external_test.go
while the file continued to use v1.* types throughout, causing a build
failure.

The upstream fix is in commit 2e52b88 (Merge pull request kubernetes#930 from
upodroid/build-binaries-correctly), which rewrote the entire file.
This commit extracts only the minimum change required: restoring the
missing import.
@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 3, 2026
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 0bd92d57-3598-42d3-8b9c-0e9f5cc9f288

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci
openshift-ci Bot requested review from nrb and racheljpg July 3, 2026 10:06
@openshift-ci

openshift-ci Bot commented Jul 3, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign theobarberbany for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci

openshift-ci Bot commented Jul 3, 2026

Copy link
Copy Markdown

@mdbooth: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-ovn edbfa3c link true /test e2e-gcp-ovn

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant