Code Monkey home page Code Monkey logo

cluster-nfd-operator's Introduction

Node Feature Discovery Operator

The Cluster Node Feature Discovery operator manages detection of hardware features and configuration in a Openshift cluster. The operator orchestrates all resources needed to run the NFD DaemonSet

Upstream Project

Node Feature Discovery โ€“ a Kubernetes add-on for detecting hardware features and system configuration.

The Node Feature Discovery and Node Feature Discovery operator are Upstream projects under the kubernetes-Sigs organization

Getting started with the Node Feature Discovery Operator

Prerequisite: a running OpenShift cluster 4.6+

Get the source code

git clone https://github.com/openshift/cluster-nfd-operator

Deploy the operator

IMAGE_REGISTRY=quay.io/<your-personal-registry>
make image push deploy

Create a NodeFeatureDiscovery instance

oc apply -f config/samples/nfd.openshift.io_v1_nodefeaturediscovery.yaml

Verify

The Operator will deploy NFD based on the information on the NodeFeatureDiscovery CR instance, after a moment you should be able to see

$ oc -n openshift-nfd get ds,deploy
NAME                        DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
daemonset.apps/nfd-worker   3         3         3       3            3           <none>          5s
NAME                         READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/nfd-master   1/1     1            1           17s

Check that NFD feature labels have been created

$ oc get node -o json | jq .items[].metadata.labels
{
  "beta.kubernetes.io/arch": "amd64",
  "beta.kubernetes.io/os": "linux",
  "feature.node.kubernetes.io/cpu-cpuid.ADX": "true",
  "feature.node.kubernetes.io/cpu-cpuid.AESNI": "true",
  "feature.node.kubernetes.io/cpu-cpuid.AVX": "true",
...

Extending NFD with sidecar containers and hooks

First see upstream documentation of the hook feature and how to create a correct hook file: https://github.com/kubernetes-sigs/node-feature-discovery#local-user-specific-features.

The DaemonSet running on the workers will mount the hostPath: /etc/kubernetes/node-feature-discovery/source.d. Additional hooks can than be provided by a sidecar container that is as well running on the workers and mounting the same hostpath and writing the hook executable (shell-script, compiled code, ...) to this directory.

NFD will execute any file in this directory, if one needs any configuration for the hook, a separate configuration directory can be created under /etc/kubernetes/node-feature-discovery/source.d e.g. /etc/kubernetes/node-feature-discovery/source.d/own-hook-conf, NFD will not recurse deeper into the file hierarchy.

Building NFD operator for ARM locally

There 2 options:

  1. Using ARM server - process is the same, but you should use Dockerfile.arm instead of Dockerfile
  2. Using x86 server/laptop - process is the same but before running build command, Makefile.arm should be copied into Makefile

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.