1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00
Commit graph

2355 commits

Author SHA1 Message Date
Kubernetes Prow Robot
03f1f75f34
Merge pull request #1523 from marquiz/devel/kustomize
deployment/kustomize: enable nfd-gc in the default overlay
2023-12-21 21:42:45 +01:00
Markus Lehtonen
732599acc4 Update readme to v0.15.0 release 2023-12-21 21:40:14 +02:00
Markus Lehtonen
9846dede43 deployment/kustomize: enable nfd-gc in the default overlay 2023-12-21 21:30:14 +02:00
Kubernetes Prow Robot
84b0a263f8
Merge pull request #1521 from marquiz/devel/fix-samples-links
docs: fixes
2023-12-21 17:52:12 +01:00
Kubernetes Prow Robot
2d9f1c2acb
Merge pull request #1518 from marquiz/devel/docs-fix
docs: second fix to the prometheus kustomize overlay name
2023-12-21 17:52:02 +01:00
Kubernetes Prow Robot
2f99038ea8
Merge pull request #1520 from marquiz/devel/docs-fix-master-config-ref
docs: fix wording and nfd version in master config ref
2023-12-21 17:43:56 +01:00
Markus Lehtonen
6471a1f185 docs: second fix to the prometheus kustomize overlay name 2023-12-21 18:40:14 +02:00
Markus Lehtonen
de2a212002 docs: fixes
- Fix broken link to nodefeaturerule samples
- Fix sample output of kubectl plugin
2023-12-21 18:34:07 +02:00
Kubernetes Prow Robot
6c7fc241f2
Merge pull request #1519 from marquiz/devel/docs-annotations
docs: document all tracking annotations
2023-12-21 17:25:07 +01:00
Markus Lehtonen
304785a0d2 docs: fix wording and nfd version in master config ref 2023-12-21 18:22:01 +02:00
Markus Lehtonen
7694bfd02b docs: document all tracking annotations
List tracking annotations for taints and feature annotations.
2023-12-21 18:15:00 +02:00
Kubernetes Prow Robot
bac1a97f32
Merge pull request #1517 from marquiz/devel/docs-fix
docs: fix name of prometheus kustomize overlay
2023-12-21 17:05:59 +01:00
Markus Lehtonen
08a12eb213 docs: fix name of prometheus kustomize overlay 2023-12-21 17:58:01 +02:00
Kubernetes Prow Robot
0ca16c01e8
Merge pull request #1446 from ArangoGutierrez/nfd.cli
Add Kubectl NFD plugin
2023-12-21 16:41:51 +01:00
Kubernetes Prow Robot
6793096b2e
Merge pull request #1516 from marquiz/devel/docs-uri-fix
docs: fix malformed hyperlink syntax
2023-12-21 16:19:30 +01:00
Kubernetes Prow Robot
874cc98728
Merge pull request #1515 from marquiz/devel/docs-cpuid
docs: document new x86 cpuid features
2023-12-21 16:11:05 +01:00
Carlos Eduardo Arango Gutierrez
57b6035b71
Add kubectl-nfd
kubectl-nfd is a kubectl plugin for debbuging NodeFeatureRules

Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
2023-12-21 16:00:19 +01:00
Markus Lehtonen
d54972fb7c docs: fix malformed hyperlink syntax 2023-12-21 16:38:14 +02:00
Markus Lehtonen
ed7dbe2411 docs: document new x86 cpuid features
Document the Intel APX and AVX10 features that were added with cpuid
v2.2.6.
2023-12-21 15:05:10 +02:00
Kubernetes Prow Robot
bca027a386
Merge pull request #1514 from marquiz/devel/docs-image-variants
docs: use default instead of minimal image variant
2023-12-21 07:57:27 +01:00
Markus Lehtonen
f49e0a43c0 docs: use default instead of minimal image variant 2023-12-20 23:48:34 +02:00
Kubernetes Prow Robot
1a5659f9cc
Merge pull request #1509 from marquiz/devel/deps-k8s
go.mod: bump kubernetes to v1.29
2023-12-20 15:13:44 +01:00
Markus Lehtonen
ea68017af6 test/e2e: replace k8s.io/utils/pointer package
Use "k8s.io/utils/ptr" instead of the deprecated "k8s.io/utils/pointer".
2023-12-20 15:12:11 +02:00
Markus Lehtonen
f199e3276b go.mod: bump kubernetes to v1.29 2023-12-20 14:40:52 +02:00
Kubernetes Prow Robot
9de86b0aa0
Merge pull request #1508 from marquiz/devel/api-refactor
apis/nfd: split rule processing into a separate package
2023-12-20 12:52:08 +01:00
Markus Lehtonen
97bf841140 apis/nfd: split rule processing into a separate package
This patch tidies up the nfdv1alpha1 API package by refactoring out the
implementation of (NodeFeature)Rule evaluation into a separate package.
2023-12-20 12:52:15 +02:00
Kubernetes Prow Robot
e162540e54
Merge pull request #1507 from kubernetes-sigs/dependabot/go_modules/golang.org/x/crypto-0.17.0
build(deps): bump golang.org/x/crypto from 0.16.0 to 0.17.0
2023-12-19 09:25:13 +01:00
dependabot[bot]
7c44e12b92
build(deps): bump golang.org/x/crypto from 0.16.0 to 0.17.0
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.16.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.16.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-19 00:09:49 +00:00
Kubernetes Prow Robot
8f9dc32e0b
Merge pull request #1506 from gyuho/fix-typo-in-error-message
chore(nfd-worker): fix minor typo in wrong label value format error
2023-12-18 19:50:19 +01:00
Gyuho Lee
ed0418b81c
chore(nfd-worker): fix minor typo in wrong label value format error
Signed-off-by: Gyuho Lee <gyuho@lepton.ai>
2023-12-19 02:29:37 +08:00
AhmedGrati
f962698c14 chore: combine cpu count and thread_siblings functions into discover topology function
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-12-18 16:29:38 +01:00
Kubernetes Prow Robot
7ae25167fe
Merge pull request #1479 from marquiz/devel/api-internal
source/custom: add internal rule api
2023-12-18 16:17:55 +01:00
Markus Lehtonen
b28d5c1557 apis/nfd: drop unused validate function 2023-12-18 15:19:19 +02:00
Markus Lehtonen
74bc3bb2a8 apis/nfd: drop custom unmarshaller functions
Not needed in the external API.
2023-12-18 15:19:19 +02:00
Markus Lehtonen
a8092927fc source/custom: use internal api for config parsing
Change the custom feature source of nfd-worker to use the newly added
internal config API for its own configuration. It now uses the internal
types for json/yaml unmarshalling but converts them to external
nfdv1alpha1 API to do the actual rule matching as the internal API does
not duplicate that functionality.
2023-12-18 15:19:19 +02:00
Markus Lehtonen
185b406ee7 source/custom: add internal rule api
Add internal API for the nfd-worker custom feature source rule
configuration. This API has already diverged from the NFD
NodeFeatureRule API in that annotations, extended resources or taints
are not supported. This patch basically copies the Rule type (and it's
sub-types) from the nfdv1alpha1 package. It also adds conversion
functions from the internal rule API to the "external" nfdv1alpha1 API.
This is done to use the same rule matching functionality (from the
nfdv1alpha1 package).

One notable remark is that the feature source rule config supports some
custom formatting (short forms, multi-type fields) that relies on
special json/yaml unmarshalling functions that are better to nuke from
the nfdv1alpha1 package (in another patch). These (legacy) syntax
specialities are most probably used by nobody but let's keep them as
they're already there.  Unit tests to cover the custom json
unmarshalling are now added.
2023-12-18 15:19:19 +02:00
Kubernetes Prow Robot
884edc67eb
Merge pull request #1477 from marquiz/devel/api-cleanup
apis/nfd: drop the private template caching fields
2023-12-15 15:42:31 +01:00
Kubernetes Prow Robot
3ea2a38d73
Merge pull request #1497 from AhmedGrati/feat-add-cpu-socket-number
feat: add cpu socket count in `cpu.topology`
2023-12-15 13:29:51 +01:00
Kubernetes Prow Robot
b47b1a62e9
Merge pull request #1504 from marquiz/devel/wildcard-rule-ng
Document the NodeFeatureRule samples and move them under deployment dir
2023-12-15 13:11:01 +01:00
Markus Lehtonen
84fa1ed6e1 Document the NodeFeatureRule samples and move them under deployment dir 2023-12-15 13:43:26 +02:00
Kubernetes Prow Robot
119e2a374b
Merge pull request #788 from marquiz/devel/wildcard-rule-ng
apis/nfd: add matchName field in feature matcher terms
2023-12-15 12:30:00 +01:00
AhmedGrati
ebb08369d3 feat: add cpu socket number in cpu.topology
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-12-15 11:04:42 +01:00
Markus Lehtonen
49886ed635 Add sample NodeFeatureRules for all built-in labels
This patch adds sample NodeFeatureRules that correspond the built-in
labels created by nfd-worker (with its default configuration).

The samples provide examples on how to utilize NodeFeatureRules and an
easy way to modify the labels being generated. In order to replace the
built-in node labeling of nfd-worker with these sample rules, all node
labeling from nfd-worker must be disabled by setting the
"core.labelSources" configuration option to an empty list (or specify
"-label-sources= " on the command line). Then, with all nfd-worker side
labeling disabled, just apply the rules with

  kubectl apply -f samples/
2023-12-15 11:32:23 +02:00
Markus Lehtonen
912c7dcf2c apis/nfd: fix an error in auto-generated code
Work around a bug in k8s deepcopy-gen.
2023-12-15 11:32:23 +02:00
Markus Lehtonen
fe412a54b9 apis/nfd: add matchName field in feature matcher terms
Extend the format of feature matcher terms (the elements of the
arrayspecified under under matchFeatures field) with new matchName
field. The value of this field is an expression that is evaluated
against the names of feature elements instead of their values (values
are matched with the matchExpressions field, instead).

The matchName field is useful e.g. in template rules for creating
per-feature-element labels based on feature names (instead of values)
and in non-template rules for checking if (at least) one of certain
feature element names are present.

If both matchExpressions and matchName for certain feature matcher term
is specified, they both must match in order to get an overall match.
Also, in this case the list of matched features (used in templating) is
the union of the results from matchExpressions and matchName.

An example of creating an "avx512" label if any AVX512* CPUID feature is
present:

  - name: "avx wildcard rule"
    labels:
        avx512: "true"
    matchFeatures:
      - feature: cpu.cpuid
        matchName: {op: InRegexp, value: ["^AVX512"]}

An example of a template rule creating a dynamic set of labels  based on
the existence of certain kconfig options.

  - name: "kconfig template rule"
    labelsTemplate: |
      {{ range .kernel.config }}kconfig-{{ .Name }}={{ .Value }}
      {{ end }}
    matchFeatures:
      - feature: kernel.config
        matchName: {op: In, value: ["SWAP", "X86", "ARM"]}

NOTE: this patch changes the corner case of nil/null match expressions
with instance features (i.e. "matchExpressions: null"). Previously, we
returned all instances for templating but now a nil match expression is
not evaluated and no instances for templating are returned.
2023-12-15 11:32:23 +02:00
Markus Lehtonen
b2d9e15a00 apis/nfd: drop the private template caching fields
Drop the private fields – that were supposed to be used for caching parsed
templates – from the Rule type. Keep the API typedefs cleaner and
simpler. Moreover, the caching was not even used in practice,
effectively complicating code without any benefit: the way the types
are used in nfd-master creates a local copy of Rule type storing the
cached template in the copy, wasting it from any future users.

There are also other possible caveats in caching like we tried to do it.
For example the objects returned by the api lister are supposed to be
treated as read-only - in particular if we would be to modify them there
should at least be proper locking in place as nfd-master potentially
processes the same rule (the same Go object) in parallel for multiple
nodes. If any optimization like this will be pursued it should be done
properly, probably with private type(s) at the consumer's end, not
contaminating the API types.
2023-12-15 10:48:07 +02:00
Kubernetes Prow Robot
443ff80748
Merge pull request #1481 from marquiz/devel/api-creation-funcs
apis/nfd: drop creation helper functions
2023-12-14 18:41:18 +01:00
Markus Lehtonen
0bc1b6c28f apis/nfd: drop creation helper functions
Drop the creation helper functions as one step in an effort to tidy up
the api package. These functions were not much used outside unit tests
anyway, the static rules of the nfd-worker custom feature source being
the only exception (and if those happened to be invalid we'd catch that
e.g. in the e2e-tests).
2023-12-14 15:54:51 +02:00
Kubernetes Prow Robot
3ce5a1b218
Merge pull request #1482 from marquiz/devel/api-cleanup-2
apis/nfd: drop the private regexp caching field
2023-12-14 12:08:58 +01:00
Kubernetes Prow Robot
f0d3bce8c6
Merge pull request #1503 from marquiz/devel/maps
Use generics for maps and slices
2023-12-14 11:37:06 +01:00