Skip to content

Conversation

@dagrayvid
Copy link
Contributor

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 label hypershift.openshift.io/operator-generated-config: true and the label hypershift.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

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

@dagrayvid
Copy link
Contributor Author

/hold

For more manual testing by the NTO team.

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 7, 2022
@netlify
Copy link

netlify bot commented Sep 7, 2022

Deploy Preview for hypershift-docs ready!

Name Link
🔨 Latest commit d18bf30
🔍 Latest deploy log https://app.netlify.com/sites/hypershift-docs/deploys/63406fcecae8c80008761324
😎 Deploy Preview https://deploy-preview-1729--hypershift-docs.netlify.app/how-to/node-tuning
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Copy link
Contributor

@jmencak jmencak left a 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.
Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

@dagrayvid dagrayvid force-pushed the nto-machineconfigs branch 3 times, most recently from 4b54181 to ca2314b Compare September 7, 2022 21:02
@dagrayvid
Copy link
Contributor Author

/retest

@dagrayvid
Copy link
Contributor Author

openshift/cluster-node-tuning-operator#456 has now merged. From the NTO side, I believe this is ready for merge or further review.

/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 12, 2022
@dagrayvid
Copy link
Contributor Author

@sjenning the e2e-aws failures look like flakes to me, can you confirm?

@dagrayvid
Copy link
Contributor Author

/retest

1 similar comment
@dagrayvid
Copy link
Contributor Author

/retest

Example output:
```
NAME TUNED APPLIED DEGRADED AGE
nodepool-1-worker-1 openshift-node True False 132m
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

@enxebre enxebre Oct 5, 2022

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?

Copy link
Contributor Author

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).

@enxebre
Copy link
Member

enxebre commented Sep 23, 2022

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

@dagrayvid dagrayvid force-pushed the nto-machineconfigs branch 2 times, most recently from b33201e to 3e1ec9a Compare September 27, 2022 02:10
@dagrayvid
Copy link
Contributor Author

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

Thanks @enxebre, I added e2e tests for in-place / replace of the workflow described in the docs.

@enxebre
Copy link
Member

enxebre commented Oct 6, 2022

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.
/approve

pending rebase, passing tests and having a closer look the code details.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 6, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 6, 2022

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 6, 2022
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 7, 2022
@dagrayvid
Copy link
Contributor Author

Thanks @enxebre. I rebased this PR on the latest changes and decided to keep hostedcluster.HostedClusterAnnotation as it was (out of the API) for the sake of simplicity. Tested locally.

@dagrayvid
Copy link
Contributor Author

/retest

4 similar comments
@dagrayvid
Copy link
Contributor Author

/retest

@jmencak
Copy link
Contributor

jmencak commented Oct 10, 2022

/retest

@dagrayvid
Copy link
Contributor Author

/retest

@dagrayvid
Copy link
Contributor Author

/retest

@dagrayvid
Copy link
Contributor Author

/retest

Failures seem unrelated to the PR. Last failure was hitting the 1h timeout without any failed tests

@dagrayvid
Copy link
Contributor Author

/retest

@enxebre
Copy link
Member

enxebre commented Oct 12, 2022

/lgtm
/hold
to make sure @sjenning have the chance to have look

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 12, 2022
@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 12, 2022
@sjenning
Copy link
Contributor

lgtm
/hold cancel
e2e flaked on #1798 before
/retest-required

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 12, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 12, 2022

@dagrayvid: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-kubevirt-gcp-ovn b0b864b link false /test e2e-kubevirt-gcp-ovn
ci/prow/capi-provider-agent-sanity bff593a link false /test capi-provider-agent-sanity
ci/prow/e2e-ibmcloud-iks bff593a link false /test e2e-ibmcloud-iks

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants