From the project root directory of the project run the following commands.
cmake .
makeNavigate to the bin directory and execute the server binary.
cd bin
./echo-serverNavigate to the bin directory and execute the client binary.
cd bin
./echo-clientTo change the message sent to the server from the client set an ECHO_MSG environment variable:
export ECHO_MSG="<enter message here>"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-serverTo 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:50051From 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-clientTo run the server use the following command.
docker run --rm -e ECHO_MSG="<insert msg>" --network=host echo-client bin/echo-clientAlternatively, 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>:50051Ensure there is a local Docker registry available to hold the container image.
docker run -d -p 5000:5000 --name registry registry:2.7Build 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-serverkubectl apply -f server/echo-deployment.yamlCheck that the service is running (and identify external IP).
kubectl get svcConnect to the service using the local client.
cd bin
./echo_client -t <service-external-IP>:50051