Skip to content

Latest commit

 

History

History
110 lines (79 loc) · 2.6 KB

README.md

File metadata and controls

110 lines (79 loc) · 2.6 KB

Welcome to gokitconsulk8s 👋

License: MIT Twitter: CageChung

build go microservice with consul at kubernetes

Architecture

The gokitconsulk8s is comprised of 3 micorservice

  1. Router
    • http
    • grpc
  2. AddSvc
    • sum
    • concat
  3. FooSvc
    • foo

Install

prepare helm cluster

$ cd consul-helm
$ helm list
$ helm install ./ -n cc
...

Usage

skaffold run

Test

## 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

Author

👤 KAI-CHU CHUNG

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2019 KAI-CHU CHUNG.
This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator