Skip to content

Commit

Permalink
update naming and description
Browse files Browse the repository at this point in the history
  • Loading branch information
huazhihao committed Dec 29, 2019
1 parent 542ebb4 commit b0e9a33
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Build Status](https://travis-ci.org/huazhihao/kubespy.svg?branch=master)](https://travis-ci.org/huazhihao/kubespy)
![Proudly written in Bash](https://img.shields.io/badge/written%20in-bash-ff69b4.svg)

`kubespy` is a kubectl plugin which can non-invasively load common system tools into a particular running pod for debugging. So you don't have to modify the spec of the pod or the image of the container just for debugging purpose.
`kubespy` is a kubectl plugin which creates and runs an ephemeral toolbox container mounting on the pid/net/ipc namespace of a particular pod for debugging during runtime. So you don't have to bundle the tools with your image just for debugging purpose.


## Examples
Expand All @@ -24,7 +24,7 @@ Load common system tools into a particular running pod for debugging
Usage:
kubectl spy POD [-c CONTAINER] [--spy SPY_IMAGE]
kubectl spy POD [-c CONTAINER] [--ephemeral TOOLBOX_IMAGE]
Examples:
Expand All @@ -35,7 +35,7 @@ Examples:
kubectl spy mypod -c nginx
# spy container nginx from mypod using busybox
kubectl spy mypod -c nginx --spy busybox
kubectl spy mypod -c nginx --ephemeral busybox
```

## Architecture
Expand All @@ -56,7 +56,7 @@ worker node: kubelet
docker runtime
| (run)
v
sidecar container
ephemeral container
| (share namespace: pid/net/ipc)
v
target pod (eg. nginx)
Expand Down
6 changes: 3 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ Vagrant.configure("2") do |config|
minikube version
curl -fsSL https://get.docker.com | sh
usermod -aG docker vagrant
minikube start --extra-config=apiserver.authorization-mode=RBAC --insecure-registry 0.0.0.0/ --vm-driver=none --apiserver-ips 127.0.0.1 --apiserver-name localhost
usermod -aG docker $USER
minikube start --vm-driver=none
mv /home/vagrant/.kube /home/vagrant/.minikube $HOME
chown -R $USER $HOME/.kube $HOME/.minikube
SHELL
end
14 changes: 7 additions & 7 deletions kubespy
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Load common system tools into a particular running pod for debugging
Usage:
$SELF POD [-c CONTAINER] [--spy SPY_IMAGE]
$SELF POD [-c CONTAINER] [--ephemeral SPY_IMAGE]
Examples:
Expand All @@ -44,7 +44,7 @@ Examples:
$SELF mypod -c nginx
# spy container nginx from mypod using busybox
$SELF mypod -c nginx --spy busybox
$SELF mypod -c nginx --ephemeral busybox
See https://github.com/huazhihao/kubespy for more details.
EOF
Expand All @@ -69,8 +69,8 @@ main() {
shift
shift
;;
--spy)
si="$2"
--ephemeral)
ep="$2"
shift
shift
;;
Expand All @@ -82,7 +82,7 @@ main() {
done

co=${co:-""}
si=${si:-"busybox:latest"}
ep=${ep:-"busybox:latest"}

spyid="spy-$(shuf -i 1000-9999 -n 1)"
kubectl delete po/"${spyid}" &>/dev/null || true
Expand All @@ -105,7 +105,7 @@ main() {
"containers": [
{
"name": "spy",
"image": "'"${si}"'",
"image": "busybox",
"command": [ "/bin/chroot", "/host"],
"args": [
"docker",
Expand All @@ -114,7 +114,7 @@ main() {
"--network=container:'"${cid}"'",
"--pid=container:'"${cid}"'",
"--ipc=container:'"${cid}"'",
"busybox"
"'"${ep}"'"
],
"stdin": true,
"stdinOnce": true,
Expand Down

0 comments on commit b0e9a33

Please sign in to comment.