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

40 commits

Author SHA1 Message Date
Markus Lehtonen
b27676451a nfd-master: prevent crash on empty config struct
Change the handling of LabelWhiteList config option to use a pointer to
detect when the option is unset. This doesn't fix any detected crash but
is merely general improvement and stabilization, serving easier testing.

Also, use the regexp type from the core libs for the config struct -
dropping the unmasrhalling code for our custom regexp type - as the core
regexp now implements unmarshaller itself.
2024-04-05 14:19:44 +03:00
Kubernetes Prow Robot
797fada92e
Merge pull request #1585 from kannon92/add-swap-support
add swap support in nfd
2024-03-18 04:19:48 -07:00
Carlos Eduardo Arango Gutierrez
06c4733bc5
Add FeatureGate framework to handle new features
Code inspired on https://github.com/kubernetes/component-base/tree/master/featuregate

Signed-off-by: Carlos Eduardo Arango Gutierrez <eduardoa@nvidia.com>
2024-03-15 19:11:32 +01:00
Kevin Hannon
187f65f94e Add swap support in nfd 2024-02-19 10:20:56 -05:00
Markus Lehtonen
53003cbf69 pkg/utils: move JsonPatch from pkg/apihelper 2024-01-25 17:23:14 +02:00
Markus Lehtonen
acf815fb10 pkg/utils: move GetKubeconfig from pkg/apihelper here
This change is part of an effort to remove the pkg/apihelper package.
GetKubeconfig is useful helper functionality shared accross the codebase
so move it into a "safe" location.
2024-01-24 16:10:02 +02:00
Markus Lehtonen
57b7a3c6a8 Wrap nested errors 2024-01-22 22:45:15 +02:00
Markus Lehtonen
cb0a46ec0e Use generics for maps and slices 2023-12-13 12:09:53 +02:00
Markus Lehtonen
5171ae0f90 Refactor metrics
Move common boilerplate code under pkg/utils.
2023-10-09 10:49:12 +03:00
AhmedGrati
7ab6314bdc chore: introduce a commong klog handling for cmd/nfd-*
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-09-07 22:38:15 +01:00
lizhun
a4ad3d4411 fix empty hugepages in some numa nodes caused no such file or directory error
Signed-off-by: lizhun <lizhun@kylinos.cn>
2023-08-08 15:14:44 +08:00
Markus Lehtonen
bf670de68d pkg/utils: migrate KlogDump to structured logging
Drop the KlogDump helper in favor of klog.InfoS. However, that patch
introduces a new DelayedDumper() helper to avoid processing
(marshalling) of object unless really evaluated by the logging function.
2023-05-31 14:43:08 +03:00
Markus Lehtonen
4947ebf336 pkg/util: migrate to structured logging
We gRPC logging interface is not compatible with structured logging so
grpcLogger is left intact.
2023-05-31 14:43:08 +03:00
AhmedGrati
7917434d38 feat: add master resync period configurability
This PR adds a config option for setting the NFD API controller resync period.
The resync period is only activated when the NodeFeature API has been
enabled (with -enable-nodefeature-api).

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-04-24 11:52:38 +02:00
Kubernetes Prow Robot
8d71ed6755
Merge pull request #1086 from AhmedGrati/feat-support-builtin-kernel-mods
feat: support builtin kernel mods
2023-04-13 10:30:40 -07:00
AhmedGrati
109caa1f28 feat: support builtin kernel mods
This PR adds the combination of dynamic and builtin kernel modules into
one feature called `kernel.enabledmodule`. It's a superset of the
`kernel.loadedmodule` feature.

Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-04-13 10:19:24 +01:00
Markus Lehtonen
4a8fc811be pkg/utils: add UnmarshalJSON method to StringSetVal
Make it possible to specify values in yaml as an array like

  conf:
    - foo
    - bar

Instead of unwieldy map like

  conf:
    foo:
    bar:
