File tree 3 files changed +107
-0
lines changed
3 files changed +107
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM ubuntu:22.04
2
+
3
+ RUN apt-get update -y --fix-missing \
4
+ && apt-get install -y iproute2 tcpdump net-tools iputils-ping netcat wget screen xz-utils strace nftables ipvsadm iptables bird2 ethtool conntrack dnsutils jq
5
+
6
+ ADD https://github.com/Nordix/ctraffic/releases/download/v1.7.0/ctraffic.gz ctraffic.gz
7
+ RUN gunzip ctraffic.gz \
8
+ && chmod a+x ctraffic
9
+
10
+ ADD https://github.com/Nordix/mconnect/releases/download/v2.2.0/mconnect.xz mconnect.xz
11
+ RUN unxz mconnect.xz \
12
+ && chmod a+x mconnect
13
+
14
+ ADD https://github.com/Nordix/nfqueue-loadbalancer/releases/download/1.0.0/nfqlb-1.0.0.tar.xz /
15
+ RUN tar --strip-components=1 -xf /nfqlb-1.0.0.tar.xz nfqlb-1.0.0/bin/nfqlb
16
+
17
+ ADD https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.24.1/crictl-v1.24.1-linux-amd64.tar.gz /
18
+ RUN tar zxvf crictl-v1.24.1-linux-amd64.tar.gz -C /bin
19
+ RUN rm -f crictl-v1.24.1-linux-amd64.tar.gz
20
+
21
+ CMD ["tail" , "-f" , "/dev/null" ]
Original file line number Diff line number Diff line change
1
+ ---
2
+ apiVersion : apps/v1
3
+ kind : DaemonSet
4
+ metadata :
5
+ name : debug-meridio-daemonset
6
+ labels :
7
+ app : debug-meridio-daemonset
8
+ spec :
9
+ selector :
10
+ matchLabels :
11
+ app : debug-meridio-daemonset
12
+ template :
13
+ metadata :
14
+ labels :
15
+ app : debug-meridio-daemonset
16
+ spec :
17
+ hostNetwork : true
18
+ containers :
19
+ - name : debug
20
+ image : registry.nordix.org/cloud-native/meridio/debug-meridio:latest
21
+ imagePullPolicy : Always
22
+ securityContext :
23
+ capabilities :
24
+ add :
25
+ - NET_ADMIN
26
+ - SYS_ADMIN
27
+ volumeMounts :
28
+ - mountPath : /run/netns
29
+ name : netns-volume
30
+ - mountPath : /run/containerd
31
+ name : containerd-volume
32
+ volumes :
33
+ - name : netns-volume # To access the network namespaces
34
+ hostPath :
35
+ path : /run/netns
36
+ type : Directory
37
+ - name : containerd-volume # To use crictl
38
+ hostPath :
39
+ path : /run/containerd
40
+ type : Directory
Original file line number Diff line number Diff line change
1
+ # Debugging
2
+
3
+ ## Deploy
4
+
5
+ ```
6
+ kubectl apply -f tools/debug/debug-daemont.yaml
7
+ ```
8
+
9
+ ## Build
10
+
11
+ ```
12
+ docker build -t debug-meridio -f tools/debug/Dockerfile .
13
+ docker tag debug-meridio:latest registry.nordix.org/cloud-native/meridio/debug-meridio:latest
14
+ docker push registry.nordix.org/cloud-native/meridio/debug-meridio:latest
15
+ ```
16
+
17
+ ## Commands
18
+ List netns::
19
+ ```
20
+ ls -1i /var/run/netn
21
+ ```
22
+
23
+ List netns (more details):
24
+ ```
25
+ lsns -t net
26
+ ```
27
+
28
+ Check the processes running in the network namespace:
29
+ ```
30
+ ls -l /proc/[1-9]*/ns/net | grep <NS> | cut -f3 -d"/" | xargs ps -p
31
+ ```
32
+
33
+ Find pid from container ID:
34
+ ```
35
+ crictl inspect --output go-template --template '{{.info.pid}}' <CONTAINER-ID>
36
+ ```
37
+
38
+ List containers:
39
+ ```
40
+ crictl ps
41
+ ```
42
+
43
+ Find network namespace from pod ID:
44
+ ```
45
+ crictl inspectp <POD-ID> | jq -r '.info.runtimeSpec.linux.namespaces[] |select(.type=="network") | .path'
46
+ ```
You can’t perform that action at this time.
0 commit comments