Giter Club home page Giter Club logo

go-echo's Introduction

Docker Container Image Size Docker Container Layers Docker Container Pulls

GO (TCP) Echo

A Simple go TCP echo server. Written to learn and test Kubernetes TCP networking.

Test with Docker

Run the container from a terminal:

docker run --rm -it -e TCP_PORT=2701 -e NODE_NAME="EchoNode" -p 2701:2701 cjimti/go-echo

In another terminal run:

telnet localhost 2701

Test with Kubernetes

cd k8s
kubectl create -f . 

You should now have two TCP echo containers running:

kubectl get pods --selector=app=tcp-echo
NAME                                   READY     STATUS    RESTARTS   AGE
tcp-echo-deployment-777d856787-5fhb4   1/1       Running   0          27s
tcp-echo-deployment-777d856787-rh9tp   1/1       Running   0          27s

You should also have a service that connection port 32701 to the pods:

kubectl get service --selector=app=tcp-echo-service
NAME               TYPE       CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE
tcp-echo-service   NodePort   10.102.207.113   <none>        2701:32701/TCP   35m

Echo some data, replace ANY_NODE_IP with a location of a node:

telnet ANY_NODE_IP 32701

After connecting, type the word hello and hit return:

Trying x.x.x.x...
Connected to node1.example.com.
Escape character is '^]'.
Welcome, you are connected to node node1.example.com.
Running on Pod tcp-echo-deployment-777d856787-rh9tp.
In namespace default.
With IP address 192.168.33.39.
Service default.
hello
hello

Resources

go-echo's People

Contributors

cjimti avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.