github.com/kevinmichaelchen/hello-world-go

Hello World in Golang


Keywords
demo, golang, hello-world
Install
go get github.com/kevinmichaelchen/hello-world-go

Documentation

hello-world-go

GoDoc Go report

A simple Go server that demos routing.

Running Locally

# Build and start server
make

Running with Docker-Compose

make docker-build
docker-compose up -d
curl http://localhost:7899/id
docker-compose stop

Running in Minikube

Install Docker (for Mac, for Windows), hyperkit, and minikube.

Sometimes I have to minikube stop; minikube delete; rm -rf ~/.minikube; brew cask reinstall minikube.

Minikube load balancing demo

Here's a quick demo of load balancing in minikube

# Start the cluster. Takes a minute. Be patient.
make mk-start

# Build the Docker image, start your K8S services + deployments
make mk-build kb-create

# Wait for your pods to start
# kubectl get svc,deploy,po
kubectl get --watch po

# Hit the endpoint multiple times and observe load balancing in action
for i in $(seq 1 7); do printf "Request #$i: "; curl $(minikube service hello-world-go-api --url)/id; echo ""; done

Benchmarks

Load tests show nearly 80k requests per second.