Skip to content

Commit

Permalink
Merge pull request kubernetes#37934 from windsonsea/seracc
Browse files Browse the repository at this point in the history
[zh] sync service-access-application-cluster.md
  • Loading branch information
k8s-ci-robot authored Nov 19, 2022
2 parents c7660fb + 92c9f66 commit 31b78c8
Showing 1 changed file with 16 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ title: 使用服务来访问集群中的应用
content_type: tutorial
weight: 60
---

<!--
title: Use a Service to Access an Application in a Cluster
content_type: tutorial
Expand Down Expand Up @@ -32,7 +31,7 @@ provides load balancing for an application that has two running instances.
* Use the Service object to access the running application.
-->
* 运行 Hello World 应用的两个实例。
* 创建一个服务对象来暴露 node port
* 创建一个服务对象来暴露 NodePort
* 使用服务对象来访问正在运行的应用。

<!-- lessoncontent -->
Expand All @@ -51,23 +50,23 @@ Here is the configuration file for the application Deployment:
<!--
1. Run a Hello World application in your cluster:
Create the application Deployment using the file above:
-->
1. 在你的集群中运行一个 Hello World 应用。
使用上面的文件创建应用程序 Deployment:

```shell
kubectl apply -f https://k8s.io/examples/service/access/hello-application.yaml
```

<!--
The preceding command creates a
{{< glossary_tooltip text="Deployment" term_id="deployment" >}}
and an associated
{{< glossary_tooltip term_id="replica-set" text="ReplicaSet" >}}.
The ReplicaSet has two
{{< glossary_tooltip text="Pods" term_id="pod" >}}
each of which runs the Hello World application.
-->
1. 在你的集群中运行一个 Hello World 应用:
使用上面的文件创建应用程序 Deployment:

```shell
kubectl apply -f https://k8s.io/examples/service/access/hello-application.yaml
```
-->

上面的命令创建一个
{{< glossary_tooltip text="Deployment" term_id="deployment" >}} 对象
Expand Down Expand Up @@ -118,7 +117,7 @@ Here is the configuration file for the application Deployment:
-->
输出类似于:

```shell
```
Name: example-service
Namespace: default
Labels: run=load-balancer-example
Expand All @@ -138,7 +137,7 @@ Here is the configuration file for the application Deployment:
Make a note of the NodePort value for the service. For example,
in the preceding output, the NodePort value is 31496.
-->
注意服务中的 NodePort 值。例如在上面的输出中,NodePort 31496。
注意服务中的 NodePort 值。例如在上面的输出中,NodePort 值是 31496。

<!--
1. List the pods that are running the Hello World application:
Expand All @@ -152,9 +151,10 @@ Here is the configuration file for the application Deployment:
<!--
The output is similar to this:
-->

输出类似于:

```shell
```
NAME READY STATUS ... IP NODE
hello-world-2895499144-bsbk5 1/1 Running ... 10.200.1.4 worker1
hello-world-2895499144-m1pwt 1/1 Running ... 10.200.2.5 worker2
Expand Down Expand Up @@ -238,8 +238,9 @@ kubectl delete deployment hello-world
## {{% heading "whatsnext" %}}

<!--
Learn more about
[connecting applications with services](/docs/concepts/services-networking/connect-applications-service/).
Follow the
[Connecting Applications with Services](/docs/tutorials/services/connect-applications-service/)
tutorial.
-->
进一步了解[通过服务连接应用](/zh-cn/docs/concepts/services-networking/connect-applications-service/)
跟随教程[使用 Service 连接到应用](/zh-cn/docs/tutorials/services/connect-applications-service/)

0 comments on commit 31b78c8

Please sign in to comment.