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

1461 commits

Author SHA1 Message Date
Markus Lehtonen
1938f9fd87 README: update to latest release v0.12.0 2022-12-21 16:10:14 +02:00
Markus Lehtonen
59a2757115 Use single-dash format for nfd cmdline flags
Use the "single-dash" version of nfd command line flags in deployment
files and e2e-tests. No impact in functionality, just aligns with
documentation and other parts of the codebase.
2022-12-21 15:00:49 +02:00
Kubernetes Prow Robot
14d0e67ee0
Merge pull request #1011 from marquiz/fixes/docs
docs: fix typo in CRD name
2022-12-21 03:47:25 -08:00
Markus Lehtonen
8c0e38d0c5 docs: fix typo in CRD name 2022-12-21 13:42:10 +02:00
Kubernetes Prow Robot
6fb444cd84
Merge pull request #1009 from marquiz/documentation/nodefeature
docs: mention NodeFeature as an extension point
2022-12-21 03:35:28 -08:00
Markus Lehtonen
b91922746a docs: mention NodeFeature as an extension point
In the CRD intro, mention that NodeFeature can be used as an integration
point for 3rd party extensions.
2022-12-21 13:26:31 +02:00
Kubernetes Prow Robot
e50839e950
Merge pull request #1008 from marquiz/devel/release-template
github: update new-release issue template
2022-12-21 00:29:25 -08:00
Markus Lehtonen
30e7c24795 github: update new-release issue template
Add instructions about creating prow jobs for new release branches.
2022-12-21 10:24:48 +02:00
Kubernetes Prow Robot
921316a4c2
Merge pull request #1006 from marquiz/documentation/deployment
docs: better document differences between deployment methods
2022-12-20 11:17:20 -08:00
Markus Lehtonen
27c47bd088 docs: better document differences between deployment methods 2022-12-20 16:29:48 +02:00
Kubernetes Prow Robot
c551a9a89b
Merge pull request #1005 from marquiz/devel/e2e-lint
Simplify usage of ObjectMeta fields
2022-12-19 08:01:45 -08:00
Markus Lehtonen
f5ae3fe2c7 Simplify usage of ObjectMeta fields
No need to explicitly spell out ObjectMeta as it's embedded in the
object types.
2022-12-19 17:40:10 +02:00
Kubernetes Prow Robot
e2296998d6
Merge pull request #1001 from marquiz/devel/e2e-nodefeature
test/e2e: add basic e2e-tests for NodeFeature API
2022-12-19 07:19:44 -08:00
Markus Lehtonen
b67d6d7282 test/e2e: add basic e2e-tests for NodeFeature API
Add an initial test set for the NodeFeature API. This is done simply by
running a second pass of the tests but with -enable-nodefeature-api
(i.e. NodeFeature API enabled and gRPC disabled). This should give basic
confidence that the API actually works and form a basis for further
imporovements on testing the new CRD API.
2022-12-19 16:58:21 +02:00
Markus Lehtonen
958db56680 test/e2e: isolate tests into a separate function
Preparation for running the same tests with NodeFeature API enabled
(instead of gRPC).
2022-12-19 14:08:05 +02:00
Kubernetes Prow Robot
e684197634
Merge pull request #932 from fmuyassarov/e2e-taints
Add E2E test for NFD tainting feature
2022-12-19 03:59:45 -08:00
Feruzjon Muyassarov
3e29f5c5df Add nfd E2E tests for tainting feature
Extend current E2E tests to check tainting feature of nfd implemented
in https://github.com/kubernetes-sigs/node-feature-discovery/pull/910

Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
2022-12-19 13:39:03 +02:00
Kubernetes Prow Robot
4635b99832
Merge pull request #1003 from marquiz/devel/e2e-host-usr-src
test/e2e: drop host-usr-src mount
2022-12-19 02:35:45 -08:00
Kubernetes Prow Robot
28a5daa338
Merge pull request #999 from marquiz/fixes/nodefeature-missing
nfd-master: update node if no NodeFeature objects are present
2022-12-19 00:39:44 -08:00
Markus Lehtonen
4c955ad72c nfd-master: update node if no NodeFeature objects are present
Correctly handle the case where no NodeFeature objects exist for certain
node (and NodeFeature API has been enabled with
-enable-nodefeature-api). In this case all the labels should be removed.
2022-12-19 10:22:04 +02:00
Kubernetes Prow Robot
c250a8bea8
Merge pull request #1004 from marquiz/fixes/e2e
test/e2e: don't expect control-plane nodes to be labeled
2022-12-17 00:11:41 -08:00
Markus Lehtonen
51f4c5447b test/e2e: don't expect control-plane nodes to be labeled
Without this e2e tests may fail in clusters with control-plane-only
nodes.
2022-12-16 22:56:19 +02:00
Kubernetes Prow Robot
941a55ae0b
Merge pull request #998 from marquiz/fixes/nodefeature-crd-startup
nfd-master: update all nodes at startup when NodeFeature API enabled
2022-12-16 05:06:20 -08:00
Kubernetes Prow Robot
87c1a3d47d
Merge pull request #1002 from marquiz/devel/e2e-podsecurity
test/e2e: drop pod security enforcement label from the test namespace
2022-12-15 23:01:37 -08:00
Kubernetes Prow Robot
8d2adfd1f5
Merge pull request #996 from fmuyassarov/parametirize-image
E2E: parameterize container image and tag
2022-12-15 08:35:37 -08:00
Markus Lehtonen
7b2add434c test/e2e: drop pod security enforcement label from the test namespace
Drop the pod-security.kubernetes.io/enforce label from the test
namespace, i.e. remove pod security admission enforcement. NFD-worker
uses restricted host mounts (/sys) etc so pod creation fails even in
privileged mode if pod security admission enforcement is enabled.
2022-12-15 17:43:44 +02:00
Markus Lehtonen
fd0b812433 test/e2e: drop host-usr-src mount
Allows running e2e-tests in some more restricted environments.
2022-12-15 16:49:27 +02:00
Kubernetes Prow Robot
a193098513
Merge pull request #903 from marquiz/devel/nodefeature-crd
docs: document NodeFeature API
2022-12-14 13:05:36 -08:00
Kubernetes Prow Robot
323fd5c6ec
Merge pull request #995 from fmuyassarov/seccomp-profile-nfd-worker
E2E: default seccompProfile to runtimeDefault for nfd worker
2022-12-14 12:45:34 -08:00
Markus Lehtonen
3209c14bea docs: document NodeFeature API
Document the usage of the NodeFeature CRD API. Also re-organize the
documentation a bit, moving the description of NodeFeatureRule
controller from customization guide to nfd-master usage page.
2022-12-14 22:33:12 +02:00
Kubernetes Prow Robot
33e44d53b9
Merge pull request #1000 from marquiz/fixes/e2e
test/e2e: fix mistake in ginkgo focus
2022-12-14 12:19:34 -08:00
Markus Lehtonen
f04e1a9404 test/e2e: fix mistake in ginkgo focus
Leftover from development that got accidentally merged in
43910e6925
2022-12-14 21:59:15 +02:00
Markus Lehtonen
b9c09e6674 nfd-master: update all nodes at startup when NodeFeature API enabled
We want to always update all nodes at startup. Without this patch we
don't get any update event from the controller if no NodeFeature or
NodeFeatureRule objects exist in the cluster. Thus all nodes would stay
untouched whereas we really want to remove all labels from all nodes in
this case.
2022-12-14 21:49:50 +02:00
Kubernetes Prow Robot
a36f6a6409
Merge pull request #997 from marquiz/devel/e2e-crd-creation
test/e2e: create CRDs once in the beginning of the tests
2022-12-14 11:49:35 -08:00
Markus Lehtonen
43910e6925 test/e2e: create CRDs once in the beginning of the tests
Only generate CRDs once in the beginning of the test run. Use the "Ordered"
option for the test container so that we can utilize ginkgo.BeforeAll to
only do stuff once before the first test. Changing from unordered to
ordered shouldn't make a big difference here.

Add a cleanup function to remove stale NodeFeatureRule objects that are
cluster-scoped and not deleted with the test namespace.
2022-12-14 18:42:00 +02:00
Kubernetes Prow Robot
d1b314842c
Merge pull request #989 from marquiz/devel/nodefeature-multi-object
nfd-master: handle multiple NodeFeature objects
2022-12-14 07:51:34 -08:00
Kubernetes Prow Robot
586bf7eefe
Merge pull request #994 from fmuyassarov/config-defaulting
E2E: default kubeconfig location to ${HOME}/.kube/config
2022-12-14 07:29:35 -08:00
Feruzjon Muyassarov
5d08f1cd7c E2E:parameterize container image and tag
Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
2022-12-14 17:16:03 +02:00
Feruzjon Muyassarov
39813e7a73 E2E: default kubeconfig location to ${HOME}/.kube/config
Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
2022-12-14 17:09:08 +02:00
Feruzjon Muyassarov
ae8ba01c2c E2E: default seccompProfile to runtimeDefault for nfd worker
Use RuntimeDefault seccomp profile in nfd worker and topology
updater pod spec similar to nfd master.

Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
2022-12-14 17:04:38 +02:00
Kubernetes Prow Robot
019383848e
Merge pull request #990 from marquiz/devel/nodefeature-ratelimit
nfd-master: implement ratelimiter for nfd api updates
2022-12-14 06:07:34 -08:00
Markus Lehtonen
740e3af681 nfd-master: implement ratelimiter for nfd api updates
Implement a naive ratelimiter for node update events originating from
the nfd API. We might get a ton of events in short interval. The
simplest example is startup when we get a separate Add event for every
NodeFeature and NodeFeatureRule object. Without rate limiting we
run "update all nodes" separately for each NodeFeatureRule object, plus,
we would run "update node X" separately for each NodeFeature object
targeting node X. This is a huge amount of wasted work because in
principle just running "update all nodes" once should be enough.
2022-12-14 15:45:43 +02:00
Markus Lehtonen
79ed747be8 nfd-master: handle multiple NodeFeature objects
Implement handling of multiple NodeFeature objects by merging all
objects (targeting a certain node) into one before processing the data.
This patch implements MergeInto() methods for all required data types.

