build go microservice with consul at kubernetes
The gokitconsulk8s is comprised of 3 micorservice
- Router
- http
- grpc
- AddSvc
- sum
- concat
- FooSvc
- foo
prepare helm cluster
$ cd consul-helm
$ helm list
$ helm install ./ -n cc
...
skaffold run
## gateway 8080 sum
$ curl -X "POST" "http://localhost:8080/api/addsvc/sum" -H 'Content-Type: application/json; charset=utf-8' -d '{ "a": 3, "b": 34}'
{"rs":37,"err":null}
## gateway 8080 concat
$ curl -X "POST" "http://localhost:8080/api/addsvc/concat" -H 'Content-Type: application/json; charset=utf-8' -d '{ "a": "3", "b": "34"}'
{"rs":"334","err":null}
## gateway 8080 foo
$ curl -X "POST" "http://localhost:8080/api/foosvc/foo" -H 'Content-Type: application/json; charset=utf-8' -d '{"s": "3ddd"}'
{"res":"3dddbar","err":null}
## grpc 8081 sum
$ grpcurl -plaintext -proto ./pb/addsvc/addsvc.proto -d '{"a": 3, "b":5}' localhost:8081 pb.Addsvc.Sum
{
"rs": "8"
}
## grpc 8081 concat
$ grpcurl -plaintext -proto ./pb/addsvc/addsvc.proto -d '{"a": "3", "b":"5"}' localhost:8081 pb.Addsvc.Concat
{
"rs": "35"
}
## grpc 8081 foo
$ grpcurl -plaintext -proto ./pb/foosvc/foosvc.proto -d '{"s": "foo"}' localhost:8081 pb.Foosvc.Foo
{
"res": "foobar"
}
zipkin
visit http://localhost:9411
👤 KAI-CHU CHUNG
- Twitter: @CageChung
- Github: @cage1016
Contributions, issues and feature requests are welcome!
Feel free to check issues page.
Give a ⭐️ if this project helped you!
Copyright © 2019 KAI-CHU CHUNG.
This project is MIT licensed.
This README was generated with ❤️ by readme-md-generator