Skip to content

Commit 228042c

Browse files
[#117]: added kubernetes manifest for metrics collector service
1 parent eaf811d commit 228042c

File tree

1 file changed

+96
-0
lines changed

1 file changed

+96
-0
lines changed

core/src/testing/metrics.yaml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: cortexflow-metrics
5+
namespace: cortexflow
6+
labels:
7+
app: cortexflow-metrics
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
app: cortexflow-metrics
13+
template:
14+
metadata:
15+
labels:
16+
app: cortexflow-metrics
17+
spec:
18+
hostPID: true
19+
hostNetwork: true
20+
containers:
21+
- name: metrics
22+
image: lorenzotettamanti/cortexflow-metrics:latest
23+
command: ["/bin/bash", "-c"]
24+
args:
25+
- |
26+
echo "Running on kernel $(uname -r)"
27+
if [ ! -d "/sys/fs/bpf" ]; then
28+
echo "ERROR: BPF filesystem not mounted"
29+
exit 1
30+
else
31+
echo "Checking ebpf path..."
32+
ls -l /sys/fs/bpf
33+
fi
34+
echo "checking privileges"
35+
ls -ld /sys/fs/bpf
36+
37+
echo "Running application..."
38+
exec /usr/local/bin/cortexflow-metrics || echo "Application exited with code $?"
39+
volumeMounts:
40+
- name: bpf
41+
mountPath: /sys/fs/bpf
42+
mountPropagation: Bidirectional
43+
readOnly: false
44+
- name: proc
45+
mountPath: /host/proc
46+
readOnly: false
47+
- name: kernel-dev
48+
mountPath: /lib/modules
49+
readOnly: false
50+
securityContext:
51+
privileged: true
52+
allowPrivilegeEscalation: true
53+
capabilities:
54+
add:
55+
- SYS_ADMIN
56+
- NET_ADMIN
57+
- SYS_RESOURCE
58+
- BPF
59+
- SYS_PTRACE
60+
- name: bpftool-control-manager
61+
image: danielpacak/bpftool-runner:latest
62+
command: ["/bin/bash", "-c","sleep infinity"]
63+
volumeMounts:
64+
- name: bpf
65+
mountPath: /sys/fs/bpf
66+
mountPropagation: Bidirectional
67+
readOnly: false
68+
- name: proc
69+
mountPath: /host/proc
70+
readOnly: false
71+
- name: kernel-dev
72+
mountPath: /lib/modules
73+
readOnly: false
74+
securityContext:
75+
privileged: true
76+
allowPrivilegeEscalation: true
77+
capabilities:
78+
add:
79+
- SYS_ADMIN
80+
- NET_ADMIN
81+
- SYS_RESOURCE
82+
- BPF
83+
- SYS_PTRACE
84+
volumes:
85+
- name: bpf
86+
hostPath:
87+
path: /sys/fs/bpf
88+
type: Directory
89+
- name: proc
90+
hostPath:
91+
path: /proc
92+
type: Directory
93+
- name: kernel-dev
94+
hostPath:
95+
path: /lib/modules
96+
type: Directory

0 commit comments

Comments
 (0)