Skip to content

Commit 642ae56

Browse files
authored
[zh] Update access-cluster-services.md (#32199)
* [zh] Update access-cluster-services.md [zh] Update access-cluster-services.md * Update access-cluster-services.md
1 parent 615e48d commit 642ae56

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

content/zh/docs/tasks/administer-cluster/access-cluster-services.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,17 @@ See [Access Clusters Using the Kubernetes API](/docs/tasks/administer-cluster/ac
151151
As mentioned above, you use the `kubectl cluster-info` command to retrieve the service's proxy URL. To create proxy URLs that include service endpoints, suffixes, and parameters, you append to the service's proxy URL:
152152
`http://`*`kubernetes_master_address`*`/api/v1/namespaces/`*`namespace_name`*`/services/`*`[https:]service_name[:port_name]`*`/proxy`
153153
154-
If you haven't specified a name for your port, you don't have to specify *port_name* in the URL.
154+
If you haven't specified a name for your port, you don't have to specify *port_name* in the URL. You can also use the port number in place of the *port_name* for both named and unnamed ports.
155+
156+
By default, the API server proxies to your service using HTTP. To use HTTPS, prefix the service name with `https:`:
157+
`http://<kubernetes_master_address>/api/v1/namespaces/<namespace_name>/services/<service_name>/proxy`
158+
159+
The supported formats for the `<service_name>` segment of the URL are:
160+
161+
* `<service_name>` - proxies to the default or unnamed port using http
162+
* `<service_name>:<port_name>` - proxies to the specified port name or port number using http
163+
* `https:<service_name>:` - proxies to the default or unnamed port using https (note the trailing colon)
164+
* `https:<service_name>:<port_name>` - proxies to the specified port name or port number using https
155165
-->
156166
#### 手动构建 API 服务器代理 URLs {#manually-constructing-apiserver-proxy-urls}
157167

@@ -160,6 +170,15 @@ If you haven't specified a name for your port, you don't have to specify *port_n
160170
`http://`*`kubernetes_master_address`*`/api/v1/namespaces/`*`namespace_name`*`/services/`*`service_name[:port_name]`*`/proxy`
161171

162172
如果还没有为你的端口指定名称,你可以不用在 URL 中指定 *port_name*
173+
对于命名和未命名端口,你还可以使用端口号代替 *port_name*
174+
175+
默认情况下,API 服务器使用 HTTP 为你的服务提供代理。 要使用 HTTPS,请在服务名称前加上 `https:`
176+
`http://<kubernetes_master_address>/api/v1/namespaces/<namespace_name>/services/<service_name>/proxy`
177+
URL 的 `<service_name>` 段支持的格式为:
178+
* `<service_name>` - 使用 http 代理到默认或未命名端口
179+
* `<service_name>:<port_name>` - 使用 http 代理到指定的端口名称或端口号
180+
* `https:<service_name>:` - 使用 https 代理到默认或未命名端口(注意尾随冒号)
181+
* `https:<service_name>:<port_name>` - 使用 https 代理到指定的端口名称或端口号
163182

164183
<!--
165184
##### Examples

0 commit comments

Comments
 (0)