Skip to content

Commit

Permalink
fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
yuval-k committed Apr 14, 2022
1 parent 17ea8be commit 3897045
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ builds:
binary: '{{ .ProjectName }}'
-
id: manager
main: ./cmd/srv
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath #removes all file system paths from the compiled executable
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Note: This software is beta quality. it seems to work, but there are definitely

To install, add kubectl-diag to your PATH; krew install coming soon.

Examples:
# Examples

Reverse port forward - redirect traffic pod's port 8080 to local port 8089

Expand All @@ -35,7 +35,7 @@ kubectl diag shell --pod mypod
```
Note that the shell shares the pid namespace with the first container in the pod (can be changed using `-t` flag). This means that you can do `cd /proc/1/root` to access the other container's file system.

# Examples
# Recipes

## Local Istio Debug

Expand All @@ -44,6 +44,9 @@ To redirect a sidecar to your istio running on your laptop, start your local pil
```sh
kubectl diag -l app=productpage -n bookinfo redirect --outgoing 15010 15012 15014
```

Get envoy's cpu profile

# How it works?

To help set-up reverse redirects, we inject an EphemeralContainer to the pod. The container has a process (called manager) that exposes a grpc api.
Expand All @@ -54,12 +57,11 @@ When doing a reverse port forward, the follow happens:
- manager starts up a listener on a random port
- manager sets up iptable rules to capture the traffic to the listener it just opened.
- the manager starts another listener on another random port.
- when a connection arrive in the first listener, the manager sends a message to the commandline with the port of the second listener.
- when a connection arrive in the first listener, the manager sends a message to the command-line with the port of the second listener.
- the command line then starts a port forward to that second listener's port, and connects to the local port. and bridges these two connections
- the manager accepts the connection on the second listener from the command line, and bridges the two connections it has (this one, and the one from the first listener).
- that's it!


# Dev/Debug:

## Iterating locally with kind
Expand Down

0 comments on commit 3897045

Please sign in to comment.