Node Feature Discovery

# Deployment with Kustomize

## Table of contents

Kustomize provides easy deployment of NFD. Customization of the deployment is done by maintaining declarative overlays on top of the base overlays in NFD.

To follow the deployment instructions here, kubectl v1.21 or later is required.

The kustomize overlays provided in the repo can be used directly:

    kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.14.0

This will required RBAC rules and deploy nfd-master (as a deployment) and nfd-worker (as daemonset) in the `node-feature-discovery` namespace.

> NOTE: nfd-topology-updater is not deployed as part of the `default` overlay. Please refer to the Master Worker Topologyupdater and Topologyupdater below.

Alternatively you can clone the repository and customize the deployment by creating your own overlays. For example, to deploy the minimal image. See kustomize for more information about managing deployment configurations.

## Overlays

The NFD repository hosts a set of overlays for different usages and deployment scenarios under `deployment/overlays`

- `default`: default deployment of nfd-worker as a daemonset, described above
- `default-combined` see Master-worker pod below
- `default-job`: see Worker one-shot below
- `master-worker-topologyupdater`: see Master Worker Topologyupdater below
- `topologyupdater`: see Topology Updater below
- `Metrics`: see Metrics below
- `prune`: clean up the cluster after uninstallation, see Removing feature labels
- `samples/cert-manager`: an example for supplementing the default deployment with cert-manager for TLS authentication, see Automated TLS certificate management using cert-manager for details
- `samples/custom-rules`: an example for spicing up the default deployment with a separately managed configmap of custom labeling rules, see Custom feature source for more information about custom node labels

### Master-worker pod

You can also run nfd-master and nfd-worker inside the same pod

    kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default-combined?ref=v0.14.0

This creates a DaemonSet that runs nfd-worker and nfd-master in the same Pod. In this case no nfd-master is run on the master node(s), but, the worker nodes are able to label themselves which may be desirable e.g. in single-node setups.

> NOTE: nfd-topology-updater is not deployed by the default-combined overlay. To enable nfd-topology-updater in this scenario,the users must customize the deployment themselves.

### Worker one-shot

Feature discovery can alternatively be configured as a one-shot job. The `default-job` overlay may be used to achieve this:

    NUM_NODES=$(kubectl get no -o jsonpath='{.items[*].metadata.name}' | wc -w)
    kubectl kustomize https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default-job?ref=v0.14.0 | \
        sed s"/NUM_NODES/$NUM_NODES/" | \
        kubectl apply -f -

The example above launches as many jobs as there are non-master nodes. Note that this approach does not guarantee running once on every node. For example, tainted, non-ready nodes or some other reasons in Job scheduling may cause some node(s) will run extra job instance(s) to satisfy the request.

### Master Worker Topologyupdater

NFD-Master, nfd-worker and nfd-topology-updater can be configured to be deployed as separate pods. The `master-worker-topologyupdater` overlay may be used to achieve this:

    kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/master-worker-topologyupdater?ref=v0.14.0

### Topologyupdater

In order to deploy just nfd-topology-updater (without nfd-master and nfd-worker) use the `topologyupdater` overlay:

    kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref=v0.14.0

NFD-Topology-Updater can be configured along with the `default` overlay (which deploys nfd-worker and nfd-master) where all the software components are deployed as separate pods;

    kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.14.0
    kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/topologyupdater?ref=v0.14.0

### Metrics

To allow prometheus operator to scrape metrics from node-feature-discovery, run the following command:

    kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.14.0
    kubectl apply -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/prometheus?ref=v0.14.0

## Uninstallation

Simplest way is to invoke `kubectl delete` on the overlay that was used for deployment. Beware that this will also delete the namespace that NFD is running in. For example, in case the default overlay from the repo was used:

    kubectl delete -k https://github.com/kubernetes-sigs/node-feature-discovery/deployment/overlays/default?ref=v0.14.0

Alternatively you can delete create objects one-by-one, depending on the type of deployment, for example:

    NFD_NS=node-feature-discovery
    kubectl -n $NFD_NS delete ds nfd-worker
    kubectl -n $NFD_NS delete deploy nfd-master
    kubectl -n $NFD_NS delete svc nfd-master
    kubectl -n $NFD_NS delete sa nfd-master
    kubectl delete clusterrole nfd-master
    kubectl delete clusterrolebinding nfd-master

Node Feature Discovery
v0.14

Versions

GitHub
  Homepage
  Issues
  Download

This Software is under the terms of Apache License 2.0.