kubernetes-sigs / kubernetes-sigs/node-feature-discovery-operator

How to get custom rules working (NodeFeatureRule)

Open
#268 1 comment 0 reactions 0 assignees View on GitHub
kind/support lifecycle/stale
Dominant language
Go
Stars
78
Forks
33
PR merge metrics
No merged PRs in 30d

Description

I have installed nfd with argo:
```
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: node-feature-discovery-root
namespace: argocd
spec:
project: default
sources:
- repoURL: https://xxxx@dev.azure.com/xxxx/Azure%20K8s%20Config/_git/default-helm-charts-ARGO
targetRevision: main
path: node-feature-discovery
helm:
values: |
asd: asd
destination:
server: https://kubernetes.default.svc
namespace: node-feature-discovery
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
```

I have added a NodeFeatureRule:
```
apiVersion: nfd.k8s-sigs.io/v1alpha1
kind: NodeFeatureRule
metadata:
name: site-label
spec:
rules:
- name: site-ait
labels:
site: "ait"
matchFeatures:
- feature: kubernetes.label
matchExpressions:
kubernetes.io/hostname:
op: InRegexp
value:
- "^ait.*"

- name: site-bol
labels:
site: "bol"
matchFeatures:
- feature: kubernetes.label
matchExpressions:
kubernetes.io/hostname:
op: InRegexp
value:
- "^bol.*"
```

But nothing happens.
What I want to do is to label all nodes that have a hostname starting with for example bol (bolsrv1234) to be labeled site: bol.

Is there a helm value I have to configure to activate the NodeFeatureRule stuff?
Is there something wrong with the rule?

There are not errors or anything in the logs neither for master nor worker regarding this NodeFeatureRule.

Contributor guide

Open the contributing guide

Research direction

Start by checking the deployed node-feature-discovery Helm configuration and whether the NodeFeatureRule resource is installed and being processed. Compare the rule's kubernetes.label match against the node hostnames, then verify that matching nodes receive the site label and review the master and worker logs for processing details.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, helm, kubernetes
Domain
devops, infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.