ce7cb702218693d08ea6d83464d2457c9250027c

This commit is contained in:
ms2k 2026-11-12 20:46:28 +09:00
commit 34c5f8963c
4 changed files with 145336 additions and 0 deletions

View file

@ -0,0 +1,48 @@
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: nfd
namespace: nfd
spec:
interval: 15m
releaseName: nfd
targetNamespace: nfd
chart:
spec:
chart: node-feature-discovery
sourceRef:
kind: HelmRepository
name: nfd-oci
namespace: flux-system
install:
createNamespace: true
remediation:
retries: 3
upgrade:
remediation:
retries: 3
values:
master:
replicaCount: 2
extraLabelNs:
- nvidia.com
resources:
limits:
memory: 512Mi
requests:
cpu: 10m
memory: 128Mi
worker:
config:
sources:
pci:
deviceClassWhitelist:
- "03"
deviceLabelFields:
- vendor
resources:
limits:
memory: 512Mi
requests:
cpu: 5m
memory: 64Mi

View file

@ -0,0 +1,6 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- helm-release.yaml
- network-policies.yaml

View file

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: nfd

View file

@ -0,0 +1,139 @@
---
# NFD master: apiserver, metrics from host.
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: nfd-master
namespace: nfd
spec:
endpointSelector:
matchLabels:
app.kubernetes.io/name: node-feature-discovery
role: master
ingress:
- fromEntities:
- host
toPorts:
- ports:
- port: "8080"
protocol: TCP
- fromEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: nfd
toPorts:
- ports:
- port: "8081"
protocol: TCP
egress:
- toEntities:
- kube-apiserver
toPorts:
- ports:
- port: "6443"
protocol: TCP
- toEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: kube-system
k8s-app: kube-dns
toPorts:
- ports:
- port: "53"
protocol: UDP
- port: "53"
protocol: TCP
---
# NFD worker: reports to master, apiserver, metrics from host.
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: nfd-worker
namespace: nfd
spec:
endpointSelector:
matchLabels:
app.kubernetes.io/name: node-feature-discovery
role: worker
ingress:
- fromEntities:
- host
toPorts:
- ports:
- port: "8080"
protocol: TCP
egress:
- toEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: nfd
role: master
toPorts:
- ports:
- port: "8081"
protocol: TCP
- toEntities:
- kube-apiserver
toPorts:
- ports:
- port: "6443"
protocol: TCP
- toEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: kube-system
k8s-app: kube-dns
toPorts:
- ports:
- port: "53"
protocol: UDP
- port: "53"
protocol: TCP
---
# Host egress to NFD pods (metrics).
apiVersion: cilium.io/v2
kind: CiliumClusterwideNetworkPolicy
metadata:
name: host-egress-nfd
spec:
nodeSelector: {}
egress:
- toEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: nfd
toPorts:
- ports:
- port: "8080"
protocol: TCP
---
# NFD GC: only needs apiserver.
apiVersion: cilium.io/v2
kind: CiliumNetworkPolicy
metadata:
name: nfd-gc
namespace: nfd
spec:
endpointSelector:
matchLabels:
app.kubernetes.io/name: node-feature-discovery
role: gc
ingress:
- fromEntities:
- host
toPorts:
- ports:
- port: "8080"
protocol: TCP
egress:
- toEntities:
- kube-apiserver
toPorts:
- ports:
- port: "6443"
protocol: TCP
- toEndpoints:
- matchLabels:
k8s:io.kubernetes.pod.namespace: kube-system
k8s-app: kube-dns
toPorts:
- ports:
- port: "53"
protocol: UDP
- port: "53"
protocol: TCP