1
1
---
2
- reviewers :
3
- - johnbelamaric
4
- - imroc
5
- title : Service Topology
2
+ title : Serviceトポロジー
6
3
feature :
7
- title : Service Topology
4
+ title : Serviceトポロジー
8
5
description : >
9
- Routing of service traffic based upon cluster topology.
10
-
6
+ Serviceのトラフィックをクラスタートポロジーに基づいてルーティングします。
11
7
content_type : concept
12
8
weight : 10
13
9
---
@@ -17,96 +13,47 @@ weight: 10
17
13
18
14
{{< feature-state for_k8s_version="v1.17" state="alpha" >}}
19
15
20
- _ Service Topology_ enables a service to route traffic based upon the Node
21
- topology of the cluster. For example, a service can specify that traffic be
22
- preferentially routed to endpoints that are on the same Node as the client, or
23
- in the same availability zone.
24
-
25
-
16
+ * Serviceトポロジー* を利用すると、Serviceのトラフィックをクラスターのノードトポロジーに基づいてルーティングできるようになります。たとえば、あるServiceのトラフィックに対して、できるだけ同じノードや同じアベイラビリティゾーン上にあるエンドポイントを優先してルーティングするように指定できます。
26
17
27
18
<!-- body -->
28
19
29
- ## Introduction
30
-
31
- By default, traffic sent to a ` ClusterIP ` or ` NodePort ` Service may be routed to
32
- any backend address for the Service. Since Kubernetes 1.7 it has been possible
33
- to route "external" traffic to the Pods running on the Node that received the
34
- traffic, but this is not supported for ` ClusterIP ` Services, and more complex
35
- topologies &mdash ; such as routing zonally &mdash ; have not been possible. The
36
- _ Service Topology_ feature resolves this by allowing the Service creator to
37
- define a policy for routing traffic based upon the Node labels for the
38
- originating and destination Nodes.
39
-
40
- By using Node label matching between the source and destination, the operator
41
- may designate groups of Nodes that are "closer" and "farther" from one another,
42
- using whatever metric makes sense for that operator's requirements. For many
43
- operators in public clouds, for example, there is a preference to keep service
44
- traffic within the same zone, because interzonal traffic has a cost associated
45
- with it, while intrazonal traffic does not. Other common needs include being able
46
- to route traffic to a local Pod managed by a DaemonSet, or keeping traffic to
47
- Nodes connected to the same top-of-rack switch for the lowest latency.
48
-
20
+ ## はじめに
49
21
50
- ## Using Service Topology
22
+ デフォルトでは、 ` ClusterIP ` や ` NodePort ` Serviceに送信されたトラフィックは、Serviceに対応する任意のバックエンドのアドレスにルーティングされる可能性があります。しかし、Kubernetes 1.7以降では、「外部の」トラフィックをそのトラフィックを受信したノード上のPodにルーティングすることが可能になりました。しかし、この機能は ` ClusterIP ` Serviceでは対応しておらず、ゾーン内ルーティングなどのより複雑なトポロジーは実現不可能でした。 * Serviceトポロジー * の機能を利用すれば、Serviceの作者が送信元ノードと送信先ノードのNodeのラベルに基づいてトラフィックをルーティングするためのポリシーを定義できるようになるため、この問題を解決できます。
51
23
52
- If your cluster has Service Topology enabled, you can control Service traffic
53
- routing by specifying the ` topologyKeys ` field on the Service spec. This field
54
- is a preference-order list of Node labels which will be used to sort endpoints
55
- when accessing this Service. Traffic will be directed to a Node whose value for
56
- the first label matches the originating Node's value for that label. If there is
57
- no backend for the Service on a matching Node, then the second label will be
58
- considered, and so forth, until no labels remain.
24
+ 送信元と送信先の間のNodeラベルのマッチングを使用することにより、オペレーターは、そのオペレーターの要件に適したメトリクスを使用して、お互いに「より近い」または「より遠い」ノードのグループを指定できます。たとえば、パブリッククラウド上のさまざまなオペレーターでは、Serviceのトラフィックを同一ゾーン内に留めようとする傾向があります。パブリッククラウドでは、ゾーンをまたぐトラフィックでは関連するコストがかかる一方、ゾーン内のトラフィックにはコストがかからない場合があるからです。その他のニーズとしては、DaemonSetが管理するローカルのPodにトラフィックをルーティングできるようにしたり、レイテンシーを低く抑えるために同じラック上のスイッチに接続されたノードにトラフィックを限定したいというものがあります。
59
25
60
- If no match is found, the traffic will be rejected, just as if there were no
61
- backends for the Service at all. That is, endpoints are chosen based on the first
62
- topology key with available backends. If this field is specified and all entries
63
- have no backends that match the topology of the client, the service has no
64
- backends for that client and connections should fail. The special value ` "*" ` may
65
- be used to mean "any topology". This catch-all value, if used, only makes sense
66
- as the last value in the list.
26
+ ## Serviceトポロジーを利用する
67
27
68
- If ` topologyKeys ` is not specified or empty, no topology constraints will be applied.
28
+ クラスターのServiceトポロジーが有効になっていれば、Serviceのspecに ` topologyKeys ` フィールドを指定することで、Serviceのトラフィックのルーティングを制御できます。このフィールドは、Nodeラベルの優先順位リストで、このServiceにアクセスするときにエンドポイントをソートするために使われます。Traffic will be directed to a Node whose value for the first label matches the originating Node's value for that label.一致したノード上にServiceに対応するバックエンドが存在しなかった場合は、2つ目のラベルについて検討が行われ、同様に、残っているラベルが順番に検討されまます。
69
29
70
- Consider a cluster with Nodes that are labeled with their hostname, zone name,
71
- and region name. Then you can set the ` topologyKeys ` values of a service to direct
72
- traffic as follows.
30
+ 一致するキーが1つも見つからなかった場合、トラフィックは、Serviceに対応するバックエンドが存在しなかったかのように拒否されます。言い換えると、エンドポイントは、利用可能なバックエンドが存在する最初のトポロジーキーに基づいて選択されます。このフィールドが指定され、すべてのエントリーでクライアントのトポロジーに一致するバックエンドが存在しない場合、そのクライアントに対するバックエンドが存在しないものとしてコネクションが失敗します。「任意のトポロジー」を意味する特別な値` "*" ` を指定することもできます。任意の値にマッチするこの値に意味があるのは、リストの最後の値として使った場合だけです。
73
31
74
- * Only to endpoints on the same node, failing if no endpoint exists on the node:
75
- ` ["kubernetes.io/hostname"] ` .
76
- * Preferentially to endpoints on the same node, falling back to endpoints in the
77
- same zone, followed by the same region, and failing otherwise: `[ "kubernetes.io/hostname",
78
- "topology.kubernetes.io/zone", "topology.kubernetes.io/region"] `.
79
- This may be useful, for example, in cases where data locality is critical.
80
- * Preferentially to the same zone, but fallback on any available endpoint if
81
- none are available within this zone:
82
- ` ["topology.kubernetes.io/zone", "*"] ` .
32
+ ` topologyKeys ` が未指定または空の場合、トポロジーの制約は適用されません。
83
33
34
+ ホスト名、ゾーン名、リージョン名のラベルが付いたノードを持つクラスターについて考えてみましょう。このとき、Serviceの` topologyKeys ` の値を設定することで、トラフィックの向きを以下のように制御できます。
84
35
36
+ * トラフィックを同じノード上のエンドポイントのみに向け、同じノード上にエンドポイントが1つも存在しない場合には失敗するようにする: ` ["kubernetes.io/hostname"] ` 。
37
+ * 同一ノード上のエンドポイントを優先し、失敗した場合には同一ゾーン上のエンドポイント、同一リージョンゾーンのエンドポイントへとフォールバックし、それ以外の場合には失敗する: ` ["kubernetes.io/hostname", "topology.kubernetes.io/zone", "topology.kubernetes.io/region"] ` 。これは、たとえばデータのローカリティが非常に重要である場合などに役に立ちます。
38
+ * 同一ゾーンを優先しますが、ゾーン内に利用可能なノードが存在しない場合は、利用可能な任意のエンドポイントにフォールバックする: ` ["topology.kubernetes.io/zone", "*"] ` 。
85
39
86
- ## Constraints
40
+ ## 制約
87
41
88
- * Service topology is not compatible with ` externalTrafficPolicy=Local ` , and
89
- therefore a Service cannot use both of these features. It is possible to use
90
- both features in the same cluster on different Services, just not on the same
91
- Service.
42
+ * Serviceトポロジーは` externalTrafficPolicy=Local ` と互換性がないため、Serviceは2つの機能を同時に利用できません。2つの機能を同じクラスター上の異なるServiceでそれぞれ利用することは可能ですが、同一のService上では利用できません。
92
43
93
- * Valid topology keys are currently limited to ` kubernetes.io/hostname ` ,
94
- ` topology.kubernetes.io/zone ` , and ` topology.kubernetes.io/region ` , but will
95
- be generalized to other node labels in the future.
44
+ * 有効なトポロジーキーは、現在は` kubernetes.io/hostname ` 、` topology.kubernetes.io/zone ` 、および` topology.kubernetes.io/region ` に限定されています。しかし、将来は一般化され、他のノードラベルも使用できるようになる予定です。
96
45
97
- * Topology keys must be valid label keys and at most 16 keys may be specified.
46
+ * トポロジーキーは有効なラベルのキーでなければならず、最大で16個のキーまで指定できます。
98
47
99
- * The catch-all value, ` "*" ` , must be the last value in the topology keys, if
100
- it is used.
48
+ * すべての値をキャッチする` "*" ` を使用する場合は、トポロジーキーの最後の値として指定しなければなりません。
101
49
50
+ ## 例
102
51
103
- ## Examples
52
+ 以下では、Serviceトポロジーの機能を利用したよくある例を紹介します。
104
53
105
- The following are common examples of using the Service Topology feature.
54
+ ### ノードローカルのエンドポイントだけを使用する
106
55
107
- ### Only Node Local Endpoints
108
-
109
- A Service that only routes to node local endpoints. If no endpoints exist on the node, traffic is dropped:
56
+ ノードローカルのエンドポイントのみにルーティングするServiceの例です。もし同一ノード上にエンドポイントが存在しない場合、トラフィックは損失します。
110
57
111
58
``` yaml
112
59
apiVersion : v1
124
71
- " kubernetes.io/hostname"
125
72
` ` `
126
73
127
- ### Prefer Node Local Endpoints
74
+ ### ノードローカルのエンドポイントを優先して使用する
128
75
129
- A Service that prefers node local Endpoints but falls back to cluster wide endpoints if node local endpoints do not exist:
76
+ ノードローカルのエンドポイントを優先して使用しますが、ノードローカルのエンドポイントが存在しない場合にはクラスター全体のエンドポイントにフォールバックするServiceの例です。
130
77
131
78
` ` ` yaml
132
79
apiVersion : v1
@@ -146,10 +93,9 @@ spec:
146
93
` ` `
147
94
148
95
149
- ### Only Zonal or Regional Endpoints
150
-
151
- A Service that prefers zonal then regional endpoints. If no endpoints exist in either, traffic is dropped.
96
+ ### 同一ゾーンや同一リージョンのエンドポイントだけを使用する
152
97
98
+ 同一リージョンのエンドポイントより同一ゾーンのエンドポイントを優先するServiceの例です。もしいずれのエンドポイントも存在しない場合、トラフィックは損失します。
153
99
154
100
` ` ` yaml
155
101
apiVersion : v1
@@ -168,9 +114,9 @@ spec:
168
114
- " topology.kubernetes.io/region"
169
115
` ` `
170
116
171
- ### Prefer Node Local, Zonal, then Regional Endpoints
117
+ ### ノードローカル、同一ゾーン、同一リーションのエンドポイントを優先して使用する
172
118
173
- A Service that prefers node local, zonal, then regional endpoints but falls back to cluster wide endpoints.
119
+ ノードローカル、同一ゾーン、同一リージョンのエンドポイントを順番に優先し、クラスター全体のエンドポイントにフォールバックするServiceの例です。
174
120
175
121
` ` ` yaml
176
122
apiVersion : v1
@@ -191,13 +137,9 @@ spec:
191
137
- " *"
192
138
` ` `
193
139
194
-
195
-
196
-
197
140
## {{% heading "whatsnext" %}}
198
141
199
-
200
- * Read about [enabling Service Topology](/docs/tasks/administer-cluster/enabling-service-topology)
201
- * Read [Connecting Applications with Services](/docs/concepts/services-networking/connect-applications-service/)
142
+ * [Serviceトポトジーを有効にする](/docs/tasks/administer-cluster/enabling-service-topology)を読む。
143
+ * [アプリケーションをServiceと接続する](/ja/docs/concepts/services-networking/connect-applications-service/)を読む。
202
144
203
145
0 commit comments