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

618 commits

Author SHA1 Message Date
Marc Sluiter
7038e49d02
source/custom: Add nodename rule
There are cases when the only available metadata for discovering
features is the node's name. The "nodename" rule extends the custom
source and matches when the node's name matches one of the given
nodename regexp patterns.
It is also possible now to set an optional "value" on custom rules,
which overrides the default "true" label value in case the rule matches.
In order to allow more dynamic configurations without having to modify
the complete worker configuration, custom rules are additionally read
from a "custom.d" directory now. Typically that directory will be filled
by mounting one or more ConfigMaps.

Signed-off-by: Marc Sluiter <msluiter@redhat.com>
2021-02-24 16:26:35 +01:00
Kubernetes Prow Robot
3e00bfb2ae
Merge pull request #423 from adrianchiris/add-helm-chart
Add helm chart for NFD
2021-02-18 09:04:51 -08:00
Adrian Chiris
e80900b8ee Add helm chart for NFD
This commit adds Helm chart for node-feature-discovery

Signed-off-by: Adrian Chiris <adrianc@nvidia.com>
Signed-off-by: Ivan Kolodiazhnyi <ikolodiazhny@nvidia.com>
2021-02-18 17:19:09 +02:00
Kubernetes Prow Robot
ee16c19b14
Merge pull request #433 from marquiz/devel/config-core
nfd-worker: add core config
2021-02-17 13:10:51 -08:00
Markus Lehtonen
6b744d4179 nfd-worker: extend unit test coverage of config handling
Add test cases for verifying the core config.

Also, add asynchronous tests for basic verification of dynamic config
file updates.
2021-02-17 21:52:25 +02:00
Markus Lehtonen
2b24ed2c18 nfd-worker: implement Stop() method 2021-02-17 21:50:58 +02:00
Markus Lehtonen
278ccdb997 source/fake: make the fake source configurable
Enables more flexible testing.
2021-02-17 21:50:58 +02:00
Markus Lehtonen
d761bc4fcd docs: update documentation regarding configuration
Publish an incomplete version of the NFD Worker Configuration File
Reference, currently covering only the newly added 'core' configuration
flags.
2021-02-17 21:42:52 +02:00
Markus Lehtonen
c2c9dff724 nfd-worker: bail out on invalid config file
Changes the behaviour so that if the specified configuration file exists
it must be valid. Error out at startup if the config is invalid.
Similarly, exit with an error at runtime if the config file becomes
invalid. Bailing out, instead of just printing an error, was a
deliberate choice in order to make configuration mistakes evident.

Having no configuration file is tolerated, however. If the specified
configuration file does not exists nfd-worker resorts to default
settings.
2021-02-17 21:42:50 +02:00
Markus Lehtonen
7e88f00e05 nfd-worker: add core.sources config option
Add a config file option for controlling the enabled feature sources,
aimed at replacing the --sources command line flag which is now marked
as deprecated. The command line flag takes precedence over the config
file option.
2021-02-17 21:36:20 +02:00
Markus Lehtonen
ed177350fc nfd-worker: add core.labelWhiteList config option
Add a config file option for label whitelisting. Deprecate the
--label-whitelist command line flag. Note that the command line flag has
higher priority than the config file option.
2021-02-17 21:35:44 +02:00
Markus Lehtonen
d1d8de944e nfd-worker: add core.sleepInterval config option
Add a new config file option for (dynamically) controlling the sleep
interval. At the same time, deprecate the --sleep-interval command line
flag. The command line flag takes precedence over the config file option.
2021-02-17 21:35:13 +02:00
Markus Lehtonen
e6bdc17d8c nfd-worker: add core config
Allows dynamic (re-)configuration of most nfd-worker options. The goal
is to have most configuration parameters specified in the configuration
file and deprecate most of the command line flags. The priority is
intended to be such that command line flags override whatever is
specified in the configuration file. Thus, specifying something on the
command line effectively disables dynamic configurability of that
parameter.

This patch adds core.noPublish config file option to demonstrate how the
new mechanism is supposed to work. The --no-publish command line flag
takes precedence over this config file option.
2021-02-17 21:35:12 +02:00
Kubernetes Prow Robot
2960f63ae5
Merge pull request #441 from adrianchiris/add-reviewer
Update OWNERS file
2021-02-16 00:45:06 -08:00
Adrian Chiris
59cc16cbae Update OWNERS file
This commit proposes to add github user adrianchiris (me)
as reviewer to NFD.

I have been involved in several contributions to the project
as well as participation in code reviews and issues.

So, i propose to formalize this in the projects OWNERs file

Signed-off-by: Adrian Chiris <adrianc@nvidia.com>
2021-02-15 12:10:51 +00:00
Kubernetes Prow Robot
85bde7f749
Merge pull request #431 from marquiz/devel/master-instance-flag
nfd-master: implement --instance flag
2021-02-11 02:40:15 -08:00
Kubernetes Prow Robot
a8c7135eda
Merge pull request #432 from marquiz/devel/config-watch
nfd-worker: use fsnotify for watching for config file changes
2021-02-11 02:14:15 -08:00
Kubernetes Prow Robot
f4c928671c
Merge pull request #438 from ArangoGutierrez/1924426
Update gogo/protobuf and golang.org/x/text
2021-02-10 13:34:16 -08:00
Carlos Eduardo Arango Gutierrez
89e6a9104f
Update gogo/protobuf and golang.org/x/text
Why:

- CVE-2020-28851
- CVE-2021-3121

Signed-off-by: Carlos Eduardo Arango Gutierrez <carangog@redhat.com>
2021-02-10 16:13:51 -05:00
Markus Lehtonen
29910464a0 nfd-worker: always re-label after a re-config event
Always do re-discovery and re-labeling after a configuration file
change. his way the new config comes into effect immediately, even if
the sleep interval is long (or infinite) # Please enter the commit
message for your changes. Lines starting
2021-02-10 22:09:27 +02:00
Markus Lehtonen
b6ff514853 nfd-worker: use fsnotify for watching for config file changes
Add support for detecting configuration file changes via file system
notifications (fsnotify). Watches are added for the whole directory
chain (up to root directory) so that all changes (even directory
renames) affecting the given configuration file path are captured.

