Added NodeFeatureRule to automatically add network adapter label to nodes
This commit is contained in:
parent
4058ff5287
commit
2d0ded00eb
|
@ -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
|
4
infra/node-feature-discovery-rules/kustomization.yaml
Normal file
4
infra/node-feature-discovery-rules/kustomization.yaml
Normal file
|
@ -0,0 +1,4 @@
|
|||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- ./network-adapter.yaml
|
16
infra/node-feature-discovery-rules/network-adapter.yaml
Normal file
16
infra/node-feature-discovery-rules/network-adapter.yaml
Normal 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"]
|
Loading…
Reference in New Issue
Block a user