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

Overview

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-------------------------------               | |
|                                                                                                         | |
|  ##########################################################################################             | |
|  [email protected]:~ #                                                                                     |||
|  [email protected]:~ #                                                                                     |||
|  [email protected]:~ #                                                                                     |||
|  [email protected]:~ # 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.

[[email protected] ~]# docker exec -it kube-debug-localhost /bin/bash
##########################################################################################

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

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

##########################################################################################
[email protected]:~ # 
[email protected]:~ # 
[email protected]:~ # 
[email protected]:~ # 

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.




You might also like...
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".

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

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.

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

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

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

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

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

Releases(v0.1.0)
  • v0.1.0(Apr 21, 2021)

    A toolbox for debugging docker container and kubernetes with visual web UI. --Debugging interface with Web UI. --The debugging port of pod and node is exposed and the web is accessed directly. --Automatically complete the command line. --Rich visual debugging tools.

    For Example: (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 
      
    Source code(tar.gz)
    Source code(zip)
    kube-debug-v0.1.0-x86.tgz(183.01 MB)
Owner
CloudNativer
CloudNative & Kubernetes & DevOps & Docker & CloudComputing & IT
CloudNativer
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

null 1 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

Daniel Dias de Assumpção 15 Oct 28, 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

Daniel Dias de Assumpção 1 Feb 16, 2022
The Ultimate Engineer Toolbox YouTube 🔨 🔧

The Ultimate Engineer Toolbox YouTube ?? ??

Marcel Dempers 3.6k Nov 23, 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

Ed Andersen 8 Sep 20, 2022
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

KEDA 5.7k Nov 24, 2022
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

Neria Cohen 0 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 Table of Contents Overview How does it work? Architecture Development Run deployment manually Usage Example of analysis Overview Vilicus is an

Ederson Brilhante 79 Nov 17, 2022
Kubernetes IN Docker - local clusters for testing Kubernetes

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

Kubernetes SIGs 10.8k Nov 22, 2022