Skip to content

Make GCE backend service regional for the Terraform target #17229

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

Merged

Conversation

flopib
Copy link
Contributor

@flopib flopib commented Jan 22, 2025

kops' cloudup target for creating/updating a GCE cluster creates a regional backend service, which is on par with the forwarding rule being regional. The Terraform target however creates a global backend service and a regional forwarding rule, a combination that's not supported by GCP.
This PR aligns the Terraform target to the cloudup one and fixes the failing terraform apply.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 22, 2025
@k8s-ci-robot k8s-ci-robot requested a review from hakman January 22, 2025 09:34
@k8s-ci-robot
Copy link
Contributor

Hi @tesspib. Thanks for your PR.

I'm waiting for a kubernetes 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 requested a review from zetaab January 22, 2025 09:34
@k8s-ci-robot k8s-ci-robot added the area/provider/gcp Issues or PRs related to gcp provider label Jan 22, 2025
@hakman
Copy link
Member

hakman commented Jan 22, 2025

/ok-to-test
/cc @justinsb
/assign @justinsb
/kind office-hours

@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. kind/office-hours labels Jan 22, 2025
@k8s-ci-robot k8s-ci-robot requested a review from justinsb January 22, 2025 09:52
@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 22, 2025
@flopib
Copy link
Contributor Author

flopib commented Jan 22, 2025

This issue is also present in kops 1.29, which introduced internal load balancers, and imo the fix should be backported (provided it passes tests, of course)

@flopib flopib force-pushed the gce-tf-regional-backend-service branch from e4ca36c to d7ee488 Compare January 24, 2025 09:48
@ncgee
Copy link

ncgee commented Feb 7, 2025

Is there any news on the status of this PR? It's blocking our upgrade to Kubernetes 1.29. (and 1.30 after that).

@hakman
Copy link
Member

hakman commented Feb 7, 2025

Is there any news on the status of this PR? It's blocking our upgrade to Kubernetes 1.29. (and 1.30 after that).

This is waiting to be reviewed by @justinsb. Sorry for the inconvenience.

@ncgee
Copy link

ncgee commented Feb 7, 2025

Alright, I understand you're all very busy so thanks for the quick update.

@ncgee
Copy link

ncgee commented Mar 6, 2025

Would it be possible to get an update? This is still blocking our upgrade to 1.29.

@hakman
Copy link
Member

hakman commented Mar 6, 2025

/kind blocks-next

@k8s-ci-robot
Copy link
Contributor

@hakman: The label(s) kind/blocks-next cannot be applied, because the repository doesn't have them.

In response to this:

/kind blocks-next

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.

@ncgee
Copy link

ncgee commented Apr 3, 2025

Can I ask what the status of this is? Once again I understand very well that you're very busy, but this is still blocking our upgrades to 1.29 and we're getting further and further outside the supported versions.

@flopib
Copy link
Contributor Author

flopib commented Apr 25, 2025

Hi, is there any update on when this PR can be reviewed?

@justinsb
Copy link
Member

I'm so sorry about the delay, this PR is good to go and I just didn't get around to it until now.

It looks like there are also some other issues with the TF on GCP (e.g. it doesn't round-trip cleanly with non-terraform) but this one is definitely a blocker.

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 27, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: justinsb

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

The pull request process is described 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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 27, 2025
@k8s-ci-robot k8s-ci-robot merged commit 92cb98b into kubernetes:master Apr 27, 2025
19 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.32 milestone Apr 27, 2025
k8s-ci-robot added a commit that referenced this pull request Apr 27, 2025
…29-origin-release-1.32

Automated cherry pick of #17229: Make GCE backend service regional for the Terraform target
k8s-ci-robot added a commit that referenced this pull request Apr 27, 2025
…29-origin-release-1.31

Automated cherry pick of #17229: Make GCE backend service regional for the Terraform target
k8s-ci-robot added a commit that referenced this pull request Apr 27, 2025
…29-origin-release-1.30

Automated cherry pick of #17229: Make GCE backend service regional for the Terraform target
@justinsb
Copy link
Member

Sorry again about the delay here. I did some more testing with GCE + terraform, and found a few more issues. Mostly they are minor, things like #17379 which is likely to require running terraform apply twice.

But #17378 looks (to me) more problematic It looks like there might be a terraform bug where google_compute_instance_template has a permadiff when we use labels with an empty value (though these are valid in GCE). Has anyone else encountered this? (If so, probably easiest to comment on #17378 ... I'm trying to figure out if we should cherry-pick it and if so how far)

@ncgee
Copy link

ncgee commented Apr 29, 2025

@justinsb thanks for your efforts, we upgraded to Kubernetes 1.29 with our own patched binary and we do indeed see a problem where terraform plan runs after the upgrade apply show label "changes" in the instance templates forcing a replacement:

  # google_compute_instance_template.master-<redacted> must be replaced
+/- resource "google_compute_instance_template" "master-<redacted>" {
      ~ creation_timestamp         = "2025-04-21T10:59:22.122-07:00" -> (known after apply)
      ~ effective_labels           = { # forces replacement
          + "k8s-io-role-control-plane"  = (known after apply)
          + "k8s-io-role-master"         = (known after apply)

The PR you mentioned was merged and closed as well so I figured I would comment here. We're also running into an issue where the instance groups update_policy aren't set, and for unclear reasons this results in effective type = "PROACTIVE" configuration for one cluster (but not the other) causing an immediate restart of all three control planes at once and thus some downtime. I believe it would be beneficial to explicitly set the update policy to prevent this.

@justinsb
Copy link
Member

justinsb commented May 2, 2025

Thanks @ncgee ... I'll open an issue for what you described, just so we can have some traceability for the eventual fix.

@flopib flopib deleted the gce-tf-regional-backend-service branch May 13, 2025 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/provider/gcp Issues or PRs related to gcp provider blocks-next cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/office-hours lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants