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

148 commits

Author SHA1 Message Date
Kubernetes Prow Robot
15f0cea172
Merge pull request #888 from marquiz/devel/k8s-1.25
Update kubernetes to v1.25.0
2022-09-13 08:17:05 -07:00
Markus Lehtonen
f21315d85f Update kubernetes registry to registry.k8s.io
Update registry location for non-nfd images.
2022-09-12 11:23:04 +03:00
Markus Lehtonen
c09225f75c test/e2e: drop utils/kubeletconfig.go
The required fix is in kubernetes v1.25.0 so we can drop this local
copy.
2022-09-09 10:55:03 +03:00
Markus Lehtonen
449b0b2199 go.mod: update kubernetes to v1.25.0 2022-09-09 10:55:03 +03:00
Francesco Romani
d70f8c65af test: utils: borrow fixed GetKubeletConfig from k/k
We need this fix https://github.com/kubernetes/kubernetes/pull/110875
to have reliable tests, but up until we can bump the k/k deps to 1.25+,
we can't consume it.

So borrow it from k/k repo for the time being.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2022-08-11 08:53:01 +02:00
Francesco Romani
7d37f72480 e2e: add basic topology updater test
Co-authored-by: Swati Sehgal <swsehgal@redhat.com>
Co-authored-by: Francesco Romani <fromani@redhat.com>
Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2022-08-11 08:53:01 +02:00
Francesco Romani
622adf3863 test: e2e: configurable pull policy
In some cases (CI) it is useful to run NFD e2e tests using
ephemeral clusters. To save time and bandwidth, it is also useful
to prime the ephemeral cluster with the images under test.

In these circumstances there is no risk of running a stale image,
and having a `Always` PullPolicy hardcoded actually makes
the whole exercise null.

So we add a new option, disabled by default, to make the e2e
manifest use the `IfNotPresent` pull policy, to effectively
cover this use case.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2022-08-10 15:06:59 +02:00
Markus Lehtonen
190e3200b1 test/e2e: refactor setup and cleanup 2022-08-09 20:14:41 +03:00
Artyom Lukianov
e169edcb9f Move helpers method to the separate package
Co-Authored-By Francesco Romani <fromani@redhat.com>
Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2022-08-09 13:47:52 +02:00
Kubernetes Prow Robot
3df81d1ace
Merge pull request #827 from marquiz/devel/drop-iommu
Drop the iommu source
2022-07-08 02:01:47 -07:00
Markus Lehtonen
380936e417 test/e2e: change node-specific config to a list
Change the part of the e2e-test configuration that contains
node-specific expected labels and annotations to a list, instead of a
map. This makes the parsing order deterministic and makes it possible to
e.g. have a default at the end of the list that captures "all the rest".
2022-06-30 23:34:22 +03:00
Markus Lehtonen
b8ab0d8a9e test/e2e: update e2e-test example config
Add feature labels that have been added lately.
2022-06-30 14:21:38 +03:00
Markus Lehtonen
60fdad684b test/e2e: fix checking of nfd-master annotation
The test was broken twofold: Firstly, the annotation was not checked at
all because the name of the node where nfd-master is running was not
set. Secondly, the annotation prefix was used incorrectly.
2022-06-29 20:51:26 +03:00
Markus Lehtonen
136c036d4d Drop the iommu source
It was deprecated in v0.10.0.
2022-06-14 15:00:29 +03:00
Markus Lehtonen
d1bd603052 go.mod: bump kubernetes to v1.23.1
Update k/k to the latest release and sync all related dependencies.

Align e2e-tests with changes in the k8s e2e test framework.
2022-01-12 16:43:21 +02:00
Markus Lehtonen
3468e65387 test/e2e: revise usage of nfd command line flags
Use the "single-dash" notation of flags and replace deprecated -sources
with -label-sources.
2021-12-03 10:18:57 +02:00
Markus Lehtonen
f7b2bcc457 Revert "test/e2e: drop /boot mount"
This reverts commit 261ab113bf.
2021-11-23 10:50:20 +02:00
Kubernetes Prow Robot
67330e1441
Merge pull request #644 from marquiz/devel/e2e-boot-mount
test/e2e: drop /boot mount
2021-11-10 11:13:27 -08:00
Markus Lehtonen
261ab113bf test/e2e: drop /boot mount
This is not currently needed by end-to-end tests. Dropping it enables
testing in restricted environments that don't have /boot directory.
2021-11-10 20:58:25 +02:00
Markus Lehtonen
0161bd5ca4 test/e2e: make e2e tests run on single-node cluster
Lift the restriction to run custom rule tests on non-master node. Try to
find one but do not fail if that fails. Makes the end-to-end tests
runnable on single-node clusters such a simple minikube deployments.
2021-11-10 20:33:55 +02:00
Francesco Romani
b4c92e4eed topologyupdater: Bootstrap nfd-topology-updater in NFD
- This patch allows to expose Resource Hardware Topology information
  through CRDs in Node Feature Discovery.
