3.5. NodeFeatureRule 사용자 정의 리소스 사용
규칙 세트가 조건에 맞는 경우 노드에 레이블을 지정하기 위해 NodeFeatureRule 객체를 생성합니다.
프로세스
다음 텍스트를 포함하는
nodefeaturerule.yaml이라는 사용자 지정 리소스 파일을 만듭니다.apiVersion: nfd.openshift.io/v1 kind: NodeFeatureRule metadata: name: example-rule spec: rules: - name: "example rule" labels: "example-custom-feature": "true" # Label is created if all of the rules below match matchFeatures: # Match if "veth" kernel module is loaded - feature: kernel.loadedmodule matchExpressions: veth: {op: Exists} # Match if any PCI device with vendor 8086 exists in the system - feature: pci.device matchExpressions: vendor: {op: In, value: ["8086"]}이 사용자 정의 리소스는
veth모듈이 로드되고 공급업체 코드8086이있는 PCI 장치가 클러스터에 있을 때 레이블이 지정됨을 지정합니다.다음 명령을 실행하여
nodefeaturerule.yaml파일을 클러스터에 적용합니다.$ oc apply -f https://raw.githubusercontent.com/kubernetes-sigs/node-feature-discovery/v0.13.6/examples/nodefeaturerule.yaml이 예제에서는
veth모듈이 로드된 노드에 기능 레이블을 적용하고 공급업체 코드가8086인 모든 PCI 장치가 존재합니다.참고최대 1분의 재라벨링 지연이 발생할 수 있습니다.