-
Notifications
You must be signed in to change notification settings - Fork 249
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
Create extended resources with NodeFeatureRule #1099
Create extended resources with NodeFeatureRule #1099
Conversation
✅ Deploy Preview for kubernetes-sigs-nfd ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
f2ba2b7
to
2c1f56d
Compare
/assign marquiz |
using apiVersion: nfd.k8s-sigs.io/v1alpha1
kind: NodeFeatureRule
metadata:
name: my-sample-rule-object
spec:
rules:
- name: "my sample rule"
extendedResources:
- "kernel-version.major"
matchFeatures:
- feature: kernel.version
matchExpressions:
major: {op: Exists} I was able to get Capacity:
cpu: 4
ephemeral-storage: 17784752Ki
feature.node.kubernetes.io/kernel-version.major: 5
hugepages-2Mi: 0
memory: 8135008Ki
pods: 110
Allocatable:
cpu: 4
ephemeral-storage: 17784752Ki
feature.node.kubernetes.io/kernel-version.major: 5
hugepages-2Mi: 0
memory: 8135008Ki
pods: 110 Annotations: kubeadm.alpha.kubernetes.io/cri-socket: unix:///var/run/crio/crio.sock
nfd.node.kubernetes.io/extended-resources: kernel-version.major (used kernel-version just bc is an int, so it was easy to use as example) |
/cc @fidencio |
@ArangoGutierrez: GitHub didn't allow me to request PR reviews from the following users: fidencio. 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. |
4dcbd2d
to
52856ef
Compare
52856ef
to
cafebc4
Compare
Using this PR, combined with mine , with the following rule ... apiVersion: nfd.k8s-sigs.io/v1alpha1
kind: NodeFeatureRule
metadata:
name: tdx-total-keys
spec:
rules:
- name: "TDX total keys rule"
extendedResources:
- "cpu-security.tdx.total_keys"
matchFeatures:
- feature: cpu.security
matchExpressions:
tdx.enabled: {op: Exists} ... I was able to get ... {
"cpu": "128",
"ephemeral-storage": "383957772Ki",
"feature.node.kubernetes.io/cpu-security.tdx.total_keys": "31",
"hugepages-1Gi": "0",
"hugepages-2Mi": "0",
"memory": "131192364Ki",
"pods": "110"
} |
cafebc4
to
8ffddca
Compare
8ffddca
to
96af09a
Compare
@fidencio Thanks for the examples here and on the depending PR, this explains the bigger picture. @ArangoGutierrez AMD told me that the only countable resources for SNP is the number of ASIDs. We can do the same for SNP what Fabiano has done here for TDX. |
/lgtm |
LGTM label has been added. Git tree hash: 9a0dd119a383f5e5304659a1a8e951d5caba7721
|
@zvonkok one hiccup we noticed yesterday was that these extended resources are not correctly shown in nodes' |
0c67733
to
96ddbae
Compare
b586bc9
to
04707d9
Compare
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.
Big hand for this work @ArangoGutierrez. I'd be happy to get this in 😎 Really cool new feature and nice e2e coverage, too. +1
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ArangoGutierrez, 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 |
@PiotrProkop @zvonkok @fidencio PR is ready for your |
Hmm, e2e failed |
Ran 8 of 263 Specs in 279.768 seconds
SUCCESS! -- 8 Passed | 0 Failed | 0 Pending | 255 Skipped
--- PASS: TestE2E (279.77s)
PASS
ok sigs.k8s.io/node-feature-discovery/test/e2e 279.813s I got a successful run before pushing |
There's an ancient bug in nfd-master that this PR exposed. Fixed by #1119. I'd suggest to merge that one first either way is fine, we need both of these. Anyway, this PR (1099) still legit |
And we are back in business here! |
/test all |
I am happy to LGTM this PR but something is wrong with Netlify :( |
/retest |
Prow comments don't retrigger GitHub actions. |
Add support for management of Extended Resources via the NodeFeatureRule CRD API. There are usage scenarios where users want to advertise features as extended resources instead of labels (or annotations). This patch enables the discovery of extended resources, via annotation and patch of node.status.capacity and node.status.allocatable. By using the NodeFeatureRule API. Co-authored-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com> Co-authored-by: Markus Lehtonen <markus.lehtonen@intel.com> Co-authored-by: Fabiano Fidêncio <fabiano.fidencio@intel.com> Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com> Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
04707d9
to
250aea4
Compare
@PiotrProkop Netlify is happy now |
/lgtm Good job! @ArangoGutierrez @fidencio |
LGTM label has been added. Git tree hash: 01d6880d520986fbccdd492edea49c36d4fbc501
|
@ArangoGutierrez @fidencio thanks! |
Fixes #1081
Add support for management of extended resources with the
NodeFeatureRule
CRD API.There are usage scenarios where users want to advertise features
as extended resources instead of labels (or annotations).
This patch enables the discovery of extended resources, via annotation
and patch of
node.status.capacity
andnode.status.allocatable
By usingthe
NodeFeatureRule
API.Co-authored-by: Carlos Eduardo Arango Gutierrez eduardoa@nvidia.com
Co-authored-by: Fabiano Fidêncio fabiano.fidencio@intel.com