Skip to content

Commit 8d87442

Browse files
authored
Merge pull request #42871 from my-git9/mixed-version-proxy2
[zh-cn] sync architecture/mixed-version-proxy.md
2 parents b8053ea + da580be commit 8d87442

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

content/zh-cn/docs/concepts/architecture/mixed-version-proxy.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ To set the network location of a kube-apiserver that peers will use to proxy req
120120
`--peer-advertise-ip` and `--peer-advertise-port` command line arguments to kube-apiserver or specify
121121
these fields in the API server configuration file.
122122
If these flags are unspecified, peers will use the value from either `--advertise-address` or
123-
`--bind-address` command line argument to the kube-apiserver. If those too, are unset, the host's default interface is used.
123+
`--bind-address` command line argument to the kube-apiserver.
124+
If those too, are unset, the host's default interface is used.
124125
-->
125126
### 对等 API 服务器连接的配置 {#config-for-peer-apiserver-connectivity}
126127

@@ -160,15 +161,18 @@ loads a special filter that does the following:
160161
### How it works under the hood
161162
162163
When an API Server receives a resource request, it first checks which API servers can
163-
serve the requested resource. This check happens using the internal `StorageVersion` API.
164+
serve the requested resource. This check happens using the internal
165+
[`StorageVersion` API](/docs/reference/generated/kubernetes-api/v{{< skew currentVersion >}}/#storageversioncondition-v1alpha1-internal-apiserver-k8s-io).
164166
165167
* If the resource is known to the API server that received the request
166168
(for example, `GET /api/v1/pods/some-pod`), the request is handled locally.
167169
-->
168170
### 内部工作原理 {#how-it-works-under-the-hood}
169171

170172
当 API 服务器收到一个资源请求时,它首先检查哪些 API 服务器可以提供所请求的资源。
171-
这个检查是使用内部的 `StorageVersion` API 进行的。
173+
这个检查是使用内部的
174+
[`StorageVersion` API](/zh-cn/docs/reference/generated/kubernetes-api/v{{< skew currentVersion >}}/#storageversioncondition-v1alpha1-internal-apiserver-k8s-io)
175+
进行的。
172176

173177
* 如果资源被收到请求(例如 `GET /api/v1/pods/some-pod`)的 API 服务器所了解,则请求会在本地处理。
174178

@@ -190,20 +194,24 @@ serve the requested resource. This check happens using the internal `StorageVers
190194
(`api/v1/batch` in this case) using the information in the fetched `StorageVersion` object.
191195
The _handling API server_ then proxies the request to one of the matching peer kube-apiservers
192196
that are aware of the requested resource.
197+
193198
* If there is no peer known for that API group / version / resource, the handling API server
194199
passes the request to its own handler chain which should eventually return a 404 ("Not Found") response.
200+
195201
* If the handling API server has identified and selected a peer API server, but that peer fails
196202
to respond (for reasons such as network connectivity issues, or a data race between the request
197203
being received and a controller registering the peer's info into the control plane), then the handling
198-
API server responds with a 503 (Service Unavailable) error.
204+
API server responds with a 503 ("Service Unavailable") error.
199205
-->
200206
* 如果找到了对应所请求资源(例如 `GET /batch/v1/jobs`)的合法的内部 `StorageVersion` 对象,
201207
并且正在处理请求的 API 服务器(**处理中的 API 服务器**)禁用了 `batch` API,
202-
**正处理的 API 服务器** 使用已获取的 `StorageVersion` 对象中的信息,
208+
**正处理的 API 服务器**使用已获取的 `StorageVersion` 对象中的信息,
203209
获取提供相关 API 组/版本/资源(在此情况下为 `api/v1/batch`)的对等 API 服务器。
204210
**处理中的 API 服务器**随后将请求代理到能够理解所请求资源且匹配的对等 kube-apiserver 之一。
211+
205212
* 如果没有对等方了解所给的 API 组/版本/资源,则处理请求的 API 服务器将请求传递给自己的处理程序链,
206213
最终应返回 404("Not Found")响应。
214+
207215
* 如果处理请求的 API 服务器已经识别并选择了一个对等 API 服务器,但该对等方无法响应
208216
(原因可能是网络连接问题或正接收的请求与向控制平面注册对等信息的控制器之间存在数据竞争等),
209217
则处理请求的 API 服务器会以 503("Service Unavailable")错误进行响应。

0 commit comments

Comments
 (0)