@@ -20,23 +20,18 @@ external IP address.
20
20
## {{% heading "prerequisites" %}}
21
21
22
22
<!--
23
- * Install [kubectl](/docs/tasks/tools/install-kubectl/).
24
-
25
- * Use a cloud provider like Google Kubernetes Engine or Amazon Web Services to
26
- create a Kubernetes cluster. This tutorial creates an
27
- [external load balancer](/docs/tasks/access-application-cluster/create-external-load-balancer/),
28
- which requires a cloud provider.
29
-
30
- * Configure `kubectl` to communicate with your Kubernetes API server. For
31
- instructions, see the documentation for your cloud provider.
23
+ * Install [kubectl](/docs/tasks/tools/install-kubectl/).
24
+ * Use a cloud provider like Google Kubernetes Engine or Amazon Web Services to
25
+ create a Kubernetes cluster. This tutorial creates an
26
+ [external load balancer](/docs/tasks/access-application-cluster/create-external-load-balancer/),
27
+ which requires a cloud provider.
28
+ * Configure `kubectl` to communicate with your Kubernetes API server. For instructions, see the
29
+ documentation for your cloud provider.
32
30
-->
33
-
34
31
* 安装 [ kubectl] ( /zh/docs/tasks/tools/install-kubectl/ ) .
35
-
36
32
* 使用 Google Kubernetes Engine 或 Amazon Web Services 等云供应商创建 Kubernetes 集群。
37
33
本教程创建了一个[ 外部负载均衡器] ( /zh/docs/tasks/access-application-cluster/create-external-load-balancer/ ) ,
38
34
需要云供应商。
39
-
40
35
* 配置 ` kubectl ` 与 Kubernetes API 服务器通信。有关说明,请参阅云供应商文档。
41
36
42
37
## {{% heading "objectives" %}}
@@ -68,7 +63,6 @@ external IP address.
68
63
``` shell
69
64
kubectl apply -f https://k8s.io/examples/service/load-balancer-example.yaml
70
65
```
71
-
72
66
<!--
73
67
The preceding command creates a
74
68
{{< glossary_tooltip text="Deployment" term_id="deployment" >}}
@@ -128,9 +122,9 @@ external IP address.
128
122
-->
129
123
输出类似于:
130
124
131
- ```
132
- NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
133
- my-service ClusterIP 10.3.245.137 104.198.205.71 8080/TCP 54s
125
+ ``` console
126
+ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
127
+ my-service LoadBalancer 10.3.245.137 104.198.205.71 8080/TCP 54s
134
128
```
135
129
136
130
<!--
@@ -162,12 +156,12 @@ external IP address.
162
156
-->
163
157
输出类似于:
164
158
165
- ```
159
+ ``` console
166
160
Name: my-service
167
161
Namespace: default
168
- Labels: run =load-balancer-example
162
+ Labels: app.kubernetes.io/name =load-balancer-example
169
163
Annotations: <none>
170
- Selector: run =load-balancer-example
164
+ Selector: app.kubernetes.io/name =load-balancer-example
171
165
Type: LoadBalancer
172
166
IP: 10.3.245.137
173
167
LoadBalancer Ingress: 104.198.205.71
@@ -207,7 +201,7 @@ external IP address.
207
201
-->
208
202
输出类似于:
209
203
210
- ```
204
+ ``` console
211
205
NAME ... IP NODE
212
206
hello-world-2895499144-1jaz9 ... 10.0.1.6 gke-cluster-1-default-pool-e0b8d269-1afc
213
207
hello-world-2895499144-2e5uh ... 10.0.1.8 gke-cluster-1-default-pool-e0b8d269-1afc
@@ -241,7 +235,7 @@ external IP address.
241
235
-->
242
236
成功请求的响应是一条问候消息:
243
237
244
- ```
238
+ ``` shell
245
239
Hello Kubernetes!
246
240
```
247
241
0 commit comments