-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transrate gRPC #5
Changes from 6 commits
bb6bc38
e5ced31
a26935e
51c60ec
c599a31
756bca8
d7fa31d
d9d1a4c
2fa883b
52109e1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,20 +4,19 @@ publishDate: "2019-12-31" | |
categories: ["Traffic Management"] | ||
--- | ||
|
||
[gRPC](https://grpc.io/) is a communication protocol for services, built on [HTTP/2](https://www.cncf.io/blog/2018/08/31/grpc-on-http-2-engineering-a-robust-high-performance-protocol/). Unlike REST over HTTP/1, which is based on [resources](https://en.wikipedia.org/wiki/Representational_state_transfer), gRPC is based on [Service Definitions](https://grpc.io/docs/guides/concepts/). You specify service definitions in a format called [protocol buffers](https://developers.google.com/protocol-buffers/) ("proto"), which can be serialized into an small binary format for transmission. | ||
[gRPC](https://grpc.io/) はサービス間通信のプロトコルで、[HTTP/2](https://www.cncf.io/blog/2018/08/31/grpc-on-http-2-engineering-a-robust-high-performance-protocol/) 上で動作します。[resources](https://en.wikipedia.org/wiki/Representational_state_transfer) ベースの HTTP/1 上で動作する REST と異なり、gRPC は [Service Definitions](https://grpc.io/docs/guides/concepts/) ベースです。データの通信や永続化のための小さなバイナリフォーマットへシリアライズすることができる [protocol buffers](https://developers.google.com/protocol-buffers/) ("proto") と呼ばれるフォーマットで service definitions を指定します。 | ||
|
||
With gRPC, you can generate boilerplate code from `.proto` files into [multiple programming languages](https://grpc.io/docs/quickstart/), making gRPC an ideal choice for polyglot microservices. | ||
gRPC では `.proto` ファイルから [multiple programming languages](https://grpc.io/docs/quickstart/) へのボイラープレートコードを生成することができます。このため、gRPC は 多言語での microservices のための理想的な選択となるでしょう。 | ||
|
||
While gRPC supports some networking use cases like [TLS](https://grpc.io/docs/guides/auth/) and [client-side load balancing](https://grpc.io/blog/loadbalancing/), adding Istio to a gRPC architecture can be useful for collecting telemetry, adding traffic rules, and setting [RPC-level authorization](https://istio.io/blog/2018/istio-authorization/#rpc-level-authorization). Istio can also provide a useful management layer if your traffic is a mix of HTTP, TCP, gRPC, and database protocols, because you can use the same Istio APIs for all traffic types. | ||
gRPC は [TLS](https://grpc.io/docs/guides/auth/) や [client-side load balancing](https://grpc.io/blog/loadbalancing/) のようなユースケースをサポートしています。さらに gRPC のアーキテクチャに Istio を組み込むことはメトリクスの収集、トラフィックルールの追加、[RPC-level authorization](https://istio.io/blog/2018/istio-authorization/#rpc-level-authorization) といった利点があります。すべてのトラフィックタイプに同一の Istio API を使用できるため、トラフィックが HTTP, TCP, gRPC, そして データベースプロトコルの間で混在している場合でも、Istio は 便利な管理レイヤーを追加できます。 | ||
|
||
[Istio](https://istio.io/about/feature-stages/#traffic-management) and its data plane proxy, [Envoy](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/other_protocols/grpc#arch-overview-grpc), both support gRPC. Let's see how to manage gRPC traffic with Istio. | ||
[Istio](https://istio.io/about/feature-stages/#traffic-management) とそのデータプレーンプロキシーである [Envoy](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/other_protocols/grpc#arch-overview-grpc) の両方が gRPC をサポートします。Istio を用いてどのように gRPC トラフィックを管理するか見てみましょう。 | ||
|
||
![grpc](/images/grpc.png) | ||
|
||
Here, we're running two gRPC Services, `client` and `server`. `client` makes an RPC call to the `server`'s `/SayHello` function every 2 seconds. | ||
このように、`client` と `server` の2つの gRPC サービスがあります。`client` は RPC コールを `server` の `/SayHello` 関数へ2秒ごとに行います。 | ||
|
||
|
||
Adding Istio to gRPC Kubernetes services has one pre-requisite: [labeling](https://istio.io/docs/setup/kubernetes/additional-setup/requirements/) your Kubernetes Service ports. The server's port is labeled as follows: | ||
Istio を gRPC Kubernetes サービスへ追加するためには要件があります。Kubernetes の Service ports の [labeling](https://istio.io/docs/setup/kubernetes/additional-setup/requirements/) です。server のポートは以下のようにラベル付けされます。 | ||
|
||
```YAML | ||
apiVersion: v1 | ||
|
@@ -34,15 +33,15 @@ spec: | |
port: 8080 | ||
``` | ||
|
||
Once we deploy the app, we can see this traffic between client and server in a [service graph](https://www.kiali.io/): | ||
アプリケーションをデプロイすると、[service graph](https://www.kiali.io/) で client と server の間のトラフィックを見ることができます。 | ||
|
||
![kiali](/images/grpc-kiali.png) | ||
|
||
We can also view the server's gRPC traffic metrics in Grafana: | ||
server の gRPC トラフィックメトリクスを Grafana でも見ることができます。 | ||
|
||
![](/images/grpc-server-healthy.png) | ||
|
||
Then, we can apply an Istio traffic rule to inject a 10-second delay [fault](https://istio.io/docs/tasks/traffic-management/fault-injection/) into `server`. You might apply this rule in a chaos testing scenario, to test the resiliency of this application. | ||
また、10秒遅延させる [fault](https://istio.io/docs/tasks/traffic-management/fault-injection/) を `server` へ挿入するための Istio のトラフィックルールを適用できます。アプリケーションの回復性をテストするために、カオステストシナリオでこのルールを適用できるかもしれません。 | ||
|
||
```YAML | ||
apiVersion: networking.istio.io/v1alpha3 | ||
|
@@ -64,11 +63,10 @@ spec: | |
subset: v1 | ||
``` | ||
|
||
This causes the client RPC to time out (`Outgoing Request Duration`): | ||
これは client RPC にタイムアウト(`Outgoing Request Duration`)を起こします。 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
chaspy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
![](/images/grpc-grafana-client-fault-inject.png) | ||
|
||
|
||
To learn more about gRPC and Istio: | ||
gRPC と Istio についてさらに学ぶために: | ||
- [Istio docs - Traffic Management](https://istio.io/docs/concepts/traffic-management/#traffic-routing-and-configuration) | ||
- [Blog post - gRPC + Istio + Cloud Internal Load Balancer](https://cloud.google.com/solutions/using-istio-for-internal-load-balancing-of-grpc-services) | ||
- [Blog post - gRPC + Istio + Cloud Internal Load Balancer](https://cloud.google.com/solutions/using-istio-for-internal-load-balancing-of-grpc-services) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ちょうどこんな感じです!! @t-ide There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. リンク先に日本語版があるかどうかを探すのが若干面倒ですね 😅
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[protocol buffers](https://developers.google.com/protocol-buffers/)
→
[protocol buffers](https://developers.google.com/protocol-buffers?hl=ja)
現状ほとんど和訳されてませんが,一応...
[resources](https://en.wikipedia.org/wiki/Representational_state_transfer)
→
[resources](https://ja.wikipedia.org/wiki/Representational_State_Transfer)
説明の構成は異なりますが,大まかな意味は同じですし,英語版には無いRPCへの言及もありますので,個人的には日本語版リンクにしても良いと思います。英語版の方が妥当と判断されたらこのままで結構です。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
日本語版が Outdated じゃないかどうかだけ気になりますねえ。まぁそうであればそっちはそっちで原点にあたってもらえればいいんですが。ちょっと中身確認して判断します。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2件とも対応しました 👍
d9d1a4c
52109e1