A toolbox for debugging docker container and kubernetes with web UI.

A toolbox for debugging Docker container and Kubernetes with visual web UI. You can start the debugging journey on any docker container host! You can use kube-debug to debug the local host, the local container, any kubernetes node and any kubernetes pod of any namespace. It can help you to automatically complete the command line, and has a large number of visual debugging tools.

kube-debug

[1] Quick start


1.1 Download kube-debug package file


You can download the kube-debug-*.tgz package from https://github.com/cloudnativer/kube-debug/releases.

For example, we have downloaded the kube-debug-v0.1.0-x86.tgz package.

# cd ~/
# wget https://github.com/cloudnativer/kube-debug/releases/download/v0.1.0/kube-debug-v0.1.0-x86.tgz
# tar -zxvf kube-debug-x86-v0.1.0.tgz
# cd ~/kube-debug/

1.2 Initialize the kube-debug environment


Execute the following command to initialize the local debug environment:
# cd ~/kube-debug/
# ./kube-debug -init

1.3 Start debugging


You can use kube-debug to debug the local host, the local container, any kubernetes node and any kubernetes pod of any namespace.

For example, We can use kube-debug -localhost to debug the local host. Let's debug the local host , We can perform the following command operations:

# cd ~/kube-debug/
# ./kube-debug -localhost

After the command is executed, the following information will be displayed:

df02e84f5233e01309f3188d3ab5622df1c495d0c8b5f2c68247856d9c552625

Debug environment started successfully!

Notice: You can now enter the debugging interface in the following two ways:
        (1) Using a web browser to access http://Localhost's_IP:3080 Debug! (Recommended URL: http://192.168.1.12:3080)
        (2) Use the command to debug directly on the local host: docker exec -it kube-debug-localhost /bin/bash 

Now you can use a web browser to access http://192.168.1.12:3080 and enter the visual web ui for debugging.

kube-debug

 __________________
