1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-15 17:50:49 +00:00
Commit graph

2184 commits

Author SHA1 Message Date
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
Markus Lehtonen
8d40524b88 apis/nfd: drop the private regexp caching field
Drop the private field for caching parsed regexp from the
MatchExpression type. This tidies up the API type definition and not so
tied with particular implementation details. The change also elimiates
potential concurrency problems as no locking is in place in the API
types.

If caching will be desired in the future, it's better to do it properly
in a separate package, not directly in the API types.
2023-12-01 15:28:55 +02:00
Kubernetes Prow Robot
cc6df8e74f
Merge pull request #1480 from marquiz/devel/api-expression-validation
apis/nfd: validate input when matching expression
2023-12-01 11:13:51 +01:00
Markus Lehtonen
b988139094 apis/nfd: validate input when matching expression
Don't assume that the fields are correct.
2023-12-01 09:22:32 +02:00
Kubernetes Prow Robot
ea1264ae68
Merge pull request #1478 from marquiz/devel/code-gen
generate: update kube code-gen to v1.28.4
2023-11-30 14:54:33 +01:00
Markus Lehtonen
94bffbf645 generate: update kube code-gen to v1.28.4 2023-11-29 18:37:19 +02:00
Kubernetes Prow Robot
b087c602c0
Merge pull request #1476 from marquiz/devel/docs-tls
docs/tls: update cert-manager deployment instructions
2023-11-28 20:31:43 +01:00
Kubernetes Prow Robot
7fed71d8d9
Merge pull request #1475 from marquiz/devel/docs-wording-fix
docs: correct description of no-publish for topology-updater
2023-11-28 20:23:19 +01:00
Markus Lehtonen
c2b2353104 docs/tls: update cert-manager deployment instructions
Point to latest version of cert-manager. Let's keep this up-to-date even
if TLS support is deprecated and going away.
2023-11-28 21:00:03 +02:00
Markus Lehtonen
b78e82d7ee docs: correct description of no-publish for topology-updater
The nfd-topology-updater does not do "feature discovery" and does not
connect to nfd-master.
2023-11-28 20:01:38 +02:00
Kubernetes Prow Robot
dfef0ebe4a
Merge pull request #1472 from marquiz/devel/typo-fix
nfd-worker: fix typo in log message
2023-11-24 16:53:49 +01:00
Kubernetes Prow Robot
e0307301f6
Merge pull request #1474 from marquiz/devel/api-unit-tests
Use T.Run in expression unit tests
2023-11-24 16:32:04 +01:00
Markus Lehtonen
f266533a7d nfd-worker: fix typo in log message 2023-11-24 17:17:42 +02:00
Markus Lehtonen
f6c360188e Use T.Run in expression unit tests
The "better way" of running test cases, get e.g. better output in case
of errors.

Also drop some unneeded type definitions from the tests.
2023-11-24 17:14:12 +02:00
Kubernetes Prow Robot
ec9d649654
Merge pull request #1473 from marquiz/devel/fix-api-unit-test
Reproducible output from expression matching
2023-11-24 16:12:30 +01:00
Markus Lehtonen
f489ca98b5 Reproducible output from expression matching
Fix flakyness of unit tests by adding back the sorting of matched
feature elements that was unadvisedly removed in
63c22551df. This might help debugging some
corner cases in real-life scenarios (when using templating), too.
2023-11-24 16:27:38 +02:00
Kubernetes Prow Robot
ed8898de6a
Merge pull request #1461 from marquiz/devel/no-implicit-ns
Option to stop implicitly adding default prefix to names
2023-11-24 14:53:09 +01:00
Kubernetes Prow Robot
7154458524
Merge pull request #1468 from marquiz/devel/nfr-template-fix
apis/nfd: fix multiple matcher terms targeting the same feature
2023-11-24 13:20:49 +01:00
Markus Lehtonen
1d012a28cd Option to stop implicitly adding default prefix to names
Add new autoDefaultNs (default is "true") config option to nfd-master.
Setting the config option to false stops NFD from automatically adding
the "feature.node.kubernetes.io/" prefix to labels, annotations and
extended resources. Taints are not affected as for them no prefix is
automatically added. The user-visible part of enabling the option change
is that NodeFeatureRules, local feature files, hooks and configuration
of the "custom" may need to be altereda (if the auto-prefixing is
relied on).

For now, the config option defaults to "true", meaning no change in
default behavior. However, the intent is to change the default to
"false" in a future release, deprecating the option and eventually
removing it (forcing it to "false").

The goal of stopping doing "auto-prefixing" is to simplify the operation
(of nfd and users). Make the naming more straightforward and easier to
understand and debug (kind of WYSIWYG), eliminating peculiar corner
cases:

1. Make validation simpler and unambiguous
2. Remove "overloading" of names, i.e. the mapping two values to the
   same actual name. E.g. previously something like

      labels:
        feature.node.kubernetes.io/foo: bar
        foo: baz

   Could actually result in node label:

     feature.node.kubernetes.io/foo: baz

3. Make the processing/usagee of the "rule.matched" and "local.labels"
   feature in NodeFeatureRules unambiguous and more understadable. E.g.
   previously you could have node label
   "feature.node.kubernetes.io/local-foo: bar" but in the NodeFeatureRule
   you'd need to use the unprefixed name "local-foo" or the fully
   prefixed name, depending on what was specified in the feature file (or
   hook) on the node(s).

NOTE: setting autoDefaultNs to false is a breaking change for users who
rely on automatic prefixing with the default feature.node.kubernetes.io/
namespace. NodeFeatureRules, feature files, hooks and custom rules
(configuration of the "custom" source of nfd-worker) will need to be
altered.  Unprefixed labels, annoations and extended resources will be
denied by nfd-master.
2023-11-24 12:48:20 +02:00
Kubernetes Prow Robot
4e7f8b10be
Merge pull request #1471 from marquiz/devel/default-ns-fix
nfd-master: predictable handling of unprefixed names
2023-11-24 11:33:21 +01:00
Kubernetes Prow Robot
1497cc69a0
Merge pull request #1470 from marquiz/devel/nfd-master-refactor
nfd-master: drop stale variables
2023-11-24 11:09:07 +01:00
Markus Lehtonen
dc5af8be04 nfd-master: predictable handling of unprefixed names
Make the handling of unprefixed names (of labels, annotations and
extended resources) well-defined and predictable. Previously the
resulting output was not predictable in case the same name was coming in
both the unprefixed and prefixed form, say unprefixed "foo=bar" coming from
one source (be it nfd-worker or NodeFeature(Rule)) and
"feature.node.kubernetes.io/foo=baz" from a NodeFeature(Rule).
Previously the output value was randomly either "bar" or "baz".

This patch adds prefixes to all names early in the processing
"pipeline", preventing random name clashes later on.
2023-11-23 22:16:04 +02:00
Markus Lehtonen
678d7e89cb nfd-master: drop stale variables
Remove some stale variables that were leftover from the recent removal
of nfd version annotations.
2023-11-23 19:01:22 +02:00
Kubernetes Prow Robot
38ed148352
Merge pull request #1469 from marquiz/devel/fix-docs
docs: fix small typo in customization guide
2023-11-22 15:51:16 +01:00
Markus Lehtonen
36e431dd54 docs: fix small typo in customization guide 2023-11-22 10:45:45 +02:00
Markus Lehtonen
63c22551df apis/nfd: fix multiple matcher terms targeting the same feature
Fix NodeFeatureRule templating in cases where multiple matchFeatures
terms are targeting the same feature. Previously, only matched feature
elements from the last matcher terms were used as the input to the
template. However, the input should contain all matched elements from
all matcher terms.

For example, consider the example rule snippet below:

  ...
  labelsTemplate: |
    {{ range .pci.device }}vendor.io/pci-device.{{ .class }}-{{ .device }}=exists
    {{ end }}
  matchFeatures:
    - feature: pci.device
      matchExpressions:
        class: {op: InRegexp, value: ["^03"]}
        vendor: {op: In, value: ["1234"]}
    - feature: pci.device
      matchExpressions:
        class: {op: InRegexp, value: ["^12"]}

This rule matches if both a pci device of class 03 from vendor 1234
exists and a pci device of class 12 (from any vendor) exists.
Previously, the template would only generate labels from the devices in
class 12 (as that's the last term). With this patch the template creates
device labels from devices in both classes 03 and 12.
2023-11-22 10:43:52 +02:00
Kubernetes Prow Robot
62870968cd
Merge pull request #1460 from marquiz/devel/e2e-timeout
test/e2e: increase timeout for waiting node status
2023-11-21 12:05:05 +01:00
Kubernetes Prow Robot
371ed3ff21
Merge pull request #1458 from marquiz/devel/logging-fix
apis/nfd: fix logging of rule expression processing
2023-11-21 12:04:59 +01:00
Kubernetes Prow Robot
74c5780289
Merge pull request #1467 from marquiz/devel/api-comments
apis/nfd: fix incorrect comments of matching functions
2023-11-20 10:54:51 +01:00
Markus Lehtonen
9cbe742bfb apis/nfd: fix incorrect comments of matching functions
This patch updates the comments to correspond to the actual behavior
which was changed back in 36341bf4c7.
2023-11-20 10:11:35 +02:00
Kubernetes Prow Robot
c588371726
Merge pull request #1465 from marquiz/devel/deps
go.mod: bump kubernetes to v1.28.4
2023-11-16 12:45:33 +01:00
Markus Lehtonen
18fada0cfb test/e2e: increase timeout for waiting node status
In some occasions the node status (capacity) takes a lot of time to
update. Increase the timeout on extended resource tests. Revert the default
timeout back to 10s.
2023-11-16 13:26:09 +02:00
Markus Lehtonen
ffacd1535b go.mod: bump kubernetes to v1.28.4 2023-11-16 10:08:39 +02:00
Kubernetes Prow Robot
15f33c926e
Merge pull request #1463 from marquiz/devel/deps
go.mod: update deps
2023-11-14 17:35:50 +01:00