replace zh to /zh in content/zh/docs/tutorials/ directory

This commit is contained in:
tanjunchen
2020-04-10 10:50:57 +08:00
parent 5888082a2f
commit cb5a3cd3f2
11 changed files with 374 additions and 382 deletions
@@ -26,21 +26,21 @@ external IP address.
{{% capture prerequisites %}}
<!--
* Install [kubectl](zh/docs/tasks/tools/install-kubectl/).
* Install [kubectl](/docs/tasks/tools/install-kubectl/).
* Use a cloud provider like Google Kubernetes Engine or Amazon Web Services to
create a Kubernetes cluster. This tutorial creates an
[external load balancer](zh/docs/tasks/access-application-cluster/create-external-load-balancer/),
[external load balancer](/docs/tasks/access-application-cluster/create-external-load-balancer/),
which requires a cloud provider.
* Configure `kubectl` to communicate with your Kubernetes API server. For
instructions, see the documentation for your cloud provider.
-->
* 安装 [kubectl](zh/docs/tasks/tools/install-kubectl/).
* 安装 [kubectl](/zh/docs/tasks/tools/install-kubectl/).
* 使用 Google Kubernetes Engine 或 Amazon Web Services 等云供应商创建 Kubernetes 群集。
本教程创建了一个[外部负载均衡器](zh/docs/tasks/access-application-cluster/create-external-load-balancer/),需要云供应商。
本教程创建了一个[外部负载均衡器](/zh/docs/tasks/access-application-cluster/create-external-load-balancer/),需要云供应商。
* 配置 `kubectl` 与 Kubernetes API 服务器通信。有关说明,请参阅云供应商文档。
@@ -79,16 +79,16 @@ external IP address.
<!--
The preceding command creates a
[Deployment](zh/docs/concepts/workloads/controllers/deployment/)
[Deployment](/docs/concepts/workloads/controllers/deployment/)
object and an associated
[ReplicaSet](zh/docs/concepts/workloads/controllers/replicaset/)
[ReplicaSet](/docs/concepts/workloads/controllers/replicaset/)
object. The ReplicaSet has five
[Pods](zh/docs/concepts/workloads/pods/pod/),
[Pods](/docs/concepts/workloads/pods/pod/),
each of which runs the Hello World application.
-->
前面的命令创建一个 [Deployment](zh/docs/concepts/workloads/controllers/deployment/)
对象和一个关联的 [ReplicaSet](zh/docs/concepts/workloads/controllers/replicaset/)对象。
ReplicaSet 有五个 [Pod](zh/docs/concepts/workloads/pods/pod/),每个都运行 Hello World 应用程序。
前面的命令创建一个 [Deployment](/zh/docs/concepts/workloads/controllers/deployment/)
对象和一个关联的 [ReplicaSet](/zh/docs/concepts/workloads/controllers/replicaset/)对象。
ReplicaSet 有五个 [Pod](/zh/docs/concepts/workloads/pods/pod/),每个都运行 Hello World 应用程序。
<!--
1. Display information about the Deployment:
@@ -169,8 +169,8 @@ external IP address.
记下服务公开的外部 IP 地址(`LoadBalancer Ingress`)。
在本例中,外部 IP 地址是 104.198.205.71。还要注意 `Port``NodePort` 的值。
在本例中,`Port` 是 8080`NodePort` 是32377。
<!--
1. In the preceding output, you can see that the service has several endpoints:
10.0.0.6:8080,10.0.1.6:8080,10.0.1.7:8080 + 2 more. These are internal
@@ -214,8 +214,8 @@ external IP address.
其中 `<external-ip>` 是您的服务的外部 IP 地址(`LoadBalancer Ingress`),
`<port>` 是您的服务描述中的 `port` 的值。
如果您正在使用 minikube,输入 `minikube service my-service` 将在浏览器中自动打开 Hello World 应用程序。
<!--
<!--
The response to a successful request is a hello message:
-->
成功请求的响应是一条问候消息:
@@ -249,9 +249,9 @@ the Hello World application, enter this command:
<!--
Learn more about
[connecting applications with services](zh/docs/concepts/services-networking/connect-applications-service/).
[connecting applications with services](/docs/concepts/services-networking/connect-applications-service/).
-->
了解更多关于[将应用程序与服务连接](zh/docs/concepts/services-networking/connect-applications-service/)。
了解更多关于[将应用程序与服务连接](/zh/docs/concepts/services-networking/connect-applications-service/)。
{{% /capture %}}
@@ -25,8 +25,8 @@ This tutorial shows you how to build and deploy a simple, multi-tier web applica
一个简单的多层 web 应用程序。本例由以下组件组成:
<!--
* A single-instance [Redis](https://redis.io/) master to store guestbook entries
* Multiple [replicated Redis](https://redis.io/topics/replication) instances to serve reads
* A single-instance [Redis](https://redis.io/) master to store guestbook entries
* Multiple [replicated Redis](https://redis.io/topics/replication) instances to serve reads
* Multiple web frontend instances
-->
@@ -143,14 +143,14 @@ Replace POD-NAME with the name of your Pod.
### 创建 Redis 主节点的服务
<!--
The guestbook applications needs to communicate to the Redis master to write its data. You need to apply a [Service](zh/docs/concepts/services-networking/service/) to proxy the traffic to the Redis master Pod. A Service defines a policy to access the Pods.
The guestbook applications needs to communicate to the Redis master to write its data. You need to apply a [Service](/docs/concepts/services-networking/service/) to proxy the traffic to the Redis master Pod. A Service defines a policy to access the Pods.
-->
留言板应用程序需要往 Redis 主节点中写数据。因此,需要创建 [Service](zh/docs/concepts/services-networking/service/) 来代理 Redis 主节点 Pod 的流量。Service 定义了访问 Pod 的策略。
留言板应用程序需要往 Redis 主节点中写数据。因此,需要创建 [Service](/zh/docs/concepts/services-networking/service/) 来代理 Redis 主节点 Pod 的流量。Service 定义了访问 Pod 的策略。
{{< codenew file="application/guestbook/redis-master-service.yaml" >}}
<!--
1. Apply the Redis Master Service from the following `redis-master-service.yaml` file:
1. Apply the Redis Master Service from the following `redis-master-service.yaml` file:
-->
1. 使用下面的 `redis-master-service.yaml` 文件创建 Redis 主节点的服务:
@@ -181,7 +181,7 @@ The guestbook applications needs to communicate to the Redis master to write its
{{< note >}}
<!--
This manifest file creates a Service named `redis-master` with a set of labels that match the labels previously defined, so the Service routes network traffic to the Redis master Pod.
This manifest file creates a Service named `redis-master` with a set of labels that match the labels previously defined, so the Service routes network traffic to the Redis master Pod.
-->
这个清单文件创建了一个名为 `Redis-master` 的 Service,其中包含一组与前面定义的标签匹配的标签,因此服务将网络流量路由到 Redis 主节点 Pod 上。
@@ -205,12 +205,12 @@ Although the Redis master is a single pod, you can make it highly available to m
### 创建 Redis 从节点 Deployment
<!--
Deployments scale based off of the configurations set in the manifest file. In this case, the Deployment object specifies two replicas.
Deployments scale based off of the configurations set in the manifest file. In this case, the Deployment object specifies two replicas.
-->
Deployments 根据清单文件中设置的配置进行伸缩。在这种情况下,Deployment 对象指定两个副本。
<!--
If there are not any replicas running, this Deployment would start the two replicas on your container cluster. Conversely, if there are more than two replicas are running, it would scale down until two replicas are running.
If there are not any replicas running, this Deployment would start the two replicas on your container cluster. Conversely, if there are more than two replicas are running, it would scale down until two replicas are running.
-->
如果没有任何副本正在运行,则此 Deployment 将启动容器集群上的两个副本。相反,
如果有两个以上的副本在运行,那么它的规模就会缩小,直到运行两个副本为止。
@@ -349,20 +349,20 @@ The guestbook application has a web frontend serving the HTTP requests written i
### 创建前端服务
<!--
The `redis-slave` and `redis-master` Services you applied are only accessible within the container cluster because the default type for a Service is [ClusterIP](zh/docs/concepts/services-networking/service/#publishing-services---service-types). `ClusterIP` provides a single IP address for the set of Pods the Service is pointing to. This IP address is accessible only within the cluster.
The `redis-slave` and `redis-master` Services you applied are only accessible within the container cluster because the default type for a Service is [ClusterIP](/docs/concepts/services-networking/service/#publishing-services---service-types). `ClusterIP` provides a single IP address for the set of Pods the Service is pointing to. This IP address is accessible only within the cluster.
-->
应用的 `redis-slave` 和 `redis-master` 服务只能在容器集群中访问,因为服务的默认类型是
[ClusterIP](zh/docs/concepts/Services-networking/Service/#publishingservices-Service-types)。`ClusterIP` 为服务指向的 Pod 集提供一个 IP 地址。这个 IP 地址只能在集群中访问。
[ClusterIP](/zh/docs/concepts/Services-networking/Service/#publishingservices-Service-types)。`ClusterIP` 为服务指向的 Pod 集提供一个 IP 地址。这个 IP 地址只能在集群中访问。
<!--
If you want guests to be able to access your guestbook, you must configure the frontend Service to be externally visible, so a client can request the Service from outside the container cluster. Minikube can only expose Services through `NodePort`.
If you want guests to be able to access your guestbook, you must configure the frontend Service to be externally visible, so a client can request the Service from outside the container cluster. Minikube can only expose Services through `NodePort`.
-->
如果您希望客人能够访问您的留言板,您必须将前端服务配置为外部可见的,以便客户机可以从容器集群之外请求服务。Minikube 只能通过 `NodePort` 公开服务。
{{< note >}}
<!--
Some cloud providers, like Google Compute Engine or Google Kubernetes Engine, support external load balancers. If your cloud provider supports load balancers and you want to use it, simply delete or comment out `type: NodePort`, and uncomment `type: LoadBalancer`.
Some cloud providers, like Google Compute Engine or Google Kubernetes Engine, support external load balancers. If your cloud provider supports load balancers and you want to use it, simply delete or comment out `type: NodePort`, and uncomment `type: LoadBalancer`.
-->
一些云提供商,如 Google Compute Engine 或 Google Kubernetes Engine,支持外部负载均衡器。如果您的云提供商支持负载均衡器,并且您希望使用它,
只需删除或注释掉 `type: NodePort`,并取消注释 `type: LoadBalancer` 即可。
@@ -386,14 +386,14 @@ Some cloud providers, like Google Compute Engine or Google Kubernetes Engine, su
2. 查询服务列表以验证前端服务正在运行:
```shell
kubectl get services
kubectl get services
```
<!--
The response should be similar to this:
-->
响应应该与此类似:
```
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
frontend ClusterIP 10.0.0.112 <none> 80:31323/TCP 6s
@@ -472,7 +472,7 @@ If you deployed the `frontend-service.yaml` manifest with type: `LoadBalancer` y
2. 复制外部 IP 地址,然后在浏览器中加载页面以查看留言板。
<!--
## Scale the Web Frontend
## Scale the Web Frontend
-->
## 扩展 Web 前端
@@ -501,7 +501,7 @@ Scaling up or down is easy because your servers are defined as a Service that us
```
<!--
The response should look similar to this:
The response should look similar to this:
-->
响应应该类似于这样:
@@ -548,7 +548,7 @@ Scaling up or down is easy because your servers are defined as a Service that us
redis-slave-2005841000-fpvqc 1/1 Running 0 1h
redis-slave-2005841000-phfv9 1/1 Running 0 1h
```
{{% /capture %}}
{{% capture cleanup %}}
@@ -580,7 +580,7 @@ Deleting the Deployments and Services also deletes any running Pods. Use labels
deployment.apps "redis-slave" deleted
service "redis-master" deleted
service "redis-slave" deleted
deployment.apps "frontend" deleted
deployment.apps "frontend" deleted
service "frontend" deleted
```
@@ -594,9 +594,9 @@ Deleting the Deployments and Services also deletes any running Pods. Use labels
```
<!--
The response should be this:
The response should be this:
-->
响应应该是:
响应应该是:
```
No resources found.
@@ -607,16 +607,16 @@ Deleting the Deployments and Services also deletes any running Pods. Use labels
{{% capture whatsnext %}}
<!--
* Complete the [Kubernetes Basics](zh/docs/tutorials/kubernetes-basics/) Interactive Tutorials
* Use Kubernetes to create a blog using [Persistent Volumes for MySQL and Wordpress](zh/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/#visit-your-new-wordpress-blog)
* Read more about [connecting applications](zh/docs/concepts/services-networking/connect-applications-service/)
* Read more about [Managing Resources](zh/docs/concepts/cluster-administration/manage-deployment/#using-labels-effectively)
* Complete the [Kubernetes Basics](/docs/tutorials/kubernetes-basics/) Interactive Tutorials
* Use Kubernetes to create a blog using [Persistent Volumes for MySQL and Wordpress](/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/#visit-your-new-wordpress-blog)
* Read more about [connecting applications](/docs/concepts/services-networking/connect-applications-service/)
* Read more about [Managing Resources](/docs/concepts/cluster-administration/manage-deployment/#using-labels-effectively)
-->
* 完成 [Kubernetes Basics](zh/docs/tutorials/kubernetes-basics/) 交互式教程
* 使用 Kubernetes 创建一个博客,使用 [MySQL 和 Wordpress 的持久卷](zh/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/#visit-your-new-wordpress-blog)
* 阅读更多关于[连接应用程序](zh/docs/concepts/services-networking/connect-applications-service/)
* 阅读更多关于[管理资源](zh/docs/concepts/cluster-administration/manage-deployment/#using-labels-effectively)
* 完成 [Kubernetes Basics](/zh/docs/tutorials/kubernetes-basics/) 交互式教程
* 使用 Kubernetes 创建一个博客,使用 [MySQL 和 Wordpress 的持久卷](/zh/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/#visit-your-new-wordpress-blog)
* 阅读更多关于[连接应用程序](/zh/docs/concepts/services-networking/connect-applications-service/)
* 阅读更多关于[管理资源](/zh/docs/concepts/cluster-administration/manage-deployment/#using-labels-effectively)
{{% /capture %}}