(1) Initialize the kube-debug environment:
kube-debug -init
(2) Debug the local host:
kube-debug -localhost
(3) Debug the target container (container ID is '9a64c7a0d6bd') on the local host, and set the debug listening port is TCP-38080:
kube-debug -container "9a64c7a0d6bd" -debugport 38080
(4) Debug the target k8s-node host (IP is 192.168.1.13), and set the debug listening port is TCP-38081:
kube-debug -node "192.168.1.13" -debugport 38081
(5) Debug the pod 'test-6bfb69dc64-hdblq' in the 'testns' namespace, and set the debug listening port is TCP-38082:
kube-debug -pod "test-6bfb69dc64-hdblq" -namespace "testns" -kubeconfig "/etc/kubernetes/pki/kubectl.kubeconfig" -debugport 38082
(6) Clean up the local host debugging environment:
kube-debug -clear