Coder Social home page Coder Social logo

grpc's Introduction

gRPC example

This section explains how to use Traefik and linkerd as reverse proxy for gRPC application

Traefik

Traefik Server bench

Traefik http

Launch traefik and grpc server

docker-compose -f docker-compose-traefik.yml up

Server hello listen on port :7777

Server world listen on port :7778

Traefik listen on port :4140

client -> Traefik -> Hello -> traefik -> World

Use it

Launch Client

./curl localhost:4140/toto

Traefik gRPC

Launch traefik and grpc server

docker-compose -f docker-compose-traefik-grpc.yml up

Server hello listen on port :7777

Server world listen on port :7778

Traefik listen on port :4140

client -> Traefik -> Hello -> traefik -> World

Use it

Launch Client

helloworld-client 127.0.0.1:4140

See error

Note/Issues

Traefik redirect only to an http server over http2

Traefik don't manage grpc protocol. We can't define grpc route

Linkerd

Linkerd Server bench

Linkerd gRPC

Launch Linkerd and grpc server

 docker-compose -f docker-compose-linkerd.yml up

Server hello listen on port :7777

Server world listen on port :7778

Linkerd listen on port :4140

client -> Linkerd -> Hello -> Linkerd -> World

Use it

Launch Client

go get -u github.com/linkerd/linkerd-examples/docker/helloworld/helloworld-client
helloworld-client 127.0.0.1:4140

Tips

Greeter client came form google.golan.org/grpc/examples has been modified to send request to frontend.local:4443

./greeter_client

Greeter Server came form google.golan.org/grpc/examples has been modified to received request to :50051

./greeter_server&

gRPC Server certificat

Autosigned certificate has been generated for frontend.local and backend.local

Traefik Error

hello_1    | 2017/10/01 12:40:41 transport: http2Client.notifyError got notified that the client transport was broken read tcp 172.20.0.4:36840->172.20.0.3:4140: read: connection reset by peer.
hello_1    | 2017/10/01 12:40:41 transport: http2Client.notifyError got notified that the client transport was broken unexpected EOF.
hello_1    | 2017/10/01 12:40:41 grpc: addrConn.resetTransport failed to create client transport: connection error: desc = "transport: write tcp 172.20.0.4:36844->172.20.0.3:4140: write: broken pipe"; Reconnecting to {traefik:4140 <nil>}

grpc's People

Contributors

jsenon avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.