diff --git a/deployment/components/worker-config/nfd-worker.conf.example b/deployment/components/worker-config/nfd-worker.conf.example index 967382ec4..eb5030bd5 100644 --- a/deployment/components/worker-config/nfd-worker.conf.example +++ b/deployment/components/worker-config/nfd-worker.conf.example @@ -76,41 +76,8 @@ # - "vendor" # - "device" # custom: -# - name: "my.kernel.feature" -# matchOn: -# - loadedKMod: ["example_kmod1", "example_kmod2"] -# - name: "my.pci.feature" -# matchOn: -# - pciId: -# class: ["0200"] -# vendor: ["15b3"] -# device: ["1014", "1017"] -# - pciId: -# vendor: ["8086"] -# device: ["1000", "1100"] -# - name: "my.usb.feature" -# matchOn: -# - usbId: -# class: ["ff"] -# vendor: ["03e7"] -# device: ["2485"] -# - usbId: -# class: ["fe"] -# vendor: ["1a6e"] -# device: ["089a"] -# - name: "my.combined.feature" -# matchOn: -# - pciId: -# vendor: ["15b3"] -# device: ["1014", "1017"] -# loadedKMod: ["vendor_kmod1", "vendor_kmod2"] -# - name: "feature.by.nodename" -# value: customValue -# matchOn: -# - nodename: ["worker-0", "my-.*-node"] -# # # The following feature demonstrates the capabilities of the matchFeatures -# - name: "my.ng.feature" +# - name: "my custom rule" # labels: # my-ng-feature: "true" # # matchFeatures implements a logical AND over all matcher terms in the @@ -181,7 +148,7 @@ # custom-feature-knob: {op: Gt, value: ["100"]} # # # The following feature demonstrates the capabilities of the matchAny -# - name: "my.ng.feature.2" +# - name: "my matchAny rule" # labels: # my-ng-feature-2: "my-value" # # matchAny implements a logical IF over all elements (sub-matchers) in @@ -205,7 +172,7 @@ # class: {op: In, value: ["02"]} # # # The following features demonstreate label templating capabilities -# - name: "my-template-test" +# - name: "my template rule" # labelsTemplate: | # {{ range .system.osrelease }}my-system-feature.{{ .Name }}={{ .Value }} # {{ end }} @@ -215,7 +182,7 @@ # ID: {op: InRegexp, value: ["^open.*"]} # VERSION_ID.major: {op: In, value: ["13", "15"]} # -# - name: "my-template-test-2" +# - name: "my template rule 2" # labelsTemplate: | # {{ range .pci.device }}my-pci-device.{{ .class }}-{{ .device }}=with-cpuid # {{ end }} @@ -253,3 +220,4 @@ # matchExpressions: # my.kernel.feature: {op: IsTrue} # my.dummy.var: {op: Gt, value: ["0"]} +# diff --git a/deployment/helm/node-feature-discovery/values.yaml b/deployment/helm/node-feature-discovery/values.yaml index 68ee75e3b..688a97c76 100644 --- a/deployment/helm/node-feature-discovery/values.yaml +++ b/deployment/helm/node-feature-discovery/values.yaml @@ -168,41 +168,8 @@ worker: # - "vendor" # - "device" # custom: - # - name: "my.kernel.feature" - # matchOn: - # - loadedKMod: ["example_kmod1", "example_kmod2"] - # - name: "my.pci.feature" - # matchOn: - # - pciId: - # class: ["0200"] - # vendor: ["15b3"] - # device: ["1014", "1017"] - # - pciId: - # vendor: ["8086"] - # device: ["1000", "1100"] - # - name: "my.usb.feature" - # matchOn: - # - usbId: - # class: ["ff"] - # vendor: ["03e7"] - # device: ["2485"] - # - usbId: - # class: ["fe"] - # vendor: ["1a6e"] - # device: ["089a"] - # - name: "my.combined.feature" - # matchOn: - # - pciId: - # vendor: ["15b3"] - # device: ["1014", "1017"] - # loadedKMod: ["vendor_kmod1", "vendor_kmod2"] - # - name: "feature.by.nodename" - # value: customValue - # matchOn: - # - nodename: ["worker-0", "my-.*-node"] - # # # The following feature demonstrates the capabilities of the matchFeatures - # - name: "my.ng.feature" + # - name: "my custom rule" # labels: # my-ng-feature: "true" # # matchFeatures implements a logical AND over all matcher terms in the @@ -273,7 +240,7 @@ worker: # custom-feature-knob: {op: Gt, value: ["100"]} # # # The following feature demonstrates the capabilities of the matchAny - # - name: "my.ng.feature.2" + # - name: "my matchAny rule" # labels: # my-ng-feature-2: "my-value" # # matchAny implements a logical IF over all elements (sub-matchers) in @@ -297,7 +264,7 @@ worker: # class: {op: In, value: ["02"]} # # # The following features demonstreate label templating capabilities - # - name: "my-template-test" + # - name: "my template rule" # labelsTemplate: | # {{ range .system.osrelease }}my-system-feature.{{ .Name }}={{ .Value }} # {{ end }} @@ -307,7 +274,7 @@ worker: # ID: {op: InRegexp, value: ["^open.*"]} # VERSION_ID.major: {op: In, value: ["13", "15"]} # - # - name: "my-template-test-2" + # - name: "my template rule 2" # labelsTemplate: | # {{ range .pci.device }}my-pci-device.{{ .class }}-{{ .device }}=with-cpuid # {{ end }} @@ -345,6 +312,7 @@ worker: # matchExpressions: # my.kernel.feature: {op: IsTrue} # my.dummy.var: {op: Gt, value: ["0"]} + # ### podSecurityContext: {} diff --git a/deployment/overlays/samples/custom-rules/custom-rules.example.yaml b/deployment/overlays/samples/custom-rules/custom-rules.example.yaml index 76b427468..3170d9566 100644 --- a/deployment/overlays/samples/custom-rules/custom-rules.example.yaml +++ b/deployment/overlays/samples/custom-rules/custom-rules.example.yaml @@ -1,7 +1,15 @@ -#- name: "more.kernel.features" -# matchOn: -# - loadedKMod: ["example_kmod3"] -#- name: "more.features.by.nodename" -# value: customValue -# matchOn: -# - nodename: ["special-.*-node-.*"] +- name: "kernel module rule" + labels: + "kernel-br_netfilter.present": "true" + matchFeatures: + - feature: "kernel.loadedmodule" + matchExpressions: + br_netfilter: {op: Exists} + +- name: "nodename rule" + labels: + "nodename-rule.matches": "true" + matchFeatures: + - feature: "system.name" + matchExpressions: + nodename: {op: InRegexp, value: ["special-.*-node"]}