33| Type | Image | Notes |
44| ---- | ----- | ----- |
55| dqd | ghcr.io/ctrsploit/kubernetes-v1.35.1_containerd-v2.2.1_calico_debug: latest | -> ` v0.2.0 ` |
6+ | dqd | ghcr.io/ctrsploit/kubernetes-v1.35.1_containerd-v2.2.1_calico_debug: v0 .2.0 | debug kubelet,containerd |
67| dqd | ghcr.io/ctrsploit/kubernetes-v1.35.1_containerd-v2.2.1_calico_debug: v0 .1.0 | debug kubelet |
8+ | ctr | ghcr.io/ctrsploit/kubernetes-v1.35.1_containerd-v2.2.1_calico_debug: ctr_v0 .2.0 | - |
79| ctr | ghcr.io/ctrsploit/kubernetes-v1.35.1_containerd-v2.2.1_calico_debug: ctr_v0 .1.0 | - |
810
911## Usage
@@ -19,14 +21,27 @@ $ docker compose -f docker-compose.yml -f docker-compose.kvm.yml up -d
1921
2022``` shell
2123$ ./ssh
22- root@kubernetes-1-32-2 -containerd-2-0-3 :~ # systemctl stop kubelet
23- root@kubernetes-1-32-2 -containerd-2-0-3 :~ # ln -sf /usr/local/bin/debug.sh /usr/bin/kubelet
24- root@kubernetes-1-32-2 -containerd-2-0-3 :~ # systemctl start kubelet
25- root@kubernetes-1-32-2 -containerd-2-0-3 :~ # journalctl -u kubelet -f
24+ root@kubernetes-1-35-1 -containerd-2-2-1 :~ # systemctl stop kubelet
25+ root@kubernetes-1-35-1 -containerd-2-2-1 :~ # ln -sf /usr/local/bin/debug.sh /usr/bin/kubelet
26+ root@kubernetes-1-35-1 -containerd-2-2-1 :~ # systemctl start kubelet
27+ root@kubernetes-1-35-1 -containerd-2-2-1 :~ # journalctl -u kubelet -f
2628API server listening at: [::]:2345
2729...
2830```
2931
32+ ### Debug Containerd with Delve
33+
34+ ``` shell
35+ $ ./ssh
36+ root@kubernetes-1-35-1-containerd-2-2-1:~ # systemctl stop containerd
37+ root@kubernetes-1-35-1-containerd-2-2-1:~ # ln -sf /usr/local/bin/debug.sh /usr/local/bin/containerd
38+ root@kubernetes-1-35-1-containerd-2-2-1:~ # /usr/local/bin/containerd --config /etc/containerd/config.toml
39+ API server listening at: [::]:2346
40+ ...
41+ ```
42+
43+ > Using ` systemctl start containerd ` is also ok, but will raise a systemctl's timeout error. It's as an expected behavior, because ` containerd.service ` uses ` Type=notify ` , and launching containerd via Delve can cause systemd startup timeout.
44+
3045### GoLand remote attach
3146
3247kubelet
@@ -37,13 +52,30 @@ Host: 127.0.0.1
3752Port: 13516
3853```
3954
55+ containerd
56+
57+ ``` text
58+ Run/Debug Configurations -> Go Remote
59+ Host: 127.0.0.1
60+ Port: 13517
61+ ```
62+
4063### Restore Kubelet
4164
4265``` shell
43- root@kubernetes-1-32-2-containerd-2-0-3:~ # systemctl stop kubelet
44- root@kubernetes-1-32-2-containerd-2-0-3:~ # cp /usr/local/bin/kubelet.real /usr/bin/kubelet
45- root@kubernetes-1-32-2-containerd-2-0-3:~ # chmod +x /usr/bin/kubelet
46- root@kubernetes-1-32-2-containerd-2-0-3:~ # systemctl start kubelet
66+ root@kubernetes-1-35-1-containerd-2-2-1:~ # systemctl stop kubelet
67+ root@kubernetes-1-35-1-containerd-2-2-1:~ # cp /usr/local/bin/kubelet.real /usr/bin/kubelet
68+ root@kubernetes-1-35-1-containerd-2-2-1:~ # chmod +x /usr/bin/kubelet
69+ root@kubernetes-1-35-1-containerd-2-2-1:~ # systemctl start kubelet
70+ ```
71+
72+ ### Restore Containerd
73+
74+ ``` shell
75+ root@kubernetes-1-35-1-containerd-2-2-1:~ # systemctl stop containerd
76+ root@kubernetes-1-35-1-containerd-2-2-1:~ # cp /usr/local/bin/containerd.real /usr/local/bin/containerd
77+ root@kubernetes-1-35-1-containerd-2-2-1:~ # chmod +x /usr/local/bin/containerd
78+ root@kubernetes-1-35-1-containerd-2-2-1:~ # systemctl start containerd
4779```
4880
4981### Built-in Pods
@@ -128,7 +160,7 @@ make all ENV=kubernetes/v1.35.1/containerd/v2.2.1/calico/debug
128160
129161``` dockerfile
130162# syntax=docker/dockerfile:1-labs
131- FROM ghcr.io/ctrsploit/kubernetes-v1.35.1_containerd-v2.2.1_calico_debug:ctr_v0.1 .0
163+ FROM ghcr.io/ctrsploit/kubernetes-v1.35.1_containerd-v2.2.1_calico_debug:ctr_v0.2 .0
132164...
133165RUN --security=insecure ["/sbin/init" , "--log-target=kmsg" ]
134166```
0 commit comments