Skip to content

Instantly share code, notes, and snippets.

@maelvls
Created November 14, 2020 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maelvls/600459ecf2044e72ae81a213a5463744 to your computer and use it in GitHub Desktop.
Save maelvls/600459ecf2044e72ae81a213a5463744 to your computer and use it in GitHub Desktop.
kubectl run tcpd -it --rm --image=a --overrides='{"spec": {"hostNetwork": true, "containers": [{"name": "tcpd", "image": "corfr/tcpdump", "tty": true, "stdin": true, "stdinOnce": true, "securityContext": {"capabilities": {"add": ["NET_ADMIN"]}}, "args": ["-i", "any", "-U", "-w", "-"]}]}}'

Don't forget that only the DNS names with .local are forwarded by the sshuttle VPN. If you want e.g. example.com to be also forwarded to the cluster, you need to add --also-proxy example.com.

Example:

telepresence --namespace cert-manager --swap-deployment cert-manager --mount=false --run-shell --also-proxy 'example.com'
k krew install sniff
kubectl sniff -n bind bind-79c646f789-vw24n -f "port 53"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment