Skip to content

Conversation

@bochengchu
Copy link
Contributor

@bochengchu bochengchu commented Sep 24, 2025

/kind bug

What this PR does / why we need it:
Fixes #1407

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests

Release note:

Wait for API pod to be healthy before registering control plane node in instance group

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Sep 24, 2025
@netlify
Copy link

netlify bot commented Sep 24, 2025

Deploy Preview for kubernetes-sigs-cluster-api-gcp ready!

Name Link
🔨 Latest commit ec96875
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-cluster-api-gcp/deploys/68edb9be57820c000828d3e3
😎 Deploy Preview https://deploy-preview-1533--kubernetes-sigs-cluster-api-gcp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 24, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

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

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

@k8s-ci-robot k8s-ci-robot requested review from damdo and dims September 24, 2025 19:30
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 24, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @bochengchu. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 24, 2025
@bochengchu bochengchu force-pushed the main branch 2 times, most recently from 3ad69fa to 1c24d1f Compare September 24, 2025 19:34
return err
}
} else {
log.V(2).Info("[DEBUG] Skipping registering control plane instance in the instancegroup because machine is not yet provisioned", "name", instance.Name)
Copy link
Contributor

Choose a reason for hiding this comment

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

Some comments with more background on the problem would be helpful for our future selves I think!

Watches(
&clusterv1.Machine{},
handler.EnqueueRequestsFromMapFunc(util.MachineToInfrastructureMapFunc(infrav1.GroupVersion.WithKind("GCPMachine"))),
builder.WithPredicates(predicate.Funcs{
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is necessary?


if err := instances.New(machineScope).Reconcile(ctx); err != nil {
instancesSvc := instances.New(machineScope)
if err := instancesSvc.Reconcile(ctx); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Similarly I don't think this is important to this PR.

@justinsb
Copy link
Contributor

Nice catch @bochengchu - I think having a test showing the problem would be awesome (I guess in another PR, and we can figure out the sequencing of merging it). And some comments on the critical line when we don't add the new control plane node until it is ready would be helpful for others looking to understand the code / the issue.

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 25, 2025
return false
}
for _, condition := range m.Machine.Status.V1Beta2.Conditions {
if condition.Type == "APIServerPodHealthy" && condition.Status == "True" {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we should look for APIServerPodHealthy to be True here, but this is a v1beta2 condition and v1beta2 seems not yet fully migrated to in this repo, so I hardcoded here. Maybe we can have follow-up work to bring in v1beta2 and update this there?

@bochengchu bochengchu marked this pull request as ready for review October 14, 2025 02:51
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 14, 2025
@k8s-ci-robot k8s-ci-robot requested a review from cpanato October 14, 2025 02:51
@bochengchu bochengchu changed the title Hold adding to instance group until machine is provisioned Wait for API pod to be healthy before registering control plane node in instance group Oct 14, 2025
Copy link
Contributor

@salasberryfin salasberryfin left a comment

Choose a reason for hiding this comment

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

Thanks @bochengchu. Can you please add a release note in the PR description?

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Oct 15, 2025
@damdo
Copy link
Member

damdo commented Oct 24, 2025

@salasberryfin I see @bochengchu added the note.

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

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Internal Load Balancer Implementation W/Passthrough LB Does Not Appear to Support More Than Single Node Control Plane Cluster

5 participants