Skip to content

cage1016/gokitconsulk8s

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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