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

2702 commits

Author SHA1 Message Date
Markus Lehtonen
da2cb07c64 Implement cpu feature source
Currently, it only detects one feature, i.e. hardware multithreading
(such as Intel hyper-threading technology). The corresponding feature
label is:
  feature.node.kubernetes.io/cpu-hardware_multithreading=true

However, this (architecture/platform dependent) feature is not detected
directly, and, the heuristics can be mislead. Detection works by
checking the thread siblings of each logical (and online) cpu in the
system. If any cpu has any thread siblings the feature label is set to
true. Thus, hardware multithreading could be effectively disabled e.g.
by putting all sibling cpus offline (even if the technology would be
enabled in hardware).
2018-12-07 16:58:09 +02:00
Markus Lehtonen
649d8a3ae1 Implement OS release detection
Implement new 'system' feature source. It now detects OS release
information from the os-release file, assumed to be available at
/host-etc/os-release. It currently creates two labels (assuming that the
corresponding fields are found in the os-release file), with example
values:
  feature.node.kubernetes.io/system-os_release.ID=opensuse
  feature.node.kubernetes.io/system-os_release.VERSION_ID=42.3

Also, update the template spec to mount /etc/os-release file from the
host inside the container.
2018-12-05 14:42:38 +02:00
Bin Lu
1ccd69e6e3 Add ARM64 support to cpuid
Signed-off-by: Bin Lu <bin.lu@arm.com>
2018-12-05 10:13:24 +02:00
Markus Lehtonen
93f4221d47 Correct project path in Glide config file
Changed when nfd repo was migrated to kubernetes-sigs org.
2018-12-04 22:27:54 +02:00
Markus Lehtonen
6f6deb6263 Refer to kubernetes-sigs in the documentation
Change links in README.md and RELEASE.md to point to the new repo
location under kubernetes-sigs. Also, remove some outdated references to
kubernetes incubator project.
2018-12-04 15:17:56 +02:00
Markus Lehtonen
47a97db35a Import from sigs.k8s.io/node-feature-discovery 2018-12-04 15:15:46 +02:00
Markus Lehtonen
a7764bfc82 Remove references to nfd version label from README
Annotations are used for this information, instead.
2018-12-04 15:13:12 +02:00
Markus Lehtonen
a1e60ba92b Remove 'nfd' label prefix from README and demos, too 2018-12-04 15:13:12 +02:00
Markus Lehtonen
4053010dd9 Make the kernel feature source configurable
Adding two config options:
- kernel config file to read
- kconfig options that are detected
2018-12-04 09:34:56 +02:00
Markus Lehtonen
ce129aef88 Implement kernel config detection
This implementation only detects kconfig options ("NO_HZ", "NO_HZ_IDLE",
"NO_HZ_FULL" and "PREEMPT"). The corresponding node labels will be
  node.alpha.kubernetes-incubator.io/nfd-kernel-config.<option name>

Currently, only bool and tristate (i.e. '=y' or '=m') kernel config
options are supported. Other kconfig types (e.g. string or int) are
simply ignored. If the kconfig flag is set to '=y' or '=m', the
corresponding node label will be present and it's value will be 'true'.
2018-12-04 09:34:56 +02:00
Markus Lehtonen
607e95f290 Makefile: drop docker build-args for https(s) proxy
Docker v17.07 and later supports configuring proxy servers via the
docker client configuration (https://docs.docker.com/network/proxy/).

This is better than using --build-args for passing the proxy settings to
the build environment. Previously, we could end up with empty variables
values which could cause the build to fail. E.g. if you had
http_proxy=<myproxy> defined but HTTP_PROXY unset in the host
environment, you ended up with http_proxy=<myproxy> and HTTP_PROXY=""
(i.e. empty value) inside the build which caused problems in some cases.
In addition, this makes builds via make and directly with docker more
similar.
2018-11-30 13:21:41 +02:00
Markus Lehtonen
5af04ca3f6 source/local: allow full control of label name
Make it possible for the hooks to fully define the label name to be used
(i.e. without the '<hook name>-' prefix) by prefixing the printed
feature names with a slash ('/'). This makes it possible to e.g.
override labels create by other sources.

For example having the following output from a hook:
/override_source-override_bool
/override_source-override_value=my value

will translate into the following feature labels:
feature.node.kubernetes.io/override_source-override_bool = true
feature.node.kubernetes.io/override_source-override_value = my value
2018-11-30 11:51:41 +02:00
Markus Lehtonen
4b066ed815 source/local: support non-binary labels
Make the feature detector hooks, run by the 'local' feature source,
support non-binary label values. Hooks can advertise non-binary value by
using <name>=<value> format.

For example, /etc/kubernetes/node-feature-discovery/source.d/myhook
having the following stdout:
LABEL_1
LABEL_2=foobar

Would translate into the following labels:
feature.node.kubernetes.io/myhook-LABEL_1 = true
feature.node.kubernetes.io/myhook-LABEL_2 = foobar
2018-11-30 11:51:41 +02:00
Markus Lehtonen
9474ef0815 Add validation for feature label names 2018-11-30 11:51:41 +02:00
Markus Lehtonen
a84b5c9d82 Support feature detector hooks
Implement a new feature source named 'local' whose only purpose is to
run feature source hooks found under
/etc/kubernetes/node-feature-discovery/source.d/ It tries to execute all
files found under the directory, in alphabetical order.

This feature source provides users a mechanism to implement custom
feature sources in a pluggable way, without modifying nfd source code or
Docker images.

The hooks are supposed to print all discovered features in stdout, one
feature per line. The output in stdout is used in the node label as is.
Full node label name will have the following format:
  feature.node.kubernetes.io/<hook name>-<feature name>
Stderr from the hooks is propagated to nfd log.
2018-11-30 11:51:41 +02:00
Markus Lehtonen
0259f0652a Drop 'nfd' prefix from the label names
No need for that anymore as annotations are used to keep track of labels
managed by nfd. This also makes the feature labels more generic with no
traces of the NFD project name. This makes way for "standardizing" the
node feature labels in a larger architectural scope, in case that was
something that would be pursued in the future.
2018-11-30 09:56:31 +02:00
Markus Lehtonen
15f8f4437b Store published label names in annotations
Add new 'nfd.node.kubernetes.io/feature-labels' annotation to store all
the feature labels added by NFD. This annotation is used by NFD by
cleaning up old labels when doing re-labeling.

In this scheme NFD does not need to rely on NFD-specific prefix in
feature label, and, is always able to reliably clean up old label.
2018-11-30 09:56:31 +02:00
Markus Lehtonen
81752b2df1 Refactor AddLabels() to add namespace
Makes sure all NFD labels are in the same namespace.
2018-11-30 09:56:31 +02:00
Markus Lehtonen
9e4aade6b8 Delete labels in the deprecated namespace
Remove labels in the old, deprecated,
node.alpha.kubernetes-incubator.io namespace. We want clean up the
deprecated labels when deploying new version of NFD.
2018-11-30 09:56:31 +02:00
Markus Lehtonen
035efad4ad Advertise NFD version as an Annotation instead of a Label
Add new 'nfd.node.kubernetes.io/version' annotation for advertising the
version of NFD that created the feature labels on the node. Introduces
new 'nfd.node.kubernetes.io' namespace that is supposed to be used by
all future NFD annotations. The old
'node.alpha.kubernetes-incubator.io/node-feature-discovery.version' is
dropped in favor of the new annotation.

Annotations are better suited for this kind of metadata. NFD version
should not be used for pod scheduling, especially because all the nodes
in the cluster should normally run the same version of NFD.
2018-11-30 09:56:31 +02:00
Markus Lehtonen
2cefd312a8 Change label namespace to feature.node.kubernetes.io 2018-11-30 09:56:31 +02:00
Obed N Munoz
6855953300 Update README.md documentation
This commit fixes demo video broken link (from png to svg image) and updates
link to `node-feature-discovery-job.yaml.template` file.

Signed-off-by: Obed N Munoz <obed.n.munoz@intel.com>
2018-11-16 11:20:21 +02:00
Markus Lehtonen
86947fc16b Implement kernel version detection
Add a new 'kernel' feature source, detecting the kernel version. The
kernel version is split into multiple labels in order to make this more
usable in label selectors. Kernel version in the format X.Y.Z-patch will
be presented as
  node.alpha.kubernetes-incubator.io/nfd-kernel-version.full=X.Y.Z-patch
  node.alpha.kubernetes-incubator.io/nfd-kernel-version.major=X
  node.alpha.kubernetes-incubator.io/nfd-kernel-version.minor=Y
  node.alpha.kubernetes-incubator.io/nfd-kernel-version.revision=Z

The '.full' label will always be avaiable. The other labels if these
components can be parsed from the kernel version number.
2018-10-10 13:21:49 +03:00
Markus Lehtonen
56c2ab3d58 Support for non-binary labels
Make it possible to advertise also other than simple 'true' values for
feature labels.
2018-10-10 13:21:49 +03:00
Markus Lehtonen
b0fedab786 sources/pci: make device label format configurable
Add new config option for specifying the device label, i.e. the
<device-label> part in
    node.alpha.kubernetes-incubator.io/nfd-pci-<device label>.present

The option is a list of field names:
    "class"             PCI device class
    "vendor"            Vendor ID
    "device"            Device ID
    "subsystem_vendor"  Subsystem vendor ID
    "subsystem_device"  Subsystem device ID

E.g. the following command line flag can be used to use all of the
above:
  --options='{"sources": {"pci": {"deviceLabelFields": ["class", "vendor", "device", "subsystem_vendor", "subsystem_device"] } } }'
2018-10-10 12:36:20 +03:00
Markus Lehtonen
b0d0797936 Add config support for the pci feature source
User can now configure the list of device classes to detect, either via
a configuration file or by using the --options command line flag.

An example of a command line flag to detect all network controllers and
("main class 0x02) and VGA display controllers ("main" class 0x03 and
subclass 0x00) would be:
  --options='{"sources": {"pci": {"deviceClassWhitelist": ["02", "0300"] } } }'
2018-10-10 12:36:20 +03:00
Markus Lehtonen
74d6993e9b Implement PCI feature source
This feature source detects the presence of PCI devices. At the moment,
it only advertises GPUs and accelerator cards, i.e. device classes 0x03,
0x0b40 and 0x12.

The label format is:
  node.alpha.kubernetes-incubator.io/nfd-pci-<device label>.present
where <device label> is composed of raw PCI IDs:
  <class id>_<vendor id>
2018-10-10 12:36:20 +03:00
Markus Lehtonen
244e049729 Make it possible to override config options from command line
Implement new '--options' command line flag that can be used to specify
config options from command line. Options specified via this command
line flag will override those read from the config file. The same format
as in the config file must be used, that is, the flag value must be
valid YAML or JSON.
2018-10-10 10:24:34 +03:00
Markus Lehtonen
917151728a Add config file support
Support yaml/json based config file for nfd. This commit does not add
any actual consumers for the config file, yet.

By default, nfd tries to read
/etc/kubernetes/node-feature-discovery/node-feature-discovery.conf.
This can be changed by specifying the --config command line flag.
2018-10-10 10:24:34 +03:00
Markus Lehtonen
4fa7ae38e3 network: rename sriov labels
Introduce a new scheme where features may have logical sub-components.
Rename sriov labels from the network source according to the new
pattern:
  sriov            -> sriov.capable
  sriov-configured -> sriov.configured

Also, document this new labeling scheme in the README.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2018-10-03 15:25:58 +03:00
Rui Cao
4bab607b82 Fix typo: suppported -> supported
Signed-off-by: Rui Cao <ruicao@alauda.io>
2018-10-02 17:14:03 +03:00
Markus Lehtonen
41f9a14a24
Convert templates and examples from json to yaml (#108)
Convert resource templates from json to yaml

Yaml is easier and less error prone to modify by hand. It also allows
comments which can be especially useful in the templates.
2018-09-27 14:54:45 +03:00
Markus Lehtonen
f8bea163de Update resource templates to use v0.3.0 2018-09-27 13:55:27 +03:00
Markus Lehtonen
f00f231c60 Use Debian strecth-slim as a base for the producion Docker image
To cut the image size further, down to about 75MB. We use Debian
strecth-slim as the base for the production image as golang docker
images use stretch as their base.
2018-09-24 10:15:23 +03:00
Markus Lehtonen
bff94eb107 Utilize multi-stage build to reduce docker image size
This reduces the size of the Docker image from ca. 1.2GB down to about
750MB.

Also, move unit tests from .travis.yml to Dockerfile. Final production
image is not able to run unit tests anymore, as sources are missing from
there.
2018-09-24 10:15:23 +03:00
Markus Lehtonen
1754ae0b65 Add install target to rdt-discovery Makefile 2018-09-24 10:15:23 +03:00
Markus Lehtonen
d394cf7ab3 Mention volume mounts in README
Add a note about required volume mounts when running NFD directly with
docker run.
2018-09-20 10:19:44 +03:00
Markus Lehtonen
ed5a259eaa Configurable image build tool
Make it possible to specify an image build tool other than docker - a
limitation is that the build tool must be compatible with docker files,
of course. This makes it possible to build an NFD image without the
Docker daemon, for example.

The image build command is specified in a makefile variable and can be
overridden from command line, for example:
$ make IMAGE_BUILD_CMD="buildah bud"

Thanks: Zvonko Kosic for suggesting this
2018-09-20 09:28:28 +03:00
Bin Lu
db929b878b Skip pstate detection on Arm
Signed-off-by: Bin Lu <bin.lu@arm.com>
2018-08-17 11:10:18 +03:00
Olev Kartau
aa36619baa label-nodes.sh: match Ready without side-strings (#151)
Counting nodes in Ready state was too fragile, matching
entries like:
Ready,SchedulingDisabled
NotReady
By requiring whitespace on both side, we accept only clean Ready.
2018-08-14 13:14:18 +03:00
Markus Lehtonen
175305b1ad Implement detection of IOMMU (#136) (#137)
* Arrange feature sources alphabetically

Just a cosmetic change, but, a small readability improvement.

* Implement detection of IOMMU (#136)

Add a new feature source, i.e. 'iommu', which detects if an IOMMU is
present and enabled in the kernel. The new node label is
  node.alpha.kubernetes-incubator.io/nfd-iommu-present
2018-07-24 08:24:45 -07:00
Olev Kartau
420baf3dce Add, correct some notes in documentation
A "newbie style" deployment attempt was made on a recent
cluster, and some added notes in README and in label-nodes.sh
could help someone who just started with node-feature-discovery.
Correcting also description of label-nodes.sh which does not
deal with unlabeled nodes as was promised in README.
2018-07-09 15:02:42 +03:00
Olev Kartau
4f4b0867b9 rdt-discovery, Dockerfile: update links to intel-cmt-cat
intel-cmt-cat repo is located in github/intel/ now,
update links accordingly, correcting also some
source file names pointed from files under rdt-discovery/.
Updated also ref. to intel-cmt-cat in Dockerfile.
No functional changes.
2018-07-03 08:19:54 +03:00
Markus Lehtonen
a410ed49fa
Merge pull request #124 from marquiz/release-0.2.0
Update the container image tags in the templates to v0.2.0
2018-06-25 23:40:41 +03:00
Markus Lehtonen
3de2a31f2e Update the container image tags in the templates to v0.2.0 2018-06-25 11:37:50 +03:00
Markus Lehtonen
f6f90da489 Add /sys mount to daemonset template (#134)
Needed by the selinux feature source.
2018-06-21 11:28:28 -07:00
Sakari Poussa
23a1e19635 Add RBAC policy (#126)
* Add rbac.yaml which contains needed rules for NFD to work on a RBAC
  enabled cluster
* Add lines to templates to use the RBAC policy
* Update README
2018-06-14 09:08:25 -07:00
Markus Lehtonen
52b143c5ee Update owners file (#107)
* Update hyperlink to owners documentation

* Add marquiz as approver in the OWNERS file
2018-06-05 10:20:51 -07:00
Olev Kartau
e984154090 Added more Intel RDT capability discovery: CMT,MBM,MBA (#120)
Added Memory Bandwith Allocation (MBA) capability discovery.
Refined RDT monitoring capability detection;
Cache Monitoring Technology (CMT) and
Memory Bandwidth Monitoring (MBM)
capabilities can be detected separately.
2018-05-24 16:49:00 -07:00
Markus Lehtonen
01e2110a5c Make it possible to run nfd as a DaemonSet (#105)
* Re-order imports in main.go alphabetically
* Refactor argument parsing
* Run nfd periodically in a loop by default
* Implement --sleep-interval command line option
* Add template for running nfd as a Kubernetes DaemonSet
2018-04-11 09:33:06 -07:00