- In order to do this we introduce another software component called
  nfd-topology-updater in addition to the already existing software
  components nfd-master and nfd-worker.
- nfd-master was enhanced to communicate with nfd-topology-updater
  over gRPC followed by creation of CRs corresponding to the nodes
  in the cluster exposing resource hardware topology information
  of that node.
- Pin kubernetes dependency to one that include pod resource implementation
- This code is responsible for obtaining hardware information from the system
  as well as pod resource information from the Pod Resource API in order to
  determine the allocatable resource information for each NUMA zone. This
  information along with Costs for NUMA zones (obtained by reading NUMA distances)
  is gathered by nfd-topology-updater running on all the nodes
  of the cluster and propagate NUMA zone costs to master in order to populate
  that information in the CRs corresponding to the nodes.
- We use GHW facilities for obtaining system information like CPUs, topology,
  NUMA distances etc.
- This also includes updates made to Makefile and Dockerfile and Manifests for
  deploying nfd-topology-updater.
- This patch includes unit tests
- As part of the Topology Aware Scheduling work, this patch captures
  the configured Topology manager scope in addition to the Topology manager policy.
  Based on the value of both attribues a single string will be populated to the CRD.
  The string value will be on of the following {SingleNUMANodeContainerLevel,
  SingleNUMANodePodLevel, BestEffort, Restricted, None}

Co-Authored-by: Artyom Lukianov <alukiano@redhat.com>
Co-Authored-by: Francesco Romani <fromani@redhat.com>
Co-Authored-by: Talor Itzhak <titzhak@redhat.com>
Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2021-09-21 10:47:39 +01:00
Markus Lehtonen
c3760fbbab nfd-master: rename LabelNs to FeatureLabelNs 2021-08-10 19:13:08 +03:00
Markus Lehtonen
34050596d7 test/e2e: adapt e2e tests to kubernetes v1.21.2
Mimic SIGDescribe() from upstream k8s e2e tests.
2021-07-06 14:40:29 +03:00
Jan Schintag
5871207588 Mount /usr/lib and /usr/src inside the Pod
Mount /usr/lib and /usr/src as /host-usr/lib and /host-usr/src inside the pod
to allow NFD to search for the kernel configuration file inside /usr.
This solves the problem of the kernel config file not being present in /boot
on s390x RHCOS.

Signed-off-by: Jan Schintag <jan.schintag@de.ibm.com>
2021-04-26 16:47:37 +02:00
Markus Lehtonen
7e6f740c9f test/e2e: make openshift bits optional
Only enabled if OPENSHIFT is specified in the environment when running
make e2e-test, for example:

  $ OPENSHIFT=y make e2e-test
2021-02-25 17:54:07 +02:00
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
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
bb1e4c60fb nfd-master: use namespaced label and annotation names internally
For historical reasons the labels in the default nfd namespace have been
internally represented without the namespace part. I.e. instead of
"feature.node.kubernetes.io/foo" we just use "foo". NFD worker uses this
representation, too, both internally and over the gRPC requests. The
same scheme has been used for annotations.

This patch changes NFD master to use fully namespaced label and
annotation names internally. This hopefully makes the code a bit more
understandable. It also addresses some corner cases making the handling
of label names consistent, making it possible to use both "truncated"
and fully namespaced names over the gRPC interface (and in the
annotations).
2020-11-24 12:45:06 +02:00
Markus Lehtonen
0512b06027 test/e2e: fix e2e-config node matching
Pick the correct rule when multiple node rules are present.
2020-11-24 11:35:35 +02:00
Carlos Eduardo Arango Gutierrez
f18884d6fb
Fix a thing or two under test
This patch fix typo in a file name
Updates default image on e2e tests
Adds an extra file that should be ignored to gitignore

