@@ -50,7 +50,7 @@ external IP address.
50
50
<!--
51
51
## Creating a service for an application running in five pods
52
52
-->
53
- ## 为一个在五个 pod 中运行的应用程序创建服务
53
+ ## 为一个在五个 pod 中运行的应用程序创建服务 {#creating-a-service-for-an-app-running-in-five-pods}
54
54
55
55
<!--
56
56
1. Run a Hello World application in your cluster:
@@ -62,6 +62,7 @@ external IP address.
62
62
``` shell
63
63
kubectl apply -f https://k8s.io/examples/service/load-balancer-example.yaml
64
64
```
65
+
65
66
<!--
66
67
The preceding command creates a
67
68
{{< glossary_tooltip text="Deployment" term_id="deployment" >}}
@@ -71,6 +72,7 @@ external IP address.
71
72
{{< glossary_tooltip text="Pods" term_id="pod" >}}
72
73
each of which runs the Hello World application.
73
74
-->
75
+
74
76
前面的命令创建一个
75
77
{{< glossary_tooltip text="Deployment" term_id="deployment" >}}
76
78
对象和一个关联的
@@ -119,27 +121,28 @@ external IP address.
119
121
<!--
120
122
The output is similar to this:
121
123
-->
124
+
122
125
输出类似于:
123
126
124
127
``` console
125
128
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
126
129
my-service LoadBalancer 10.3.245.137 104.198.205.71 8080/TCP 54s
127
130
```
128
131
129
- <!--
130
132
{{< note >}}
133
+ <!--
131
134
The `type=LoadBalancer` service is backed by external cloud providers, which is not covered in this example, please refer to [this page](/docs/concepts/services-networking/service/#loadbalancer) for the details.
132
- {{< /note >}}
133
135
-->
134
- 提示: ` type=LoadBalancer ` 服务由外部云服务提供商提供支持,本例中不包含此部分,
136
+ ` type=LoadBalancer ` 服务由外部云服务提供商提供支持,本例中不包含此部分,
135
137
详细信息请参考[ 此页] ( /zh-cn/docs/concepts/services-networking/service/#loadbalancer )
138
+ {{< /note >}}
136
139
137
- <!--
138
140
{{< note >}}
141
+ <!--
139
142
If the external IP address is shown as \<pending\>, wait for a minute and enter the same command again.
140
- {{< /note >}}
141
143
-->
142
- 提示:如果外部 IP 地址显示为 \< pending\> ,请等待一分钟再次输入相同的命令。
144
+ 如果外部 IP 地址显示为 \< pending\> ,请等待一分钟再次输入相同的命令。
145
+ {{< /note >}}
143
146
144
147
<!--
145
148
1. Display detailed information about the Service:
@@ -153,6 +156,7 @@ external IP address.
153
156
<!--
154
157
The output is similar to this:
155
158
-->
159
+
156
160
输出类似于:
157
161
158
162
``` console
@@ -170,12 +174,14 @@ external IP address.
170
174
Session Affinity: None
171
175
Events: <none>
172
176
```
177
+
173
178
<!--
174
179
Make a note of the external IP address (`LoadBalancer Ingress`) exposed by
175
180
your service. In this example, the external IP address is 104.198.205.71.
176
181
Also note the value of `Port` and `NodePort`. In this example, the `Port`
177
182
is 8080 and the `NodePort` is 32377.
178
183
-->
184
+
179
185
记下服务公开的外部 IP 地址(` LoadBalancer Ingress ` )。
180
186
在本例中,外部 IP 地址是 104.198.205.71。还要注意 ` Port ` 和 ` NodePort ` 的值。
181
187
在本例中,` Port ` 是 8080,` NodePort ` 是 32377。
@@ -198,6 +204,7 @@ external IP address.
198
204
<!--
199
205
The output is similar to this:
200
206
-->
207
+
201
208
输出类似于:
202
209
203
210
``` console
@@ -225,13 +232,16 @@ external IP address.
225
232
If you are using minikube, typing `minikube service my-service` will
226
233
automatically open the Hello World application in a browser.
227
234
-->
235
+
228
236
其中 ` <external-ip> ` 是你的服务的外部 IP 地址(` LoadBalancer Ingress ` ),
229
237
` <port> ` 是你的服务描述中的 ` port ` 的值。
230
- 如果你正在使用 minikube,输入 ` minikube service my-service ` 将在浏览器中自动打开 Hello World 应用程序。
238
+ 如果你正在使用 minikube,输入 ` minikube service my-service `
239
+ 将在浏览器中自动打开 Hello World 应用程序。
231
240
232
241
<!--
233
242
The response to a successful request is a hello message:
234
243
-->
244
+
235
245
成功请求的响应是一条问候消息:
236
246
237
247
``` shell
@@ -253,7 +263,7 @@ kubectl delete services my-service
253
263
To delete the Deployment, the ReplicaSet, and the Pods that are running
254
264
the Hello World application, enter this command:
255
265
-->
256
- 要删除正在运行 Hello World 应用程序的 Deployment, ReplicaSet 和 Pod,请输入以下命令:
266
+ 要删除正在运行 Hello World 应用程序的 Deployment、 ReplicaSet 和 Pod,请输入以下命令:
257
267
258
268
``` shell
259
269
kubectl delete deployment hello-world
@@ -263,7 +273,7 @@ kubectl delete deployment hello-world
263
273
264
274
<!--
265
275
Learn more about
266
- [connecting applications with services](/docs/concepts /services-networking /connect-applications-service/).
276
+ [connecting applications with services](/docs/tutorials /services/connect-applications-service/).
267
277
-->
268
- 进一步了解[ 将应用程序与服务连接 ] ( /zh-cn/docs/concepts /services-networking /connect-applications-service/ ) 。
278
+ 进一步了解[ 使用 Service 连接到应用 ] ( /zh-cn/docs/tutorials /services/connect-applications-service/ ) 。
269
279
0 commit comments