-
Notifications
You must be signed in to change notification settings - Fork 34
/
flp-daemonset-cap.yml
164 lines (164 loc) · 3.53 KB
/
flp-daemonset-cap.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# Example deployment for manual testing with flp
# It requires loki to be installed
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: netobserv-ebpf-agent
namespace: netobserv
labels:
k8s-app: netobserv-ebpf-agent
spec:
selector:
matchLabels:
k8s-app: netobserv-ebpf-agent
template:
metadata:
labels:
k8s-app: netobserv-ebpf-agent
spec:
serviceAccountName: netobserv
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
containers:
- name: netobserv-ebpf-agent
image: quay.io/netobserv/netobserv-ebpf-agent:main
imagePullPolicy: Always
securityContext:
capabilities:
add:
- BPF
- PERFMON
- NET_ADMIN
- SYS_RESOURCE
runAsUser: 0
env:
- name: TARGET_HOST
valueFrom:
fieldRef:
fieldPath: status.hostIP
- name: TARGET_PORT
value: "9999"
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: flp
namespace: netobserv
labels:
k8s-app: flp
spec:
selector:
matchLabels:
k8s-app: flp
template:
metadata:
labels:
k8s-app: flp
spec:
serviceAccountName: netobserv
containers:
- name: flowlogs-pipeline
image: quay.io/netobserv/flowlogs-pipeline:main
imagePullPolicy: Always
ports:
- containerPort: 9999
hostPort: 9999
args:
- --config=/etc/flp/config.yaml
volumeMounts:
- mountPath: /etc/flp
name: config-volume
volumes:
- name: config-volume
configMap:
name: flp-config
---
apiVersion: v1
kind: ConfigMap
metadata:
name: flp-config
data:
config.yaml: |
log-level: debug
pipeline:
- name: ingest
- name: enrich
follows: ingest
- name: loki
follows: enrich
parameters:
- name: ingest
ingest:
type: grpc
grpc:
port: 9999
- name: enrich
transform:
type: network
network:
rules:
- type: add_kubernetes
kubernetes:
input: SrcAddr
output: SrcK8S
- type: add_kubernetes
kubernetes:
input: DstAddr
output: DstK8S
- name: loki
write:
type: loki
loki:
staticLabels:
app: netobserv-flowcollector
labels:
- "SrcK8S_Namespace"
- "SrcK8S_OwnerName"
- "DstK8S_Namespace"
- "DstK8S_OwnerName"
url: http://loki.netobserv.svc:3100
timestampLabel: TimeFlowEndMs
timestampScale: 1ms
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: netobserv
namespace: netobserv
rules:
- apiGroups:
- apps
resources:
- daemonsets
- deployments
- replicasets
verbs:
- get
- list
- watch
- apiGroups:
- ""
resources:
- configmaps
- namespaces
- services
- nodes
- pods
verbs:
- get
- list
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: netobserv
namespace: netobserv
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: netobserv
subjects:
- kind: ServiceAccount
name: netobserv
namespace: netobserv