2023-03-14 10:53:24 +02:00
Kubernetes Prow Robot
a92614c292
Merge pull request #1051 from AhmedGrati/feat-add-deny-label-ns-with-wildcard
feat: add deny-label-ns flag which supports wildcard
2023-02-15 03:42:25 -08:00
AhmedGrati
b499799364 feat: add deny-label-ns flag which supports wildcard
Signed-off-by: AhmedGrati <ahmedgrati1999@gmail.com>
2023-02-15 09:47:00 +01:00
PiotrProkop
f76fc5bf6b Read Kubelet configuration the same way as Kubelet to apply default values
Signed-off-by: PiotrProkop <pprokop@nvidia.com>
2023-02-15 09:27:25 +01:00
Markus Lehtonen
aa97105854 Add common utility function for getting node name 2022-12-23 09:50:15 +02:00
Markus Lehtonen
87b92f88ca nfd-worker: detect the namespace it is running in
Implement detection of kubernetes namespace by reading file
/var/run/secrets/kubernetes.io/serviceaccount/namespace

Aa a fallback (if the file is not accessible) we take namespace from
KUBERNETES_NAMESPACE environment variable. This is useful for e.g.
testing and development where you might run nfd-worker directly from the
command line on a host system.
2022-12-08 10:34:52 +02:00
Garrybest
3ec1b94020 get kubelet config from configz
Signed-off-by: Garrybest <garrybest@foxmail.com>
2022-11-08 23:52:35 +08:00
Feruzjon Muyassarov
71434a1392 Standardize "k8s.io/api/core/v1" package short name
Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
2022-10-15 02:22:41 +03:00
Markus Lehtonen
a00cdc2b61 pkg/utils: move hostpath helpers from source to utils
Refactor the code, moving the hostpath helper functionality to new
"pkg/utils/hostpath" package. This breaks odd-ish dependency
"pkg/utils" -> "source".
2022-10-06 14:28:24 +03:00
Markus Lehtonen
12e859d50c Drop deprecated io/ioutil package
Makes golanci-lint happy.
2022-09-08 14:26:02 +03:00
Markus Lehtonen
f9b4ba87a8 tls: require min TLS version 1.3
Deny deprecated TLS versions (1.0 and 1.1). We don't really excpect
other clients than NFD itself so we can just request the latest version.
2022-02-25 10:08:37 +02:00
Artyom Lukianov
a93b660f7c utils: add methods to fetch NUMA nodes hugepages and memory capacity
The methods are used during calculation of reserved memory for system workloads.
The calcualation is `resourceCapacity - resourceAllocatable`.

Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2021-11-04 10:14:51 +02:00
Markus Lehtonen
99d223b029 utils/dump: do not print empty header line
Makes log output cleaner.
2021-06-11 09:29:49 +03:00
Kubernetes Prow Robot
c0e1000a7d
Merge pull request #474 from marquiz/devel/worker-log-verbosity
nfd-worker: don't log labels returned by sources by default
2021-03-15 12:52:34 -07:00
Kubernetes Prow Robot
03f53d85e9
Merge pull request #475 from marquiz/devel/grpc-klog
pkg/utils: show correct source file in gRPC logs
2021-03-11 06:20:24 -08:00
Markus Lehtonen
fb67a5027b pkg/utils: show correct source file in gRPC logs
Unwind two call frames so that the source (file:line) of the log message
is correctly displayed.
2021-03-11 11:36:55 +02:00
Markus Lehtonen
8d67fc1122 pkg/utils: add dump functions
A simple functions for pretty-printing and logging json-marshallable objects.
2021-03-11 07:12:22 +02:00
Markus Lehtonen
e771a35a21 nfd-master: support certificate rotation
Add a helper/wrapper in pkg/utils to handle gRPC server-side certificate
rotation.
2021-03-09 14:40:04 +02:00
Markus Lehtonen
dfc2596a22 pkg/utils: generalize file watcher
Add the capability to watch multiple files. Move it to a separate
package in order to make it reusable.
2021-03-09 14:20:34 +02:00
Markus Lehtonen
8af3a40ca7 logging: set grpc to use klog for logging 2021-03-05 14:44:44 +02:00
Markus Lehtonen
38d493aa67 pkg/utils: fix possible segfault in RegexpVal.Set 2021-03-02 22:46:34 +02:00
Markus Lehtonen
3f18e880b4 nfd-worker: dynamic configuration of klog
Make it possible to dynamically (at run-time) alter most of the logging
configuration from the config file.
2021-02-25 16:10:43 +02:00
Markus Lehtonen
3fd61eacdb nfd-worker: switch to flag in command line parsing 2021-02-24 12:06:16 +02:00
Markus Lehtonen
47033db9c1 nfd-master: use flag for command line parsing 2021-02-24 12:06:16 +02:00