-
Notifications
You must be signed in to change notification settings - Fork 5
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
fix: Deterministic ordering of lifecycle hooks #847
Conversation
This commit introduces wrapper handlers to allow ordering of lifecyce hooks to be called via a single registered hook. This ensures that hooks are called in a defined order, fixing issues that have arisen that require CNI hook to be applied before metallb hook.
With one handler for a specific hook type running "sub-handlers" sequentially, we'll need to be careful to make sure the handler responds within the CAPI deadline of 30s. We talked about running "sub-handlers" in parallel, and we can do that in follow-up PR. |
On
|
Good catch. Those 10s timeouts make sense for individual handlers, but we should increase it, perhaps to 30s, for the one aggregate handler. |
On second thought, if the sub-handler fails, no other sub-handlers will run, so shortening the timeout isn't useful. But it will be necessary if/when we execute sub-handlers in parallel. |
I'll reduce the MetalLB timeout to 10s, since the handler is already limited to 10s by CAPI's default. We'll want to raise the handler timeout to 30s, but in a way that fits with the library, and that'll need some thought. |
CAPI expects handlers to respond within 10s by default; 30s is only a configurable maximum.
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.
Verified in the logs that the handlers are called in the expected order and the HCPs are also created in the same order:
(Notice the metallb is last)
$ kubectl get hcp -w
NAME READY REASON
cilium-cni-installation-dkoshkin-hook-ordering
nutanix-ccm-dkoshkin-hook-ordering
node-feature-discovery-dkoshkin-hook-ordering
cluster-autoscaler-dkoshkin-hook-ordering
nutanix-csi-dkoshkin-hook-ordering
snapshot-controller-dkoshkin-hook-ordering
metallb-dkoshkin-hook-ordering
0bd6852
to
115f16b
Compare
🤖 I have created a release *beep* *boop* --- ## 0.13.7 (2024-08-13) <!-- Release notes generated using configuration in .github/release.yaml at main --> ## What's Changed ### Fixes 🔧 * fix: Deterministic ordering of lifecycle hooks by @jimmidyson in #847 * fix: reorder lifecycle handlers with serviceloadbalancer being last by @dkoshkin in #848 * fix: update mindthegap by @faiq in #852 * fix: Handle long cluster names by @jimmidyson in #845 **Full Changelog**: v0.13.6...v0.13.7 --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit introduces wrapper handlers to allow ordering
of lifecyce hooks to be called via a single registered hook.
This ensures that hooks are called in a defined order, fixing
issues that have arisen that require CNI hook to be applied
before metallb hook.