webserver

command
v0.0.0-...-f36290b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2018 License: MIT Imports: 4 Imported by: 0

README

Go: Build and Run

go build -o ./webserver .
./webserver

# Stop later via Ctrl-C

Go: Test

curl --head http://127.0.0.1:8080

Docker: Build and Run

Choose image tag '1.0.1' for staging in addition, if needed for dev-ops-webserver and blue-green deployment, accordingly.

docker build -t stefanhans/webserver:1.0.0 .
docker run --publish 8080:8080 --name test --rm stefanhans/webserver:1.0.0

Docker: Test

curl --head http://127.0.0.1:8080
docker stop test

Docker: Push to Docker Hub

docker push stefanhans/webserver:1.0.0

Kubernetes: Deploy and Test

Having a running environment, e.g. minikube start

kubectl create -f DeployGoWebserver.yaml

kubectl get pods,service -l app=webserver
kubectl logs -l app=webserver

curl --head http://$(minikube ip):$(kubectl get svc -l app=webserver -o jsonpath='{.items[0].spec.ports[0].nodePort}')
echo "http://$(minikube ip):$(kubectl get svc -l app=webserver -o jsonpath='{.items[0].spec.ports[0].nodePort}')"

Kubernetes: Cleanup

kubectl delete all -l app=webserver

Next Step: Try out the deployment programmed in Go

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL