-
Notifications
You must be signed in to change notification settings - Fork 463
[OCPNODE-852] workerlatency profiles - updating the kubelet configuration based on the nodes.config.openshift.io resource #3015
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
[OCPNODE-852] workerlatency profiles - updating the kubelet configuration based on the nodes.config.openshift.io resource #3015
Conversation
|
/hold |
997467f to
f362e38
Compare
5f77c6d to
0d10faf
Compare
|
/retest-required |
|
1fc165f to
b25e0c4
Compare
Addressed, re-arranged the commits. |
|
/test e2e-aws |
yuqi-zhang
left a comment
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.
So I did some testing with this PR:
- create a nodes.config.openshift.io object with latency profile medium - result: created 97-generated-kubelet with
"nodeStatusUpdateFrequency": "20s",✔️ - create a kubeletconfig, generating 99-generated-kubelet with both the config and
"nodeStatusUpdateFrequency": "20s",✔️ - create another kubeletconfig, generating 99-generated-kubelet-1 with the new config and
"nodeStatusUpdateFrequency": "20s",✔️ - attempt to delete nodes.config.openshift.io/cluster - can't, which I think is expected ✔️
- attempt to change nodes.config.openshift.io/cluster back to latency profile default - the 97-generated-kubelet does work and changes to
"nodeStatusUpdateFrequency": "10s",BUT the 99-kubelet-generated/99-kubelet-generated-1 still has"nodeStatusUpdateFrequency": "20s",. Meaning that it will overwrite (and thus will not work). i.e. if you have any kubeletconfigs on the node, you can't modify the profile anymore, which I think is incorrect ❌ - attempt to create a new nodes.config.openshift.io/test object. Creation is successful, but nothing happens. I assume only nodes.config.openshift.io/cluster is used? ❔
Re point 5: I think we have to somehow trigger the kubeletconfig object sync again with the latest kubeletconfig object such that it regenerates the config... which is problematic. Actually now I think about it, featuregates may also have this problem...? But that doesn't come up as often since you create them and don't generally change them, whereas the latency profile is multiple-step from default->medium->low.
|
One option for the above could be to have the node.config.openshift.io sync loop also check and update each kubeletconfig-machineconfig (i.e. 99-generated-worker-kubelet, 99-generated-worker-kubelet-1, etc.) and update all of them. |
Hello @yuqi-zhang , Thanks for bringing out this scenario. Point 6: |
|
/retest-required |
1 similar comment
|
/retest-required |
yuqi-zhang
left a comment
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.
Holding until #2868 merges. For consistency purposes, left a few nits below, as well as some other comments
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.
Ok yeah this should work. Fortunately we keep that 1to1 mapping so we won't accidentally generate new MCs
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.
Yes
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.
Not a problem right now, but if we ever move to multiple pools, I think this should instead do this outside of the for loop and gate on whether any pools changed. Just a minor note
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.
Sure, Addressed
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.
I assume statements like this were used for debug? If not, could you either remove or format this? (The error gets returned anyways)
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.
Addressed
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.
For error statements, could you use %w instead of %v to be consistent with #2868
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.
Done
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.
Will not list these separately, but again, if you want to log the error, please do so via error logs at regular verbosity, %w the error, or V(4) as debug statements
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.
Addressed
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.
So, just to make sure, all other node.config.openshift.io objects that are not cluster should be ignored? Will this be in the documentation?
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.
Oh I see in the create/update syncs you just degrade if the node object is not named cluster
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.
Yeah
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.
Hmm ok so this is the main check for whether the update is allowable or not.
So, I thought through the possibilities, and I think this will work so long as we only have 3 latency profiles.
i.e. this check is only for updates. So if I had 4 profiles that can only go from a->b->c->d and I want to skip b/c for example, I think can just do:
a->c (degrade, nothing happens)
c->d -> this actually works, because even though the actual config is on a, we are looking only at our object (on c) and desired (on d). So we essentially would have done a->d right? And this would let it through
In a more perfect scenario I think the controller creating the MC (sync function) should do the final check between current and desired. This should just enqueue and have the sync handle this.
I'm not against merging as is, but just for future, if we have more things to handle, the sync loop should be the place, and not individual informer checks.
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.
The idea here is to automate the process of this transition in future(as mentioned in the (TODO) comment) without rejecting the user request. That automatic transition needs a thorough design, testing and hence implemented a check here this way for now.
addressed the review comments
|
/retest |
|
@sairameshv: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. I understand the commands that are listed here. |
|
/test e2e-gcp-op |
|
Thank you for all the reviews and hard work on this. /lgtm |
yuqi-zhang
left a comment
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.
There are a few more locations where there seems to be extra non-needed debug statements, as well as %v instead of %w in the error formatting, but let's fix those up as a follow up PR, no need to block the actual functionality on that.
Thanks for all the fixups. I think we are good to go.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rphillips, sairameshv, yuqi-zhang The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
- What I did
Added support to update the kubelet configuration based on the node.config.openshift.io spec changes
-How to verify it
Create/Update the nodes.config.openshift.io CR with the relevant/valid workerlatency profile and expect the corresponding changes in the Kubelet Configuration that are rolled out on all the worker nodes by MCO leveraging the KubeletConfig CR.
- Description for the changelog
Based on the enhancement, users can create/modify the node.config.openshift.io resource which results in the corresponding kubelet configuration changes on all the worker nodes.