-
Notifications
You must be signed in to change notification settings - Fork 247
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
CRD-based custom node labeling #553
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: marquiz 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 |
/cc @kailun-qin |
@kailun-qin: GitHub didn't allow me to request PR reviews from the following users: kailun-qin. Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
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. |
bfb8bad
to
8a7494c
Compare
All feedback is very much appreciated. Especially on the soundness of the whole concept. Some concerns/questions from the top of my head below, just talking out loud... Data formatI've been pondering the data representation of "raw" features, i.e. is it good (enough). In this patchset NFD now under the hood uses a unified data model of all the "raw features" (not talking about labels here) it is detecting. Basically we divide feature types into three categories:
On the higher level, data representation of all detected features (from all features sources) is fixed into a three level hierarchy: In go code this is a bit more complicated looks something like this (in a pseudo-ish golang):
This data representation trickles down everywhere and to the rule format and CRD, too. The unified representation is nice in the sense that it reduces the lines of code dramatically and also simplifies the CRD schema plus makes it stable. Basically any new features added to NFD is automatically supported (because of the unified data representation and unified rule schema) with essentially no changes required in the CRD spec or rules. My only concern is that is this flexible enough as we're fixed with the three-level hierarchy and cannot specify arbitrary data structures for the features. For example, Intel Speed Select Technology we now have MatchExpressionsThe NamingI'm not happy with all the terms/naming that I've come up with. Need to think through it. |
8a7494c
to
2367e8c
Compare
2367e8c
to
d968f7a
Compare
Not yet ready for review? |
#464 would be the first part. But even that is not ready yet, missing unit tests and documentation. I will work on these in the coming weeks, for sure, as I want to get these finally in shape, too. |
d968f7a
to
6f2287b
Compare
6f2287b
to
e2883b4
Compare
6e2c98a
to
0df5b14
Compare
0df5b14
to
44af276
Compare
/assign |
@marquiz rebase needed |
44af276
to
b9a6f50
Compare
Enable Custom Resource based label creation in nfd-master. This extends the previously implemented controller stub for watching NodeFeatureRule objects. NFD-master watches NodeFeatureRule objects in the cluster and processes the rules on every incoming labeling request from workers. The functionality relies on the "raw features" (identical to how nfd-worker handles custom rules) submitted by nfd-worker, making it independent of the label source configuration of the worker. This means that the labeling functions as expected even if all sources in the worker are disabled. NOTE: nfd-master is stateless and re-labeling only happens on the reception of SetLabelsRequest from the worker – i.e. on intervals specified by the core.sleepInterval configuration option (or -sleep-interval cmdline flag) of each nfd-worker instance. This means that modification/creation of NodeFeatureRule objects does not automatically update the node labels. Instead, the changes only come visible when workers send their labeling requests.
b9a6f50
to
33fdf75
Compare
#656 was merged -> rebased and PR description updated |
/retest |
/lgtm |
Enable Custom Resource based label creation in nfd-master. This extends
the previously implemented controller stub for watching NodeFeatureRule
objects. NFD-master watches NodeFeatureRule objects in the cluster and
processes the rules on every incoming labeling request from workers.
The functionality relies on the "raw features" (identical to how
nfd-worker handles custom rules) submitted by nfd-worker, making it
independent of the label source configuration of the worker. This means
that the labeling functions as expected even if all sources in the
worker are disabled.
NOTE: nfd-master is stateless and re-labeling only happens on the
reception of SetLabelsRequest from the worker – i.e. on intervals
specified by the core.sleepInterval configuration option (or
-sleep-interval cmdline flag) of each nfd-worker instance. This means
that modification/creation of NodeFeatureRule objects does not
automatically update the node labels. Instead, the changes only come
visible when workers send their labeling requests.
This PR implements #468, i.e. CRD-based custom node labeling, and builds on top of previous work: