Developer Preview This feature is currently in developer preview and subject to change. It is not recommended to use it in production environments.
The kubectl
plugin kubectl nfd
can be used to validate/dryrun and test NodeFeatureRule objects. It can be installed with the following command:
git clone https://github.com/kubernetes-sigs/node-feature-discovery
cd node-feature-discovery
make build-kubectl-nfd
KUBECTL_PATH=/usr/local/bin/
mv ./bin/kubectl-nfd ${KUBECTL_PATH}
The plugin can be used to validate a NodeFeatureRule object:
kubectl nfd validate -f <nodefeaturerule.yaml>
The plugin can be used to test a NodeFeatureRule object against a node:
kubectl nfd test -f <nodefeaturerule.yaml> -n <node-name>
The plugin can be used to DryRun a NodeFeatureRule object against a NodeFeature file:
kubectl get -n node-feature-discovery nodefeature <nodename> -o yaml > <nodefeature.yaml>
kubectl nfd dryrun -f <nodefeaturerule.yaml> -n <nodefeature.yaml>
Or you can use the example NodeFeature file(it is a minimal NodeFeature file):
$ kubectl nfd dryrun -f examples/nodefeaturerule.yaml -n examples/nodefeature.yaml
Evaluating NodeFeatureRule "examples/nodefeaturerule.yaml" against NodeFeature "examples/nodefeature.yaml"
Processing rule: my sample rule
*** Labels ***
vendor.io/my-sample-feature=true
NodeFeatureRule "examples/nodefeaturerule.yaml" is valid for NodeFeature "examples/nodefeature.yaml"