|  Web Browser UI  |
=============================================================================================================
=====| <- | -> | O |=====(  http://192.168.1.12:3080                                        )================
=============================================================================================================
|                                                                                                         | |
|  ##########################################################################################             | |
|                                                                                                         | | 
|    #    #   #     #   #####    ######         #####    ######  #####    #     #    #####                | |
|    #  #     #     #   #    #   #              #    #   #       #    #   #     #   #                     | |
|    ##       #     #   #####    ####    #####  #     #  ####    #####    #     #   #   ###               | |
|    #  #     #     #   #    #   #              #    #   #       #    #   #     #   #     #               | |
|    #    #    #####    #####    ######         #####    ######  #####     #####     ######               | |
|                                                                                                         | |
|    --------------------------------Powered By Cloudnativer-------------------------------               | |
|                                                                                                         | |
|  ##########################################################################################             | |
|  root@localhost:~ #                                                                                     |||
|  root@localhost:~ #                                                                                     |||
|  root@localhost:~ #                                                                                     |||
|  root@localhost:~ # iptraf-ng |                                                                         | |
=============================================================================================================

Here we can easily do visual debugging, Automatically complete the command line, Rich visual debugging tools:

kube-debug

In addition, we can also use the docker exec -it kube-debug-localhost /bin/bash command to directly log in to the debugging container for debugging.

[root@localhost ~]# docker exec -it kube-debug-localhost /bin/bash
##########################################################################################

  #    #   #     #   #####    ######         #####    ######  #####    #     #    #####
  #  #     #     #   #    #   #              #    #   #       #    #   #     #   #
  ##       #     #   #####    ####    #####  #     #  ####    #####    #     #   #   ###
  #  #     #     #   #    #   #              #    #   #       #    #   #     #   #     #
  #    #    #####    #####    ######         #####    ######  #####     #####     ######

  --------------------------------Powered By Cloudnativer-------------------------------

##########################################################################################
root@localhost:~ # 
root@localhost:~ # 
root@localhost:~ # 
root@localhost:~ # 

kube-debug integrates many debugging tools. You can click here to see more integrated tool list information.



[2] How to debug?


2.1 Debug the local host


We can use kube-debug -localhost to debug the local host. Let's debug the local host , We can perform the following command operations:

# cd ~/kube-debug/
# ./kube-debug -localhost

After the command is executed, the following information will be displayed:

df02e84f5233e01309f3188d3ab5622df1c495d0c8b5f2c68247856d9c552625

Debug environment started successfully!

Notice: You can now enter the debugging interface in the following two ways:
        (1) Using a web browser to access http://Localhost's_IP:3080 Debug! (Recommended URL: http://192.168.1.12:3080)
        (2) Use the command to debug directly on the local host: docker exec -it kube-debug-localhost /bin/bash 

Now you can use a web browser to access http://192.168.1.12:3080 and enter the Visual Web UI for debugging. You can also use the docker exec -it kube-debug-localhost /bin/bash command to directly log in to the debugging container for debugging.


2.2 Debug the local container


We can use kube-debug -container <container id or container name> to debug the local container. Let's debug the local container with ID 9a64c7a0d6bd , We can perform the following command operations:

# cd ~/kube-debug/
# ./kube-debug -container "a1aa35697643" -debugport 38080

After the command is executed, the following information will be displayed:

efa3cc35dd414e4217c880fe269f375cd512fe4f5122e0ccc39719c83d8c30e1

Debug environment started successfully!

Notice: You can now enter the debugging interface in the following two ways:
        (1) Using a web browser to access http://Localhost's_IP:38080 Debug! (Recommended URL: http://192.168.1.12:38080) 
        (2) Use the command to debug directly on the local host: docker exec -it kube-debug-container-a1aa35697643 /bin/bash 

Now you can use a web browser to access http://192.168.1.12:38080 and enter the Visual Web UI for debugging. You can also use the docker exec -it kube-debug-container-a1aa35697643 /bin/bash command to directly log in to the debugging container for debugging.


2.3 Debug the any kubernetes node


We can use kube-debug -node <kubernetes node IP> to debug any kubernetes node. Let's debug the kubernetes node with IP 192.168.1.13 , We can perform the following command operations:

# cd ~/kube-debug/
# ./kube-debug -node "192.168.1.13" -debugport 38081

After the command is executed, the following information will be displayed:

Preparing kube-debug environment, Please wait! 

Checking target k8s-node (192.168.1.13), please wait...
Checking debugging environment...
Enabling debugging process...
0d1e548b7f6012dea80e2ccadb8b6ba874fcf20a1a4b914469093e88f85905e3

Debug environment started successfully!

Notice: You can now enter the debugging interface in the following two ways:
        (1) Using a web browser to access http://k8s-node's_IP:38081 Debug! (Recommended URL: http://192.168.1.13:38081)
        (2) Login to the target k8s-node host (192.168.1.13), debugging with commands: docker exec -it kube-debug-node-192.168.1.13 /bin/bash 

Now you can use a web browser to access http://192.168.1.13:38081 and enter the Visual Web UI for debugging. You can also Login to the target k8s-node host (192.168.1.13), debugging with commands docker exec -it kube-debug-node-192.168.1.13 /bin/bash .


2.4 Debug the any kubernetes pod


We can use kube-debug -pod <pod name> -namespace <namespace> -kubeconfig <kubeconfig file> to debug any kubernetes pod. Let's debug the test-6bfb69dc64-hdblq pod in the testns namespace , We can perform the following command operations:

# cd ~/kube-debug/
# ./kube-debug -pod "test-6bfb69dc64-hdblq" -namespace "testns" -kubeconfig "/etc/kubernetes/pki/kubectl.kubeconfig" -debugport 38082

After the command is executed, the following information will be displayed:

Preparing kube-debug environment, Please wait! 

Warning: If you don't get through the local ssh key to the target k8s-node (192.168.1.15), please wait and enter the password for target k8s-node!
Please wait a moment...
[email protected]'s password: <Enter Password>

Checking target k8s-node (192.168.1.15), please wait...
Checking debugging environment...
Enabling debugging process...
4d6b52c485c4c9a5c10c2dffc2c322562acfee6ca73d3e94fd893efddfe36a91

Debug environment started successfully!

Notice: You can now enter the debugging interface in the following two ways:
        (1) Using a web browser to access http://k8s-node's_IP:38082 Debug! (Recommended URL: http://192.168.1.15:38082)
        (2) Login to the target k8s-node host (192.168.1.15), debugging with commands: docker exec -it kube-debug-pod-test-6bfb69dc64-hdblq /bin/bash 

Now you can use a web browser to access http://192.168.1.15:38082 and enter the Visual Web UI for debugging. You can also Login to the target k8s-node host (192.168.1.15), debugging with commands docker exec -it kube-debug-pod-test-6bfb69dc64-hdblq /bin/bash .



[3] Cleaning up the debug environment


We can clean up the local machine's debug environment by executing kube-debug -clear . The following command will automatically clean up the residual temporary cache file, debug container, debug process and other information.

# cd ~/kube-debug/
# ./kube-debug -clear

Now the debug environment of the local machine is cleaned up.



[4] Parameter introduction


The parameters about kube-debug can be viewed using the kube-debug -help command. You can also see more detailed parameter introduction here.



[5] Integrated tool list


kube-debug integrates many debugging tools. You can click here to see more integrated tool list information.



[6] How to build it?


The build can be completed automatically by executing the make command. You can also see more detailed build instructions here.




Owner
CloudNativer
CloudNative & Kubernetes & DevOps & Docker & CloudComputing & IT
CloudNativer
Similar Resources

Kubernetes IN Docker - local clusters for testing Kubernetes

Kubernetes IN Docker - local clusters for testing Kubernetes

Please see Our Documentation for more in-depth installation etc. kind is a tool for running local Kubernetes clusters using Docker container "nodes".

Feb 14, 2022

Moby Project - a collaborative project for the container ecosystem to assemble container-based systems

Moby Project - a collaborative project for the container ecosystem to assemble container-based systems

The Moby Project Moby is an open-source project created by Docker to enable and accelerate software containerization. It provides a "Lego set" of tool

Jan 8, 2023

Boxygen is a container as code framework that allows you to build container images from code

Boxygen is a container as code framework that allows you to build container images from code, allowing integration of container image builds into other tooling such as servers or CLI tooling.

Dec 13, 2021

Amazon ECS Container Agent: a component of Amazon Elastic Container Service

Amazon ECS Container Agent: a component of Amazon Elastic Container Service

Amazon ECS Container Agent The Amazon ECS Container Agent is a component of Amazon Elastic Container Service (Amazon ECS) and is responsible for manag

Dec 28, 2021

The Container Storage Interface (CSI) Driver for Fortress Block Storage This driver allows you to use Fortress Block Storage with your container orchestrator

fortress-csi The Container Storage Interface (CSI) Driver for Fortress Block Storage This driver allows you to use Fortress Block Storage with your co

Jan 23, 2022

A command-line debugging tool to check the latency of SSL handshake

ssl-handshake A command-line tool for testing SSL handshake latency, written in

Nov 13, 2022

Testcontainers is a Golang library that providing a friendly API to run Docker container. It is designed to create runtime environment to use during your automatic tests.

When I was working on a Zipkin PR I discovered a nice Java library called Testcontainers. It provides an easy and clean API over the go docker sdk to

Jan 7, 2023

A tool to restart a Docker container with a newer version of the image

repull A tool to restart a Docker container with a newer version of an image used by the container Often you may need to pull a newer version of an im

Nov 28, 2022

Docker container lazy loading

Lazytainer Putting your containers to sleep I don't really wanna do the work today How it works Lazy loading containers monitor network traffic for ac

Dec 29, 2022
A docker container that can be deployed as a sidecar on any kubernetes pod to monitor PSI metrics

CgroupV2 PSI Sidecar CgroupV2 PSI Sidecar can be deployed on any kubernetes pod with access to cgroupv2 PSI metrics. About This is a docker container

Nov 23, 2021
Dotnet-appsettings-env - Convert .NET appsettings.json file to Kubernetes, Docker and Docker-Compose environment variables

dotnet-appsettings-env Convert .NET appsettings.json file to Kubernetes, Docker

Dec 30, 2022
Dotnet-appsettings-env - Convert .NET appsettings.json file to Kubernetes, Docker and Docker-Compose environment variables

dotnet-appsettings-env Convert .NET appsettings.json file to Kubernetes, Docker

Feb 16, 2022
How to get a Go / Golang app using the Gin web framework running natively on Windows Azure App Service WITHOUT using a Docker container

Go on Azure App Service View the running app -> https://go-azure-appservice.azurewebsites.net ?? This is an example repo of how to get a Go / Golang a

Nov 28, 2022
The Ultimate Engineer Toolbox YouTube 🔨 🔧
 The Ultimate Engineer Toolbox YouTube 🔨 🔧

The Ultimate Engineer Toolbox YouTube ?? ??

Jan 8, 2023
KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes
 KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes

Kubernetes-based Event Driven Autoscaling KEDA allows for fine-grained autoscaling (including to/from zero) for event driven Kubernetes workloads. KED

Jan 7, 2023
The example shows how to build a simple multi-tier web application using Kubernetes and Docker
The example shows how to build a simple multi-tier web application using Kubernetes and Docker

Guestbook Example This example shows how to build a simple multi-tier web application using Kubernetes and Docker. The application consists of a web f

Nov 15, 2021
Vilicus is an open source tool that orchestrates security scans of container images(docker/oci) and centralizes all results into a database for further analysis and metrics.
Vilicus is an open source tool that orchestrates security scans of container images(docker/oci) and centralizes all results into a database for further analysis and metrics.

Vilicus Table of Contents Overview How does it work? Architecture Development Run deployment manually Usage Example of analysis Overview Vilicus is an

Dec 6, 2022
Kubernetes IN Docker - local clusters for testing Kubernetes
Kubernetes IN Docker - local clusters for testing Kubernetes

kind is a tool for running local Kubernetes clusters using Docker container "nodes".

Jan 5, 2023