-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
streamline ansible_default_ipv4 gathering loop #9281
streamline ansible_default_ipv4 gathering loop #9281
Conversation
Hi @rptaylor. 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 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. |
Before:
After:
And I confirmed that the facts written to the cache look good:
|
@rptaylor could you estimate what kind of an improvement we can get with this change? should we put it as a target for 2.20 release or we are introducing a risk for the release and would be better to delay for 2.21? |
@cristicalin for now the main improvement is cleanup/simplification and adding I don't see much of a risk, it accomplishes the same thing in my testing. The only change that might have some functional difference is removing |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
This looks good for me. /ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rptaylor Thank you for the PR 👍
🚀 to 2.21
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: floryut, rptaylor 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 |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
If nodes' ansible_default_ipv4 are not defined, this loop gathers it from facts on each node.
However for large clusters this is extremely slow because this loop executes in serial, only one node at a time, because of how it is delegated to just one host and runs a loop.
The PR starts to streamline this by running setup directly instead of including a separate task.
Also add
unique
filter to avoid gathering the ipv4 address of some nodes multiple times.Special notes for your reviewer:
The only reason that fallback_ips_gather.yml existed as an included task was to work around a mitogen issue. However , mitogen is deprecated in kubespray.
NOTE: My end goal was to make this work with async , poll: 0 and possibly async_status. However those tools to speed up execution in parallel are not available when include_tasks is used:
I did not get async working yet (possibly because of a complication with delegate) , but with the include removed this will open the way to using async in the future to make this much faster.
https://devops.stackexchange.com/questions/3860/is-there-a-way-to-run-with-items-loops-in-parallel-in-ansible
Does this PR introduce a user-facing change?:
No