-
Notifications
You must be signed in to change notification settings - Fork 435
Enable NodePool controller to apply generated MachineConfigs #1729
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
Enable NodePool controller to apply generated MachineConfigs #1729
Conversation
|
/hold For more manual testing by the NTO team. |
✅ Deploy Preview for hypershift-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
hypershift-operator/controllers/nodepool/nodepool_controller.go
Outdated
Show resolved
Hide resolved
jmencak
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.
Thank your for the PR, David. The docs look good, I found only minor nits.
| - priority: 20 | ||
| profile: openshift-node-hugepages | ||
| ``` | ||
| > **_NOTE:_** The `.spec.recommend.match` field is intentionally left blank. In this case this Tuned will be applied to all Nodes in the NodePool where this ConfigMap is referenced. It is advised to group Nodes with the same hardware configuration into the same NodePool. Not following this practice might result in TuneD operands calculating conflicting kernel parameters for two or more nodes sharing the same NodePool. |
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.
This is IMPORTANT, but let's leave it just a NOTE. This bogged me down as the first "user" of the new code. An aside, yesterday I was testing with the .spec.recommend.match field targetting a single node in the node pool. It is probably the reason I was getting this and something that still needs to be addressed on the NTO side.
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 should be no possible choice for the user to target particular nodes within a NodePool.
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.
This is behaviour is based off of how NTO works in standalone OCP. There are many cases where a TuneD profile is making in-place changes to node tunables and no MachineConfig is needed. For example, if a user wants to set some sysctl values on one node with particular labels and assign some Pods only to that Node by label.
If we do decide to remove this feature in HyperShift, we can do that, but it would be a change to the NTO code.
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.
Also note that the original issue Jiri hit here was fixed. If a user does use Node label based matching, no MachineConfig will be generated based on that Profile
hypershift-operator/controllers/nodepool/nodepool_controller.go
Outdated
Show resolved
Hide resolved
hypershift-operator/controllers/nodepool/nodepool_controller.go
Outdated
Show resolved
Hide resolved
hypershift-operator/controllers/nodepool/nodepool_controller.go
Outdated
Show resolved
Hide resolved
hypershift-operator/controllers/nodepool/nodepool_controller.go
Outdated
Show resolved
Hide resolved
4b54181 to
ca2314b
Compare
|
/retest |
ca2314b to
b964b20
Compare
|
openshift/cluster-node-tuning-operator#456 has now merged. From the NTO side, I believe this is ready for merge or further review. /unhold |
|
@sjenning the e2e-aws failures look like flakes to me, can you confirm? |
|
/retest |
1 similar comment
|
/retest |
| Example output: | ||
| ``` | ||
| NAME TUNED APPLIED DEGRADED AGE | ||
| nodepool-1-worker-1 openshift-node True False 132m |
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.
what happens if someone modified this profiles?
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.
@enxebre I'm not sure I know what you are asking. Are you wondering what would happen if someone modified the Profile objects from the hosted cluster side?
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.
Are you wondering what would happen if someone modified the Profile objects from the hosted cluster side?
@dagrayvid Yes, is it possible to change something guest cluster side which the NTO watches and reconciles against management side config and so triggering an upgrade?
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.
In theory, yes. This was discussed in some of the earlier design discussions about enabling NTO on HyperShift. Like in standalone OCP, the NTO Operand (containerized TuneD daemon) writes the needed kernel boot parameters calculated by TuneD based on the applied profile to the Profile objects status.bootcmdline field. This field is read by the Operator before creating / updating the NTO-generated MachineConfig.
If the Profile object were edited by someone with admin privileges on the guest cluster, the Operator and Operand would simultaneously reconcile. The Operand would reconcile the Profile, overwriting any change in the status. The Operator would also reconcile the Profile, potentially updating the NTO-generated MachineConfig based on the Profile status.bootcmdline change, in a race with the Operand. If the operator "loses" the race, after the operand does overwrite any admin user changes to the Profile, the operator will reconcile the Profile again, syncing the MachineConfig.
When we discussed this earlier on, the answer was that this should be "okay" as admin users of the hosted cluster already have root access to the nodes (i.e. oc debug).
hypershift-operator/controllers/nodepool/nodepool_controller.go
Outdated
Show resolved
Hide resolved
|
Can we please have e2e tests in place for both in-place / replace validating e.g. what you describe in the docs, similar to https://github.com/openshift/hypershift/blob/main/test/e2e/nodepool_machineconfig_test.go |
b33201e to
3e1ec9a
Compare
Thanks @enxebre, I added e2e tests for in-place / replace of the workflow described in the docs. |
3e1ec9a to
b7ed7a2
Compare
|
Thanks! To summarise slack discussion: After considering all the intricacies and possible paths we'll proceed with current approach and follow up to enforce read-only guest cluster resources via cel field immutability and consider any other mechanism driven from management side. pending rebase, passing tests and having a closer look the code details. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dagrayvid, enxebre 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 |
fa879ed to
d18bf30
Compare
|
Thanks @enxebre. I rebased this PR on the latest changes and decided to keep |
d18bf30 to
bff593a
Compare
|
/retest |
4 similar comments
|
/retest |
|
/retest |
|
/retest |
|
/retest |
|
/retest Failures seem unrelated to the PR. Last failure was hitting the 1h timeout without any failed tests |
|
/retest |
|
/lgtm |
|
lgtm |
|
@dagrayvid: The following tests 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. |
What this PR does / why we need it:
Add functionality to the NodePool controller
getConfig(...)function to look in the control plane namespace for any ConfigMaps containing MachineConfigs, with the labelhypershift.openshift.io/operator-generated-config: trueand the labelhypershift.openshift.io/nodePool: <nodepool name>. This is needed in order for the Node Tuning Operator to apply custom tunings which require setting kernel boot parameters.For just one simple example, this is required to reserve hugepages.
This change has been tested alongside the change in openshift/cluster-node-tuning-operator#456 which adds the ability to NTO to embed the generated MachineConfigs into ConfigMaps.
Which issue(s) this PR fixes (optional, use
fixes #<issue_number>(, fixes #<issue_number>, ...)format, where issue_number might be a GitHub issue, or a Jira story:PSAP-742
See also the enhancement which outlines the plan for this change: openshift/enhancements#1229
Checklist