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

Use the zone from the metadata for creating locality #53821

Merged
merged 5 commits into from
Nov 9, 2024

Conversation

ingwonsong
Copy link
Contributor

@ingwonsong ingwonsong commented Nov 7, 2024

Current implementation is assuming that the cluster location is "zone" when creating Locality for GCP platform.
However, for the GKE regional cluster, it is not true.

Therefore, this PR proposes to use "metadata" server to get the zone, if the cluster location is not zonal.

Change-Id: I27f1b699f7ea464eb43993eb7870ee15f7ffc8ad

@ingwonsong ingwonsong requested a review from a team as a code owner November 7, 2024 17:24
@istio-testing istio-testing added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 7, 2024
@ingwonsong ingwonsong requested a review from aryan16 November 7, 2024 17:24
@ingwonsong ingwonsong added the release-notes-none Indicates a PR that does not require release notes. label Nov 7, 2024
@ingwonsong
Copy link
Contributor Author

/test release-notes

Copy link
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

I assume this fixes #50379, right?

pkg/bootstrap/platform/gcp.go Outdated Show resolved Hide resolved
pkg/bootstrap/platform/gcp.go Outdated Show resolved Hide resolved
@ingwonsong ingwonsong force-pushed the using-metadata-for-zone branch from 564ef7a to a3f346f Compare November 7, 2024 22:34
Change-Id: I27f1b699f7ea464eb43993eb7870ee15f7ffc8ad
@ingwonsong ingwonsong force-pushed the using-metadata-for-zone branch from a3f346f to 52f395e Compare November 7, 2024 22:36
Change-Id: I63c0f955d6ed3a6051e34baa05ef9f05bbd46001
@istio-testing istio-testing added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 7, 2024
@ingwonsong
Copy link
Contributor Author

ingwonsong commented Nov 7, 2024

I assume this fixes #50379, right?

Actually, it was not, but I realized that it is great to solve the issue together.
Now, Zone is retrieved from metadata server first, and then if it is failed, we are using the cluster location as a fallback.

So, we are now using zone of Pod, not the cluster's zone.

@ingwonsong
Copy link
Contributor Author

/retest

Change-Id: Iac06b870add610464da13bc92d54817b8f5753bb
@howardjohn howardjohn mentioned this pull request Nov 8, 2024
2 tasks
@kyessenov
Copy link
Contributor

Implementation looks fine to me except the two comments above.

Change-Id: Ibc72d0dc3800fca7de781edb3858e454fdb9716b
Change-Id: I5e38ccdc61621d933e595bfab9a45a0bede1bc32
@ingwonsong
Copy link
Contributor Author

/retest

@ingwonsong ingwonsong requested a review from howardjohn November 9, 2024 06:37
Copy link
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

This regresses a major chunk of work done on Google's mesh to drop the dependency on the metadata server which was the result of a massive list of issues. Given this only impacts that product and not OSS, though, I suppose this looks good..

@istio-testing istio-testing merged commit 8a6a459 into istio:master Nov 9, 2024
27 checks passed
MaYuan-02 pushed a commit to MaYuan-02/istio that referenced this pull request Dec 8, 2024
* Use the zone from the metadata

Change-Id: I27f1b699f7ea464eb43993eb7870ee15f7ffc8ad

* Fix the test cases.

Change-Id: I63c0f955d6ed3a6051e34baa05ef9f05bbd46001

* Reduce the timeout to 3 sec

Change-Id: Iac06b870add610464da13bc92d54817b8f5753bb

* Reflect comments and add GCP_ZONE env var for overriding

Change-Id: Ibc72d0dc3800fca7de781edb3858e454fdb9716b

* Fix the failure in the unit test

Change-Id: I5e38ccdc61621d933e595bfab9a45a0bede1bc32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes-none Indicates a PR that does not require release notes. 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.

4 participants