Added NodeFeatureRule to automatically add network adapter label to nodes

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

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"]