Skip to content

Commit e2f0a29

Browse files
committed
Update custom-resource-definition-versioning.md
1 parent 567eabf commit e2f0a29

File tree

1 file changed

+50
-38
lines changed

1 file changed

+50
-38
lines changed

content/zh-cn/docs/tasks/extend-kubernetes/http-proxy-access-api.md

Lines changed: 50 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ This page shows how to use an HTTP proxy to access the Kubernetes API.
2424
* {{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
2525

2626
<!--
27-
* If you do not already have an application running in your cluster, start
27+
If you do not already have an application running in your cluster, start
2828
a Hello world application by entering this command:
2929
-->
30-
* 如果你的集群中还没有任何应用,使用如下命令启动一个 Hello World 应用:
30+
如果你的集群中还没有任何应用,使用如下命令启动一个 Hello World 应用:
3131

3232
```shell
3333
kubectl create deployment node-hello --image=gcr.io/google-samples/node-hello:1.0 --port=8080
@@ -47,7 +47,9 @@ This command starts a proxy to the Kubernetes API server:
4747
-->
4848
使用如下命令启动 Kubernetes API 服务器的代理:
4949

50-
kubectl proxy --port=8080
50+
```shell
51+
kubectl proxy --port=8080
52+
```
5153

5254
<!--
5355
## Exploring the Kubernetes API
@@ -62,60 +64,70 @@ or a browser.
6264

6365
<!--
6466
Get the API versions:
65-
-->
67+
-->
6668
获取 API 版本:
6769

68-
curl http://localhost:8080/api/
70+
```shell
71+
curl http://localhost:8080/api/
72+
```
6973

7074
<!--
7175
The output should look similar to this:
7276
-->
73-
7477
输出应该类似这样:
7578

79+
```
80+
{
81+
"kind": "APIVersions",
82+
"versions": [
83+
"v1"
84+
],
85+
"serverAddressByClientCIDRs": [
7686
{
77-
"kind": "APIVersions",
78-
"versions": [
79-
"v1"
80-
],
81-
"serverAddressByClientCIDRs": [
82-
{
83-
"clientCIDR": "0.0.0.0/0",
84-
"serverAddress": "10.0.2.15:8443"
85-
}
86-
]
87+
"clientCIDR": "0.0.0.0/0",
88+
"serverAddress": "10.0.2.15:8443"
8789
}
90+
]
91+
}
92+
```
8893

8994
<!--
9095
Get a list of pods:
9196
-->
9297
获取 Pod 列表:
9398

94-
curl http://localhost:8080/api/v1/namespaces/default/pods
99+
```shell
100+
curl http://localhost:8080/api/v1/namespaces/default/pods
101+
```
95102

103+
<!--
104+
The output should look similar to this:
105+
-->
106+
输出应该类似这样:
107+
108+
```
109+
{
110+
"kind": "PodList",
111+
"apiVersion": "v1",
112+
"metadata": {
113+
"resourceVersion": "33074"
114+
},
115+
"items": [
96116
{
97-
"kind": "PodList",
98-
"apiVersion": "v1",
99117
"metadata": {
100-
"resourceVersion": "33074"
101-
},
102-
"items": [
103-
{
104-
"metadata": {
105-
"name": "kubernetes-bootcamp-2321272333-ix8pt",
106-
"generateName": "kubernetes-bootcamp-2321272333-",
107-
"namespace": "default",
108-
"uid": "ba21457c-6b1d-11e6-85f7-1ef9f1dab92b",
109-
"resourceVersion": "33003",
110-
"creationTimestamp": "2016-08-25T23:43:30Z",
111-
"labels": {
112-
"pod-template-hash": "2321272333",
113-
"run": "kubernetes-bootcamp"
114-
},
115-
...
116-
}
117-
118-
118+
"name": "kubernetes-bootcamp-2321272333-ix8pt",
119+
"generateName": "kubernetes-bootcamp-2321272333-",
120+
"namespace": "default",
121+
"uid": "ba21457c-6b1d-11e6-85f7-1ef9f1dab92b",
122+
"resourceVersion": "33003",
123+
"creationTimestamp": "2016-08-25T23:43:30Z",
124+
"labels": {
125+
"pod-template-hash": "2321272333",
126+
"run": "kubernetes-bootcamp"
127+
},
128+
...
129+
}
130+
```
119131

120132
## {{% heading "whatsnext" %}}
121133

0 commit comments

Comments
 (0)