Skip to content

remove finding of pods by IP#56502

Merged
istio-testing merged 3 commits intoistio:masterfrom
sschepens:pod-controller-avoid-ip-search
Jun 5, 2025
Merged

remove finding of pods by IP#56502
istio-testing merged 3 commits intoistio:masterfrom
sschepens:pod-controller-avoid-ip-search

Conversation

@sschepens
Copy link
Copy Markdown
Contributor

@sschepens sschepens commented Jun 4, 2025

Please provide a description of this PR:
Creating this as a draft to check if tests pass, I'm not sure why we still maintain this logic, I cannot understand in which cases we would fail to find a Pod by it's name+namespace but find them by IP.

@istio-testing
Copy link
Copy Markdown
Collaborator

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@istio-testing istio-testing added do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 4, 2025
@sschepens
Copy link
Copy Markdown
Contributor Author

/test all

@istio-testing istio-testing added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jun 4, 2025
@sschepens
Copy link
Copy Markdown
Contributor Author

/test all

@sschepens
Copy link
Copy Markdown
Contributor Author

@howardjohn wdyt? all tests pass correctly 🤔

@ramaraochavali
Copy link
Copy Markdown
Contributor

https://github.com/istio/istio/pull/28992/files#r535394193 - reason why PodbyIP is still used

@sschepens
Copy link
Copy Markdown
Contributor Author

sschepens commented Jun 4, 2025

https://github.com/istio/istio/pull/28992/files#r535394193 - reason why PodbyIP is still used

Seems like the concern mostly was backwards compatibility on 2020, which I guess should no longer be the a worry at this point? Don't know how many peope customize proxies to the point that the proxy ID is not in the form we would expect.
On the other hand i can see that we have WorkloadName in NodeMetadata, we could just use that instead of parsing the proxy ID.

Maybe I could change the logic to be exclusive, if we find a WorkloadName in the metadata, then we search directly for that and avoid searching by IP, if we don't, then we find by IP.

@howardjohn what's your take on this?

@ramaraochavali
Copy link
Copy Markdown
Contributor

Don't know how many peope customize proxies to the point that the proxy ID is not in the form we would expect.

It is quite possible. I have seen folks do that with a non injected proxy with a custom bootstrap pointing to Istiod for controlplane information.

@sschepens
Copy link
Copy Markdown
Contributor Author

Don't know how many peope customize proxies to the point that the proxy ID is not in the form we would expect.

It is quite possible. I have seen folks do that with a non injected proxy with a custom bootstrap pointing to Istiod for controlplane information.

We could add an Upgrade Note for next version warning of this change and make them send the correct metadata

@sschepens sschepens marked this pull request as ready for review June 4, 2025 18:00
@sschepens sschepens requested a review from a team as a code owner June 4, 2025 18:00
@istio-testing istio-testing removed the do-not-merge/work-in-progress Block merging of a PR because it isn't ready yet. label Jun 4, 2025
@sschepens sschepens requested a review from a team as a code owner June 5, 2025 12:45
@sschepens
Copy link
Copy Markdown
Contributor Author

Added a feature flag to restore the origina behaviour but it's turned off by default, also added an Upgrade Note to warn users, do you think this is enough?

@istio-testing
Copy link
Copy Markdown
Collaborator

@sschepens: 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
integ-ambient-mc_istio b8aaffd link false /test integ-ambient-mc
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.

Copy link
Copy Markdown
Contributor

@ramaraochavali ramaraochavali left a comment

Choose a reason for hiding this comment

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

Thanks. Curios, Did you run in to any issue and that is wanted to fix or as a general cleanup?

).Get()

EnableProxyFindPodByIP = env.Register("ENABLE_PROXY_FIND_POD_BY_IP", false,
"If enabled, the pod controller will allow findig pods matching proxies by IP if it fails to find them by name.").Get()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: /s/findig/finding

@sschepens
Copy link
Copy Markdown
Contributor Author

We found an issue in which apparently our informers were delayed and a new pod came up using the same IP address as a previous one, this caused this piece of code to not find the pod by name and search it by IP, returning an incorrect pod. The most basic fix is #56501 but it's technically not even correct to do that, even if it's in the same namespace it's probably not the pod we want.

In our case this ended up making Istiod take the Labels from an incorrect pod and ended up pushing configurations that shouldn't have been pushed to that proxy.

@ramaraochavali
Copy link
Copy Markdown
Contributor

ok. Thanks. @hzxuzhonghu FYI

@istio-testing istio-testing merged commit 56454b3 into istio:master Jun 5, 2025
29 of 30 checks passed
irenezhong2861 pushed a commit to irenezhong2861/istio that referenced this pull request Jun 5, 2025
* remove finding of pods by IP

* fix test

* add feature flag and release note
@sschepens sschepens deleted the pod-controller-avoid-ip-search branch June 5, 2025 17:52
irenezhong2861 pushed a commit to irenezhong2861/istio that referenced this pull request Jun 5, 2025
* remove finding of pods by IP

* fix test

* add feature flag and release note
irenezhong2861 pushed a commit to irenezhong2861/istio that referenced this pull request Jun 6, 2025
* remove finding of pods by IP

* fix test

* add feature flag and release note
irenezhong2861 pushed a commit to irenezhong2861/istio that referenced this pull request Jun 10, 2025
* remove finding of pods by IP

* fix test

* add feature flag and release note
sschepens added a commit to sschepens/istio that referenced this pull request Jun 11, 2025
* remove finding of pods by IP

* fix test

* add feature flag and release note
irenezhong2861 pushed a commit to irenezhong2861/istio that referenced this pull request Jun 16, 2025
* remove finding of pods by IP

* fix test

* add feature flag and release note
irenezhong2861 pushed a commit to irenezhong2861/istio that referenced this pull request Jul 7, 2025
* remove finding of pods by IP

* fix test

* add feature flag and release note
istio-testing pushed a commit that referenced this pull request Jul 7, 2025
* update native sidecar default value

* update webhook and injection

* update golden files

* release notes

* fix test

* update golden file

* comments and updates

* lint

* update testcases

* lint

* lint

* remove finding of pods by IP (#56502)

* remove finding of pods by IP

* fix test

* add feature flag and release note

* comments and updates

* update testcases

* update native sidecar default value and related comment updates

* update feature file

* update golden files

* update golden files for openshift

* update openshift golden files

* update golden file

* update default settings

* lint

---------

Co-authored-by: sschepens <sebastian.schepens@mercadolibre.com>
istio-testing pushed a commit to istio-testing/istio that referenced this pull request Jul 8, 2025
* remove finding of pods by IP

* fix test

* add feature flag and release note
istio-testing added a commit that referenced this pull request Jul 8, 2025
* update native sidecar default value

* update webhook and injection

* update golden files

* release notes

* fix test

* update golden file

* comments and updates

* lint

* update testcases

* lint

* lint

* remove finding of pods by IP (#56502)

* remove finding of pods by IP

* fix test

* add feature flag and release note

* comments and updates

* update testcases

* update native sidecar default value and related comment updates

* update feature file

* update golden files

* update golden files for openshift

* update openshift golden files

* update golden file

* update default settings

* lint

---------

Co-authored-by: irenezhong2861 <irenezhong@microsoft.com>
Co-authored-by: sschepens <sebastian.schepens@mercadolibre.com>
howardjohn pushed a commit to howardjohn/istio that referenced this pull request Sep 3, 2025
* remove finding of pods by IP

* fix test

* add feature flag and release note

(cherry picked from commit 56454b3)
istio-testing pushed a commit that referenced this pull request Sep 3, 2025
* remove finding of pods by IP

* fix test

* add feature flag and release note

(cherry picked from commit 56454b3)

Co-authored-by: sschepens <sebastian.schepens@mercadolibre.com>
fjglira pushed a commit to fjglira/istio that referenced this pull request Sep 26, 2025
* upstream/master: (28 commits)
  Automator: update common-files@master in istio/istio@master (istio#56545)
  Automator: update proxy@master in istio/istio@master (istio#56544)
  Automator: update go-control-plane in istio/istio@master (istio#56543)
  Automator: update proxy@master in istio/istio@master (istio#56540)
  Automator: update ztunnel@master in istio/istio@master (istio#56532)
  Ambient: In ambient index, filter configs by revision (istio#56477)
  Automator: update istio/client-go@master dependency in istio/istio@master (istio#56539)
  Automator: update proxy@master in istio/istio@master (istio#56538)
  Automator: update common-files@master in istio/istio@master (istio#56537)
  optimization: allow for lazy sidecar initialization (istio#47221)
  static collection eager indexes (istio#56530)
  fix typo in flag (istio#56534)
  feat: enable support for proxy protocol on status port (istio#55986)
  remove finding of pods by IP (istio#56502)
  Automator: update proxy@master in istio/istio@master (istio#56528)
  migrate file monitor to krt (istio#55970)
  Automator: update istio/client-go@master dependency in istio/istio@master (istio#56525)
  Automator: update ztunnel@master in istio/istio@master (istio#56518)
  Fix crash in merging http routes (istio#56499)
  krt: add assertions (istio#56510)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

3 participants