139 lines
3.1 KiB
YAML
139 lines
3.1 KiB
YAML
|
|
---
|
||
|
|
# 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
|