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

2117 commits

Author SHA1 Message Date
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
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
Markus Lehtonen
cb0a46ec0e Use generics for maps and slices 2023-12-13 12:09:53 +02:00
Kubernetes Prow Robot
6ef153e4c3
Merge pull request #1502 from marquiz/devel/maps
Use non-exp maps package
2023-12-12 17:14:05 +01:00
Markus Lehtonen
8e477cdfa4 Use non-exp maps package
The maps package became available as a standard non-experimental package
in Go 1.21.
2023-12-12 17:31:25 +02:00
Kubernetes Prow Robot
605c66974a
Merge pull request #1501 from marquiz/devel/fix-deny-ns
nfd-master: remove default denied ns from config
2023-12-12 15:29:54 +01:00
Markus Lehtonen
a77983556f nfd-master: remove default denied ns from config
These are now handled by the validate package. If we have them here in
nfd-master, the default namespace (feature.node.kubernetes.io) gets
denied.
2023-12-12 16:12:53 +02:00
Kubernetes Prow Robot
efe5c03071
Merge pull request #1455 from ArangoGutierrez/validation
Create a Validate pkg
2023-12-12 11:04:06 +01:00
Kubernetes Prow Robot
c0d79051c0
Merge pull request #1500 from marquiz/devel/makefile-fix-e2e
Makefile: fix e2e-testing of the full image
2023-12-12 10:44:09 +01:00
Markus Lehtonen
4ebe58ffd9 Makefile: fix e2e-testing of the full image
Fix syntax error in the shell code. Also enable verbosity to print out
the shell script being run.
2023-12-12 11:25:03 +02:00
Kubernetes Prow Robot
795c35683d
Merge pull request #1499 from marquiz/devel/deps
go.mod: update dependencies
2023-12-11 17:21:43 +01:00
Carlos Eduardo Arango Gutierrez
affb93ea50
Create a Validate pkg
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
2023-12-11 16:54:22 +01:00
Markus Lehtonen
c1c078e124 go.mod: update dependencies 2023-12-11 14:42:35 +02:00
Kubernetes Prow Robot
9a5b2447b6
Merge pull request #1498 from marquiz/devel/e2e-makefile
Makefile: more verbose output for e2e-tests
2023-12-08 19:48:29 +01:00
Markus Lehtonen
c04e022269 Makefile: more verbose output for e2e-tests
Also fixes some indentation,
2023-12-08 19:28:56 +02:00
Kubernetes Prow Robot
794630f7df
Merge pull request #1489 from ArangoGutierrez/ginkofocus
Makefile: add env var controls to make test targets configurable
2023-12-08 18:24:20 +01:00
Kubernetes Prow Robot
fae0825cae
Merge pull request #1496 from marquiz/devel/fix-e2e
test/e2e: fix broken test
2023-12-08 17:53:49 +01:00
Carlos Eduardo Arango Gutierrez
f9195ef6a4
Makefile: add env var controls to make test targets configurable
Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
2023-12-08 17:48:00 +01:00
Markus Lehtonen
c5174a835d test/e2e: fix broken test
Missed one check of NodeFeature API is enablement.
2023-12-08 18:35:37 +02:00
Kubernetes Prow Robot
a86369c371
Merge pull request #1495 from marquiz/devel/nf-owner-ref-test
test/e2e: test NodeFeature owner reference
2023-12-08 15:30:34 +01:00
Markus Lehtonen
c02e05245b test/e2e: test NodeFeature owner reference
Add tests for verifying that the automatic garbage-colletion of
NodeFeature objects created by nfd-worker works as expected.
2023-12-08 16:04:03 +02:00
Kubernetes Prow Robot
04c4725dd1
Merge pull request #1491 from marquiz/devel/nf-owner-ref
nfd-worker: set owner reference in NodeFeature objects
2023-12-08 14:51:47 +01:00
Kubernetes Prow Robot
aa26bbf964
Merge pull request #1494 from marquiz/devel/master-service
deployment/kustomize: drop nfd-master service
2023-12-08 14:31:07 +01:00
Kubernetes Prow Robot
5a0623b024
Merge pull request #1493 from marquiz/devel/dockerignore
dockerignore: cleanup
2023-12-08 14:31:01 +01:00
Kubernetes Prow Robot
a56ff6be18
Merge pull request #1492 from marquiz/devel/deployment-combined
deployment/kustomize: drop default-combined overlay
2023-12-08 14:09:38 +01:00
Markus Lehtonen
34574f4211 nfd-worker: set owner reference in NodeFeature objects
This patch creates a owner-dependent relationship between the
nfd-worker pod and the NodeFeature object that it creates. With this
change the orphaned NodeFeature object(s) gets automatically
garbage-collected when the nfd-worker pod goes away, without the need
for manual clean-up actions.
2023-12-08 14:57:31 +02:00
Markus Lehtonen
9624d182ab deployment/kustomize: drop nfd-master service
Not needed anymore as we're not relying on gRPC anymore.
2023-12-08 14:53:23 +02:00
Markus Lehtonen
b6ce6f3a9b dockerignore: cleanup 2023-12-08 14:48:02 +02:00
Markus Lehtonen
53f5967555 deployment/kustomize: drop default-combined overlay
The "combined" overlay, deploying nfd-master and nfd-worker in the same
pod (with a daemonset) doesn't make sense anymore as we have enabled
NodeFeature API. There is no direct communication between nfd-master and
nfd-worker anymore, Moreover, the combined deployment can be seen as
broken as there is one NodeFeature controller (i.e. nfd-master) on each
node, causing them to race against each other, all processing all
NodeFeature objects.
2023-12-08 14:42:31 +02:00
Kubernetes Prow Robot
7f859ce568
Merge pull request #1448 from AhmedGrati/feat-discover-virtual-network-interface
feat: discover virtual network interface
2023-12-05 17:32:06 +01:00
Kubernetes Prow Robot
bdfef6df18
Merge pull request #1485 from marquiz/devel/docs-deployment
docs: remove outdated instructions for minimal image
2023-12-01 17:10:24 +01:00
Kubernetes Prow Robot
9386bf585a
Merge pull request #1486 from marquiz/devel/image-variants
Change the base image of full image variant to Debian Bookworm
2023-12-01 17:01:06 +01:00
Markus Lehtonen
e608fdac19 Change the base image of full image variant to Debian Bookworm 2023-12-01 16:38:41 +02:00
Markus Lehtonen
7ebf5c02c7 docs: remove outdated instructions for minimal image
The "minimal" image variant has been the default since v0.13.
2023-12-01 16:30:55 +02:00
Kubernetes Prow Robot
946bff2277
Merge pull request #1484 from marquiz/devel/docs-styling
docs: styling
2023-12-01 15:16:33 +01:00
Markus Lehtonen
15dc917ddb docs: streamline language 2023-12-01 15:57:53 +02:00
Markus Lehtonen
4d56ffae8f docs: fix typos 2023-12-01 15:53:19 +02:00
Markus Lehtonen
da64884d02 docs: drop "currently"
All the documentation describes the current version of NFD (it not
stated otherwise).
2023-12-01 15:47:18 +02:00
Markus Lehtonen
2f3cfbf209 docs: don't use "we" 2023-12-01 15:47:18 +02:00
Markus Lehtonen
fea395d005 docs: strip out some "easily", "just" etc 2023-12-01 15:38:26 +02:00