Previously dynamic (re-)configuration of nfd-worker was implemented by
(re-)reading the configuration file on every labeling pass. This was
simple and effective, even if a bit wasteful. However, it didn't provide
asynchronous configuration updates that will be required for e.g.
controlling the "sleep-interval" parameter dynamically which will be
implemented by later patches.
2021-02-10 22:09:27 +02:00
Markus Lehtonen
6958a6677f nfd-worker: use timer channel for sleep interval 2021-02-10 22:09:27 +02:00
Markus Lehtonen
e52ec3480f nfd-master: implement --instance flag
This can be used to help running multiple parallel NFD deployments in
the same cluster. The flag changes the node annotation namespace to
<instance>.nfd.node.kubernetes.io allowing different nfd-master intances
to store metadata in separate annotations.
2021-02-10 13:48:31 +02:00
Markus Lehtonen
705687192d nfd-master: make updateNodeFeatures a method of nfdMaster 2021-02-10 13:46:59 +02:00
Markus Lehtonen
cdca6d667a nfd-master: make nodeName non-global 2021-02-10 13:46:59 +02:00
Markus Lehtonen
b146508e64 nfd-master: drop separate labelerServer type
Simplify code by changing nfdMaster to implement LabelerServer interface
by itself.
2021-02-10 13:46:59 +02:00
Kubernetes Prow Robot
01384d434f
Merge pull request #435 from marquiz/fixes/filepath
Replace improper usage of filepath.Join with path.Join
2021-02-10 03:44:59 -08:00
Kubernetes Prow Robot
fbde30a164
Merge pull request #436 from marquiz/devel/golangci-lint
scripts/test-infra: update golangci-lint to v1.36.0
2021-02-10 03:36:59 -08:00
Markus Lehtonen
44b52b69be scripts/test-infra: update golangci-lint to v1.36.0 2021-02-10 12:58:44 +02:00
Markus Lehtonen
76b95b6c55 Replace improper usage of filepath.Join with path.Join
In JSON and kubernetes API object names we want to use slashes instead
of the OS dependent file path separator.
2021-02-10 12:54:31 +02:00
Kubernetes Prow Robot
f0513eeda0
Merge pull request #434 from marquiz/devel/template-auto-update
Change the worker conf update mechanism of templates
2021-02-04 13:20:52 -08:00
Markus Lehtonen
569e0f2017 Change the worker conf update mechanism of templates
Rely on markers instead which makes the update work also in the middle
of a template file. Previously it relied on the configuration data to be
at the very end of the file to be updated.
2021-02-04 18:56:55 +02:00
Kubernetes Prow Robot
5094eadedc
Merge pull request #430 from marquiz/devel/templates-pull-policy
Set imagePullPolicy in the deployment templates to Always
2021-02-03 09:46:28 -08:00
Markus Lehtonen
040604eeb4 Set imagePullPolicy in the deployment templates to Always
Update prepare-release.sh so that the policy will be set to IfNotPresent
for releases.
2021-02-03 18:26:54 +02:00
Kubernetes Prow Robot
4af5311880
Merge pull request #421 from mythi/cpuid-v2.0.1
go.mod: update to klauspost/cpuid/v2@v2.0.2
2020-12-15 06:51:48 -08:00
Mikko Ylinen
07bc50d5a8 go.mod: update to klauspost/cpuid/v2@v2.02
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-12-15 15:56:15 +02:00
Kubernetes Prow Robot
8be8d1b6db
Merge pull request #420 from marquiz/documentation/readme
README: update references to v0.7.0
2020-12-14 11:47:48 -08:00
Markus Lehtonen
5912177a03 README: update references to v0.7.0 2020-12-08 10:25:35 +02:00
Kubernetes Prow Robot
288b1869c1
Merge pull request #419 from marquiz/fixes/gh-pages
github: workflow fixes
2020-12-07 08:39:26 -08:00
Markus Lehtonen
30e3d0b8b9 github: switch to checkout v1
V2 handles tags incorrectly
(https://github.com/actions/checkout/issues/290) and the easiest
solution is to simply switch to v1.
2020-12-07 12:35:05 +02:00
Markus Lehtonen
ee02dd7033 scripts/update-gh-pages: add more details when stopping 2020-12-07 12:34:50 +02:00
Kubernetes Prow Robot
b59293c18b
Merge pull request #416 from ArangoGutierrez/cp-415
Cherry-pick: github: update new-release issue template
2020-12-04 10:15:59 -08:00
Markus Lehtonen
16acc2b433
github: update new-release issue template 2020-12-04 13:00:11 -05:00
Kubernetes Prow Robot
8aa9460e66
Merge pull request #406 from mythi/cpuid-v2.0
go.mod: update klauspost/cpuid
2020-12-04 06:21:59 -08:00
Kubernetes Prow Robot
c624c88b10
Merge pull request #412 from marquiz/devel/prune
Add namespace and RBAC rules to nfd-prune.yaml.template
2020-12-03 05:41:00 -08:00
Kubernetes Prow Robot
24937bbed6
Merge pull request #411 from marquiz/documentation/uninstall
docs: more options in uninstallation instructions
2020-12-03 04:50:59 -08:00
Markus Lehtonen
c7e66d910f Add namespace and RBAC rules to nfd-prune.yaml.template
Makes it possible to run prune on its own. Reflect this change in the
documentation.
2020-12-03 14:41:54 +02:00
Markus Lehtonen
d2bfa3c39b docs: more options in uninstallation instructions 2020-12-03 14:36:42 +02:00
Kubernetes Prow Robot
9ea5329ab6
Merge pull request #409 from marquiz/fixes/gh-pages-2
scripts/update-gh-pages: fix generated commit message
2020-12-03 04:18:59 -08:00
Kubernetes Prow Robot
1d021d02b8
Merge pull request #410 from marquiz/fixes/templates
Fix auto-generation of nfd-prune.yaml
2020-12-03 03:57:00 -08:00