Added NodeFeatureRule to automatically add network adapter label to nodes

This commit is contained in:
Dreaded_X 2025-02-26 03:27:54 +01:00
parent 4058ff5287
commit 2d0ded00eb
Signed by: Dreaded_X
GPG Key ID: FA5F485356B0D2D4
3 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,14 @@
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: node-feature-discovery-rules
namespace: flux-system
spec:
interval: 15m
path: ./infra/node-feature-discovery-rules
prune: true
timeout: 2m
sourceRef:
kind: GitRepository
name: flux-system
wait: true

View File

@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ./network-adapter.yaml

View File

@ -0,0 +1,16 @@
apiVersion: nfd.k8s-sigs.io/v1alpha1
kind: NodeFeatureRule
metadata:
name: network-adapter
spec:
rules:
- name: "Network interface label"
labelsTemplate: |
{{ range .network.device }}network-adapter={{ .name }}
{{ end }}
matchFeatures:
- feature: network.device
matchExpressions:
"name":
op: InRegexp
value: ["enp.s0"]