Use master instead of versioned tag for default test image
2020-11-20 09:22:29 -05:00
Kubernetes Prow Robot
e850dfce5e
Merge pull request #340 from marquiz/devel/e2e
test/e2e: interpret node names in config as regexps
2020-11-19 13:32:51 -08:00
Markus Lehtonen
0d47a04e3e test/data: update test certs
Make them use SAN (Subject Alternative Name) instead of CN (Common Name)
field. Makes them compatible with golang 1.15 TLS.
2020-11-18 15:54:20 +02:00
Artyom Lukianov
f363ba0e92 Update e2e test to work with updated dependencies
Signed-off-by: Artyom Lukianov <alukiano@redhat.com>
2020-11-18 13:09:13 +02:00
Markus Lehtonen
87c412c48e test/e2e: interpret node names in config as regexps
Interpret node names in the e2e test config as regexps instead of plain
strings. This makes it a lot easier to maintain a config file where
multiple nodes share configuration.
2020-10-22 21:46:29 +03:00
Markus Lehtonen
331f56ecc3 test/e2e: drop hostNetwork from worker pod spec
We don't need or use that anymore.
2020-05-25 16:37:38 +03:00
Markus Lehtonen
ff2c30a63c test/e2e: slightly more informative test output 2020-05-25 16:37:27 +03:00
Markus Lehtonen
00ccbe95bb test/e2e: fail faster waiting on master pod
Reduce timeout from the default 5 minutes to one minute. Error out
faster e.g. if accidentally trying to test a non-existing image.
2020-05-25 13:16:56 +03:00
Markus Lehtonen
2f4e038f10 test/e2e: drop dot imports
Make linter happy.
2020-05-20 21:48:06 +03:00
Markus Lehtonen
73602e8f28 test/e2e: goling fixes 2020-05-20 21:48:06 +03:00
Markus Lehtonen
409dc11389 Switch to sigs.k8s.io/yaml
Replace github.com/ghodss/yaml.
2020-04-23 16:54:14 +03:00
Markus Lehtonen
3d5866a06d test/e2e: more comprehensive per-node testing
Implement an end-to-end test with all feature sources enabled. The new
test runs nfd-worker as a daemonset on all (schedulable) nodes of the
test cluster which makes it possible to cover a wide range features,
assuming the test cluster is heterogenous containing nodes with varying
system configurations.

The features available depends on the node(s) the e2e testa are run on.
Thus, some runtime parameterization of the tests is needed. The patch
adds a new command line test flag 'nfd.e2e-config' that is used to
specify the per-node feature labels and annotations that is expected to
be present in the cluster. An example configuration file is provided
with the patch. The pod spec of nfd-worker deployment is changed to
better correspond the default deployment and thus enable wider feature
discovery. This means using hostnetwork and adding mounts for /sys /boot
and /etc/os-release.

The patch changes node object management so that all nfd-related labels
are removed after each test (not just the ones the test is expected to
add). Also, all nfd-related annotations are now removed.
2020-02-28 10:37:26 +02:00
Markus Lehtonen
54eaf16871 nfd-master: export label and annotation prefixes
In order to be able to use the constants in end-to-end tests.
2020-02-27 14:21:00 +02:00
Markus Lehtonen
974310251c test/e2e: adapt new wireframe to nfd context
Adapt the end-to-end test wireframe (copied from Kubernetes in the
previous commit) to node-feature-discovery.
2020-02-05 19:35:41 +02:00
Markus Lehtonen
e263c95adc test/e2e: re-copy e2e wireframe from Kubernetes
Sync with Kubernetes. Copy a wireframe for end-to-end tests directly
from Kubernetes v1.17.2.
2020-02-05 17:12:11 +02:00
Markus Lehtonen
0911de1978 Add simple e2e test
Tests that nfd master-worker communication works and that the worker is
able to label the node with the labels from the 'fake' source.

An example of running the test suite with a custom image with user's
kubeconfig:
$ go test ./test/e2e/ -args -nfd.repo=<image-repo> -nfd.tag=<image-tag> \
            -kubeconfig=$HOME/.kube/config

Partly based on some previous work done by Balaji Subramaniam.
2019-06-25 09:50:29 +03:00
Markus Lehtonen
9065c7adbe Add empty e2e test stub
Patch the (Kubernetes) e2e wireframe introduced in the previous commit with some minor
modifications, dropping some bits in order to simplify the code.

Also adds a dummy test stub for node feature discovery.
2019-06-25 09:50:29 +03:00
Markus Lehtonen
b284b2f42b Copy e2e wireframe from Kubernetes
Copy E2E wireframe directly from Kubernetes v1.13.5.
2019-06-25 09:50:29 +03:00
Markus Lehtonen
35d26001e4 nfd-worker: extend unit test to cover 'main'
Also, adds new method WaitForReady() into NfdMaster.

In practice, this quite widely tests nfd-master, too, as the tests
create an instance of NfdMaster and verify that the communication
between master and worker works.
2019-05-06 16:26:41 +03:00