Skip to content

Commit c022fc2

Browse files
committed
add gif demo and toc
1 parent 751e8c9 commit c022fc2

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

README.md

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,28 @@
55
[![Go Report Card](https://goreportcard.com/badge/github.com/aylei/kubectl-debug)](https://goreportcard.com/report/github.com/aylei/kubectl-debug)
66
[![docker](https://img.shields.io/docker/pulls/aylei/debug-agent.svg)](https://hub.docker.com/r/aylei/debug-agent)
77

8-
[中文文档](./docs/zh-cn.md)
8+
[中文](./docs/zh-cn.md)
9+
10+
# Overview
911

1012
`kubectl-debug` is an out-of-tree solution for [troubleshooting running pods](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/troubleshoot-running-pods.md), which allows you to run a new container in running pods for debugging purpose. The new container will join the `pid`, `network`, `user` and `ipc` namespaces of the target container, so you can use arbitrary trouble-shooting tools without pre-install them in your production container image.
1113

12-
> Compatibility: I've tested `kubectl-debug` with kubectl v1.13.1 and kubernetes v1.9.1. I don't have an environment to test more versions but I suppose that `kubectl-debug` is compatible with all versions of kubernetes and kubectl 1.12.0+. Please [file an issue](https://github.com/aylei/kubectl-debug/issues/new) if you find `kubectl-debug` do not work.
14+
- [demo](#demo)
15+
- [quick start](#quick-start)
16+
- [build from source](#build-from-source)
17+
- [default image and entrypoints](#default-image-and-entrypoint)
18+
- [future works](#future-works)
19+
- [implementation details](#details)
20+
- [contribute](#contribute)
21+
22+
# Demo
23+
24+
![gif](./docs/kube-debug.gif)
1325

1426
# Quick Start
1527

28+
`kubectl-debug` is pretty simple, give it a try!
29+
1630
Install the debug agent DaemonSet in your cluster, which is responsible to run the "new container":
1731
```bash
1832
kubectl apply -f https://raw.githubusercontent.com/aylei/kubectl-debug/master/scripts/agent_daemonset.yml
@@ -39,6 +53,8 @@ kubectl debug POD_NAME
3953
kubectl debug -h
4054
```
4155

56+
> Compatibility: I've tested `kubectl-debug` with kubectl v1.13.1 and kubernetes v1.9.1. I don't have an environment to test more versions but I suppose that `kubectl-debug` is compatible with all versions of kubernetes and kubectl 1.12.0+. Please [file an issue](https://github.com/aylei/kubectl-debug/issues/new) if you find `kubectl-debug` do not work.
57+
4258
# Build from source
4359

4460
Clone this repo and:
@@ -54,10 +70,6 @@ go build -o debug-agent ./cmd/agent
5470
docker build . -t debug-agent
5571
```
5672

57-
# Demo
58-
59-
[![asciicast](https://asciinema.org/a/yswc937xUwvnIMRpvJSNJLJj7.png)](https://asciinema.org/a/yswc937xUwvnIMRpvJSNJLJj7)
60-
6173
# Default image and entrypoint
6274

6375
`kubectl-debug` use [nicolaka/netshoot](https://github.com/nicolaka/netshoot) as the default image to run debug container, and use `bash` as default entrypoint.
@@ -74,6 +86,13 @@ command:
7486
7587
PS: `kubectl-debug` will always override the entrypoint of the container, which is by design to avoid users running an unwanted service by mistake(of course you can always do this explicitly).
7688

89+
# Future works
90+
91+
`kubectl-debug` is supposed to be just a troubleshooting helper, and is going be replaced by the native `kubectl debug` command when [this proposal](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/troubleshoot-running-pods.md) is implemented and merged in the future kubernetes release. But for now, there is still some works to do to improve `kubectl-debug`.
92+
93+
- [ ] Security. `kubectl-debug` runs privileged agent on every node, and client talks to the agent directly. A possible solution is introducing a central apiserver to do RBAC, which integrates to the kube apiserver using [aggregation layer](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/)
94+
- [ ] Protocol. `kubectl-debug` vendor the SPDY wrapper from `client-go`. SPDY is deprecated now, websockets maybe a better choice
95+
7796
# Details
7897

7998
`kubectl-debug` consists of 2 components:

docs/kube-debug.gif

1.97 MB
Loading

0 commit comments

Comments
 (0)