Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement kernel version detection #157

Merged
merged 2 commits into from
Oct 10, 2018

Conversation

marquiz
Copy link
Contributor

@marquiz marquiz commented Aug 23, 2018

Make it possible to advertise also other than simple 'true' values for
feature labels.

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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 23, 2018
@marquiz marquiz force-pushed the feature/kernel-version branch 3 times, most recently from 26cae36 to 715fec8 Compare September 27, 2018 13:09
@pmossakx
Copy link

Verified #149 and #157 on generic CentOS:

[root@pmossakx-centos node-feature-discovery]# git log -1
commit 6ebb52937fc810b327e3ed3844848483eb97d9fa
Merge: 05a8162 9994063
Author: Piotr Mossakowski <piotrx.mossakowski@intel.com>
Date:   Wed Sep 26 07:30:05 2018 +0000

    Merge remote-tracking branch 'origin/feature/os-release' into feature/kernel-version

[root@pmossakx-centos node-feature-discovery]# uname -r
4.4.156-1.el7.elrepo.x86_64

[root@pmossakx-centos node-feature-discovery]# cat /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)

[root@pmossakx-centos node-feature-discovery]# kubectl get node pmossakx-centos -o json | jq .metadata.labels
{
<output omitted>
  "node.alpha.kubernetes-incubator.io/nfd-kernel-version-full": "4.4.156-1.el7.elrepo.x86_64",
  "node.alpha.kubernetes-incubator.io/nfd-kernel-version-major": "4",
  "node.alpha.kubernetes-incubator.io/nfd-kernel-version-minor": "4",
  "node.alpha.kubernetes-incubator.io/nfd-kernel-version-revision": "156",
  "node.alpha.kubernetes-incubator.io/nfd-os-release-ID": "centos",
  "node.alpha.kubernetes-incubator.io/nfd-os-release-VERSION_ID": "7",
  "node.alpha.kubernetes-incubator.io/node-feature-discovery.version": "v0.2.0-10-g6ebb529"
}

and custom ubuntu kernel:

root@pmossakx-ubuntu:~/node-feature-discovery# git log -1
commit 27e6443e7eff65c8f275fb94bd87c0d3da30e9f4
Merge: 26cae36 089ca10
Author: Piotr Mossakowski <piotrx.mossakowski@intel.com>
Date:   Thu Sep 27 10:45:06 2018 +0100

    Merge remote-tracking branch 'origin/feature/os-release' into feature/kernel-version

root@pmossakx-ubuntu:~/node-feature-discovery# uname -r
4.18.0-pmossakx

root@pmossakx-ubuntu:~/node-feature-discovery# lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 18.04 LTS
Release:        18.04
Codename:       bionic

root@pmossakx-ubuntu:~/node-feature-discovery# kubectl get node pmossakx-ubuntu -o json | jq .metadata.labels
{
<output omitted>
  "node.alpha.kubernetes-incubator.io/nfd-kernel-version-full": "4.18.0-pmossakx",
  "node.alpha.kubernetes-incubator.io/nfd-kernel-version-major": "4",
  "node.alpha.kubernetes-incubator.io/nfd-kernel-version-minor": "18",
  "node.alpha.kubernetes-incubator.io/nfd-kernel-version-revision": "0",
  "node.alpha.kubernetes-incubator.io/nfd-os-release-ID": "ubuntu",
  "node.alpha.kubernetes-incubator.io/nfd-os-release-VERSION_ID": "18.04",
  "node.alpha.kubernetes-incubator.io/node-feature-discovery.version": "v0.2.0-15-g27e6443-dirty"
}

@pmossakx pmossakx mentioned this pull request Sep 27, 2018
@marquiz marquiz force-pushed the feature/kernel-version branch from 715fec8 to 26b3555 Compare October 2, 2018 08:20
@marquiz
Copy link
Contributor Author

marquiz commented Oct 2, 2018

Based on discussion in #140, I changed the label names so that there now is a dot (instead of dash) between version and the version component, i.e. we would now have:

nfd-kernel-version.full=X.Y.Z-patch
nfd-kernel-version.major=X
nfd-kernel-version.minor=Y
nfd-kernel-version.revision=Z

@lmdaly
Copy link

lmdaly commented Oct 8, 2018

Again LGTM with new naming convention!

Make it possible to advertise also other than simple 'true' values for
feature labels.
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.
@marquiz marquiz force-pushed the feature/kernel-version branch from ada254f to 3509a0c Compare October 10, 2018 09:43
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: marquiz

If they are not already assigned, you can assign the PR to them by writing /assign @marquiz in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@marquiz marquiz merged commit 86947fc into kubernetes-sigs:master Oct 10, 2018
@marquiz marquiz deleted the feature/kernel-version branch October 10, 2018 10:48
@marquiz marquiz mentioned this pull request Dec 12, 2018
10 tasks
ArangoGutierrez pushed a commit to ArangoGutierrez/node-feature-discovery that referenced this pull request Nov 18, 2020
Version 0.4.0

Node-feature-discovery was migrated into a new repository under the
kubernetes-sigs organization in Github (kubernetes-sigs#175). Related to the migration,
the final container image registry/repo hasn't been dediced yet (kubernetes-sigs#177) –
for this release we still use the old repo.

Major changes
- Split NFD into client and server (kubernetes-sigs#209)
- Changes in labels:
  - NFD label namespace was changed to 'feature.node.kubernetes.io/' (kubernetes-sigs#176)
    - 'nfd-' prefix was dropped from all feature labels
    - NFD version label
      (feature.node.kubernetes.io/node-feature-discovery.version) was
      replaced by an annotation (nfd.node.kubernetes.io/version)
  - network SRIOV labels were changed (kubernetes-sigs#173):
    - 'network-sriov' -> 'network-sriov.capable'
    - 'network-sriov-configured' -> 'network-sriov.configured'
  - selinux detection was moved to kernel feature source
    - 'selinux' -> 'kernel-selinux.enabled'
  - cpuid, pstate and RDT labels moved under cpu feature source (kubernetes-sigs#217)
    - 'cpuid-<cpuid flag>' -> 'cpu-cpuid.<cpuid flag>'
    - 'pstate-turbo' -> 'cpu-pstate.turbo'
    - 'rdt-<rdt feature>' -> 'cpu-rdt.<rdt feature>'
- Support for config file (kubernetes-sigs#169). Currently with three configurable
  feature sources i.e. cpu (kubernetes-sigs#224), kernel (kubernetes-sigs#157) and pci (kubernetes-sigs#168)
- Support for non-binary labels, with arbitrary values other than plain
  'true'
- PCI device detection (kubernetes-sigs#168)
- Kernel version detection (kubernetes-sigs#157)
- Kernel config option detection (kubernetes-sigs#146)
- Support for custom feature-detector hooks (kubernetes-sigs#144)
- Support OS version detection (kubernetes-sigs#149, kubernetes-sigs#211)
- Detection of hardware multithreading, such as Intel Hyper-Threading
  Technology (kubernetes-sigs#147)
- Arm64 support for CPUID detection (kubernetes-sigs#194)
- Validation of feature label names and values (kubernetes-sigs#199, kubernetes-sigs#219)
- Detection of NVDIMM devices (kubernetes-sigs#214)
- Get labels by reading from file in 'local' source (kubernetes-sigs#228)
- Detection of Intel SST-BF (Speed Select Technology - Base Frequency) (kubernetes-sigs#235)
- Make it possible to create feature labels in non-default namespace
  (kubernetes-sigs#231). Currently possible for using the local source (hooks and files).

Miscellaneous
- Template specs converted from json to yaml
- Documentation updates and fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants