All Projects → cloudnativer → kube-debug

cloudnativer / kube-debug

Licence: Apache-2.0 License
一鍵調試kubernetes和docker容器的Web視覺化工具箱。A toolbox for debugging docker container and kubernetes with web UI.

Programming Languages

go
31211 projects - #10 most used programming language
Dockerfile
14818 projects
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to kube-debug

spellcard
A Leiningen template for k8s deployment automation.
Stars: ✭ 15 (-67.39%)
Mutual labels:  k8s
couchdb-operator
prototype kubernetes operator for couchDB
Stars: ✭ 17 (-63.04%)
Mutual labels:  k8s
k8s-mon
滴滴夜莺Kubernetes monitor
Stars: ✭ 40 (-13.04%)
Mutual labels:  k8s
awesome
A curated list of delightful developers resources.
Stars: ✭ 13 (-71.74%)
Mutual labels:  k8s
nodejs-with-postgres-api-example
k8s course example - node.js app with Postgres, Hapi.js and Swagger
Stars: ✭ 59 (+28.26%)
Mutual labels:  k8s
kubectl-images
🕸 Show container images used in the cluster.
Stars: ✭ 153 (+232.61%)
Mutual labels:  k8s
khelm
A Helm chart templating CLI, kpt function and kustomize plugin
Stars: ✭ 46 (+0%)
Mutual labels:  k8s
state inspector
State change & method call logger. A debugging tool for instance variables and method calls.
Stars: ✭ 24 (-47.83%)
Mutual labels:  debug
towards5gs-helm
Open-source project providing Helm charts for deploying Free5GC and UERANSIM on a Kubernetes cluster
Stars: ✭ 53 (+15.22%)
Mutual labels:  k8s
clusterpedia
The Encyclopedia of Kubernetes clusters
Stars: ✭ 215 (+367.39%)
Mutual labels:  k8s
dockerfiles
Dockerfile & kubernetes Yaml Templates
Stars: ✭ 44 (-4.35%)
Mutual labels:  k8s
kubeadm-ansible
Kuberadmin ansible is a toolkit for simple and quick installing k8s cluster.
Stars: ✭ 37 (-19.57%)
Mutual labels:  k8s
kubernetes-marketplace
Marketplace of Kubernetes applications available for quick and easy installation in to Civo Kubernetes clusters
Stars: ✭ 136 (+195.65%)
Mutual labels:  k8s
XDebugger
A very lightweight library (4Kb) to create a development or production debugger with custom errors readable for humans. Includes errors in table format, logger and search methods with dynamic filters.
Stars: ✭ 18 (-60.87%)
Mutual labels:  debug
Debloat
Remove ads, bloatware and speed up your device.
Stars: ✭ 44 (-4.35%)
Mutual labels:  debug
docker-wrapper
k8s docker 国内镜像 gcr.io quay.io
Stars: ✭ 35 (-23.91%)
Mutual labels:  k8s
testkube
☸️ Kubernetes-native framework for test definition and execution
Stars: ✭ 172 (+273.91%)
Mutual labels:  k8s
vcluster
vcluster - Create fully functional virtual Kubernetes clusters - Each vcluster runs inside a namespace of the underlying k8s cluster. It's cheaper than creating separate full-blown clusters and it offers better multi-tenancy and isolation than regular namespaces.
Stars: ✭ 1,360 (+2856.52%)
Mutual labels:  k8s
k8s home
Kubernetes
Stars: ✭ 45 (-2.17%)
Mutual labels:  k8s
cka-exam-clusters
Certified Kubernetes Administrator exam cluster(s) for training!
Stars: ✭ 20 (-56.52%)
Mutual labels:  k8s

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.




Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].