With support for multiple NodeFeature objects per node, The "nfd api
workflow" can be easily demonstrated and tested from the command line.
Creating the folloiwing object (assuming node-n exists in the cluster):

    apiVersion: nfd.k8s-sigs.io/v1alpha1
    kind: NodeFeature
    metadata:
      labels:
        nfd.node.kubernetes.io/node-name: node-n
      name: my-features-for-node-n
    spec:
      # Features for NodeFeatureRule matching
      features:
        flags:
          vendor.domain-a:
            elements:
              feature-x: {}
        attributes:
          vendor.domain-b:
            elements:
              feature-y: "foo"
              feature-z: "123"
        instances:
          vendor.domain-c:
            elements:
            - attributes:
                name: "elem-1"
                vendor: "acme"
            - attributes:
                name: "elem-2"
                vendor: "acme"
      # Labels to be created
      labels:
        vendor-feature.enabled: "true"
        vendor-setting.value: "100"

will create two feature labes:

    feature.node.kubernetes.io/vendor-feature.enabled: "true"
    feature.node.kubernetes.io/vendor-setting.value: "100"

In addition it will advertise hidden/raw features that can be used for
custom rules in NodeFeatureRule objects. Now, creating a NodeFeatureRule
object:

    apiVersion: nfd.k8s-sigs.io/v1alpha1
    kind: NodeFeatureRule
    metadata:
      name: my-rule
    spec:
      rules:
        - name: "my feature rule"
          labels:
            "my-feature": "true"
          matchFeatures:
            - feature: vendor.domain-a
              matchExpressions:
                feature-x: {op: Exists}
            - feature: vendor.domain-c
              matchExpressions:
                vendor: {op: In, value: ["acme"]}

will match the features in the NodeFeature object above and cause one
more label to be created:

    feature.node.kubernetes.io/my-feature: "true"
2022-12-14 15:44:52 +02:00
Kubernetes Prow Robot
ee0807da66
Merge pull request #993 from marquiz/fixes/e2e
test/e2e: fix creation of NFD CRDs
2022-12-14 05:37:35 -08:00
Markus Lehtonen
13f3959ebe test/e2e: fix creation of NFD CRDs
After introducing NodeFeatureRule we packed two CRD definitions in one
yaml file. Our e2e-tests were not prepared to that and the file itself
was also renamed so it couldn't even be read by the test suite.

With this change the e2e-tests start to create NodeFeatre CRD in the
test cluster, preparing for the addition of e2e-tests for NodeFeature
API.
2022-12-14 14:44:17 +02:00
Kubernetes Prow Robot
e10957009b
Merge pull request #992 from marquiz/fixes/enable-nodefeature-flag
nfd-master: fix creation of the -enable-nodefeature-api flag
2022-12-14 03:37:34 -08:00
Kubernetes Prow Robot
cb7e8ac583
Merge pull request #991 from marquiz/devel/nodefeature-flag-rename
nfd-master: rename -featurerules-controller flag to -crd-controller
2022-12-14 03:15:33 -08:00
Markus Lehtonen
81b0945ced nfd-master: fix creation of the -enable-nodefeature-api flag
Extra dash caused a panic when trying to run the binary.
2022-12-14 12:51:14 +02:00
Markus Lehtonen
9f0806593d nfd-master: rename -featurerules-controller flag to -crd-controller
Deprecate the '-featurerules-controller' command line flag as the name
does not describe the functionality anymore: in practice it controls the
CRD controller handling both NodeFeature and NodeFeatureRule objects.
The patch introduces a duplicate, more generally named, flag
'-crd-controller'. A warning is printed in the log if
'-featurerules-controller' flag is encountered.
2022-12-14 10:23:45 +02:00
Kubernetes Prow Robot
8a153c12cf
Merge pull request #986 from marquiz/devel/nodefeature-crd-base
Introduce NodeFeature CRD
2022-12-14 00:17:34 -08:00