3.5. 使用 NodeFeatureRule 自定义资源
如果一组规则与条件匹配,创建一个 NodeFeatureRule
对象来标记节点。
流程
创建名为
nodefeaturerule.yaml
的自定义资源文件,其中包含以下文本:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 此自定义资源指定在加载
veth
模块且集群中存在厂商代码8086
的任何 PCI 设备时发生标记。运行以下命令,将
nodefeaturerule.yaml
文件应用到集群:oc apply -f https://raw.githubusercontent.com/kubernetes-sigs/node-feature-discovery/v0.13.6/examples/nodefeaturerule.yaml
$ oc apply -f https://raw.githubusercontent.com/kubernetes-sigs/node-feature-discovery/v0.13.6/examples/nodefeaturerule.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 这个示例在载入了
veth
模块的节点上应用 feature 标签,以及存在厂商代码8086
的任何 PCI 设备。注意可能会出现最多 1 分钟的重新标记延迟。