Skip to content

Instantly share code, notes, and snippets.

@brianpursley
Created April 13, 2022 20:51
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 brianpursley/c0b6b0e483e041922599192238e3e754 to your computer and use it in GitHub Desktop.
Save brianpursley/c0b6b0e483e041922599192238e3e754 to your computer and use it in GitHub Desktop.
Create an echo server in Kubernetes

Creates a pod called echo that listens on port 8080, echoing everything it receives.

kubectl run echo --image=busybox -- nc -lk -p 8080 -e cat

To test it out, you can do this, to listen on local port 8080 and forward all connections to the echo pod:

kubectl port-forward echo 8080:8080

Then connect:

nc localhost 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment