fizz-buzz-svc
A simple fizz-buzz REST server
Use
# Run fizz-buzz server on http://localhost:8081
docker build -t franxois/fizz-buzz-svc . && docker run --rm -p 8081:8080 franxois/fizz-buzz-svc
# call rest api
curl http://localhost:8081/?string1=fizz&string2=buzz&int1=3&int2=5&limit=15
# should return:
# {"result":["1","2","fizz","4","buzz","fizz","7","8","fizz","buzz","11","fizz","13","14","fizzbuzz"]}
Edit
Sources tree:
.
├── Dockerfile
├── fizzbuzz # contains fizz-buzz algorithm and tests
│ ├── fizzbuzz.go
│ └── fizzbuzz_test.go
├── go.mod
├── go.sum
├── k8s # contains kubernetes manifest
│ └── fizzbuzz.yml
├── LICENSE
├── README.md
├── server # contains REST API code and tests
│ ├── fizz-buzz-svc.go
│ └── fizz-buzz-svc_test.go
└── skaffold.yaml
Deploy
This project use skaffold to build docker images, publish and deploy on current kubernetes cluster.
To run this code on your dev kubernetes cluster with auto-redeploy on code changes, run command skaffold dev
then kubectl get svc
to get service local IP
To deploy this code on your staging kubernetes cluster, run command skaffold run