Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Echo Service

Local Build/Run

Build

From the project root directory of the project run the following commands.

cmake .
make

Run Server

Navigate to the bin directory and execute the server binary.

cd bin
./echo-server

Run Client

Navigate to the bin directory and execute the client binary.

cd bin
./echo-client

To change the message sent to the server from the client set an ECHO_MSG environment variable:

export ECHO_MSG="<enter message here>"

Containerized Build/Run

Build Server Container

From the root directory of the project use the following command to build the server container.

docker build -t echo-server -f server/Dockerfile .

Alternatively, you can pull the image from Docker Hub.

docker image pull andrewwtpowell/echo-server

Run Server Container

To run the server use the following command.

docker run --rm -p 50051:50051 --name echo-server echo-server bin/echo-server -a 0.0.0.0:50051

Build Client Container

From the root directory of the project use the following command to build the client container.

docker build -t echo-client -f client/Dockerfile .

Alternatively, you can pull the image from Docker Hub.

docker image pull andrewwtpowell/echo-client

Run Client Container

To run the server use the following command.

docker run --rm -e ECHO_MSG="<insert msg>" --network=host echo-client bin/echo-client

Alternatively, connect using the server container's IP over the docker bridge rather than the host network.

docker run --rm -e ECHO_MSG="<insert msg>" echo-client bin/echo-client -t <server container IP>:50051

Kubernetes Deployment

Pre-Deployment Setup

Ensure there is a local Docker registry available to hold the container image.

docker run -d -p 5000:5000 --name registry registry:2.7

Build the server container, tagging with the local registry location, and push the image to the local registry.

docker build -t localhost:5000/echo-server -f server/Dockerfile .
docker push localhost:5000/echo-server

Deploy to the Cluster

kubectl apply -f server/echo-deployment.yaml

Testing the Service

Check that the service is running (and identify external IP).

kubectl get svc

Connect to the service using the local client.

cd bin
./echo_client -t <service-external-IP>:50051

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages