-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
return multiple IPs for nodes when reporting ingress status #10757
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for kubernetes-ingress-nginx canceled.
|
This issue is currently awaiting triage. If Ingress contributors determines this is a relevant issue, they will accept it by applying the The 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/test-infra repository. |
Welcome @akdor1154! |
Hi @akdor1154. 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 Once the patch is verified, the new status will be reflected by the 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/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: akdor1154 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 |
this is done to make the intention of current behaviour clearer before I go changing it. this should have no effect on current behaviour.
again, no actual behaviour change here, just augmenting tests to show current behaviour before i go changing it. I changed the node IPv4 IP because other bits of the tests used the same IP for a mock load balancer.
the main consideration I had for doing this was to make sure both IPv4 and IPv6 addresses are attached to my ingress, however the approach here has nothing to do with IP Families: the change is to return all matching addresses instead of just the first, regardless of family.
this logic is no longer valid but I don't understand what's going on well enough to justify its removal yet - input welcome if you can tell me if this is/isn't reasonable.
3bd3ae5
to
89b8125
Compare
reading into the final shutdown len(addrs)>1 change a bit more - my interpretation is (could be way off)
If this interpretation is right, then I think just removing that block is justified, as the next check seems to be checking the same thing ("are their other candidates around who will update for me after I'm gone"?). I'll play around and test a bit, but as said, I'm now a bit more confident that my approach to shutdown behaviour is justified. |
initial testing looks OK. I've published a public image: # values.yaml
controller:
image:
registry: ghcr.io
image: akdor1154/ingress-nginx/controller
tag: "v1.9.4"
digest: "sha256:3b15d2cb572389e9ac131ac3218a11b54b3c1a68ba95e39a085957ef64a7420b" With that image, my ingresses get marked with all relevant node IPs, both internal and external. I don't think I'm able to test this with the e2e tests in a sensible way sorry - the e2e kind config is set to ipv4 only (by default). Setting it to dual stack seems to work here, but I suspect it will break things for mac/windows devs. As such I'm marking this ready for review. |
@akdor1154 it looks good, can you double check the e2e test and add one with node with both ipv4 and 6 address. |
/ok-to-test |
https://github.com/kubernetes/ingress-nginx/blob/main/test/e2e/framework/deployment.go I dont know if we have ipv6 tests, looking at the deployment and others, I don't really see it. That might make this a little harder to get in. |
looks like it can be added here in status https://github.com/kubernetes/ingress-nginx/blob/main/test/e2e/status/update.go |
What this PR does / why we need it:
When reporting a node's IP into an Ingress' status, currently ingress-nginx only reports the first IP. In particular, this makes it impossible to report dual IPv4/IPv6 addresses.
This PR updates behaviour to report all matching (internal vs external) addresses instead of just the first.
First two commits are small refactors to make the actual change commit easier to read.
Third commit is the meat.
Final commit is probably needed in some form but I need to look into it more: when shutting down syncStatus, looks like
len(addrs) == 1
is considered a special case, this is no longer an appropriate assumption to make but I need to look more deeply into what's going on here.Types of changes
Which issue/s this PR fixes
fixes #10756 .
How Has This Been Tested?
unit tests updated as per commits.. I will do integration testing tomorrow.
Checklist: