Skip to content

Commit c9b1711

Browse files
authored
Merge pull request #38773 from Zhuzhenghao/fix/ingress
[zh-cn] Sync Ingress with en page
2 parents f828fe7 + ee3a18b commit c9b1711

File tree

1 file changed

+36
-28
lines changed
  • content/zh-cn/docs/concepts/services-networking

1 file changed

+36
-28
lines changed

content/zh-cn/docs/concepts/services-networking/ingress.md

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ For clarity, this guide defines the following terms:
5454
<!--
5555
## What is Ingress?
5656
57-
[Ingress](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#ingress-v1beta1-networking-k8s-io) exposes HTTP and HTTPS routes from outside the cluster to
57+
[Ingress](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#ingress-v1-networking-k8s-io) exposes HTTP and HTTPS routes from outside the cluster to
5858
{{< link text="services" url="/docs/concepts/services-networking/service/" >}} within the cluster.
5959
Traffic routing is controlled by rules defined on the Ingress resource.
6060
-->
6161
## Ingress 是什么? {#what-is-ingress}
6262

63-
[Ingress](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#ingress-v1beta1-networking-k8s-io)
63+
[Ingress](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#ingress-v1-networking-k8s-io)
6464
公开从集群外部到集群内[服务](/zh-cn/docs/concepts/services-networking/service/)
6565
HTTP 和 HTTPS 路由。
6666
流量路由由 Ingress 资源上定义的规则控制。
@@ -73,7 +73,7 @@ Here is a simple example where an Ingress sends all its traffic to one Service:
7373
{{< figure src="/zh-cn/docs/images/ingress.svg" alt="ingress-diagram" class="diagram-large" caption="图. Ingress" link="https://mermaid.live/edit#pako:eNqNkktLAzEQgP9KSC8Ku6XWBxKlJz0IHsQeuz1kN7M2uC-SrA9sb6X26MFLFZGKoCC0CIIn_Td1139halZq8eJlE2a--TI7yRn2YgaYYCc6EDRpod39DSdCyAs4RGqhMRndffRfs6dxc9Euox0NgZR2NhpmF73sqos2XVFD-ctt_vY2uTnPh8PJ4BGV7Ro3ZKOoaH5Li6Bt19r56zi7fM4fupP-oC1BHHEPGnWzGlimruno87qXvd__qjdpw2pXErOlxl7Mmn_j1VkcImb-i0q5BT5KAsoj5PMgICXGmCWViA-BlHzfL_b2MWeqRVaSE8uLg1iQUqVS2ZiTHK7LQrFcXfNg9V8WnZu3eEEqFYjCNCslJdd15zXVmcacODP9TMcqJmBN5zL9VKdt_uLM1ZoBzIVNF8WqM06ELRyCCCln-oWcTVkHqxaE4GCitwx8mgbK0Y-no9E0YVTBNuMqFpj4NJBgYZqquH4aeZgokcIPtMWpvtywoDpfU3_yww" >}}
7474

7575
<!--
76-
An Ingress may be configured to give Services externally-reachable URLs, load balance traffic, terminate SSL / TLS, and offer name based virtual hosting. An [Ingress controller](/docs/concepts/services-networking/ingress-controllers) is responsible for fulfilling the Ingress, usually with a load balancer, though it may also configure your edge router or additional frontends to help handle the traffic.
76+
An Ingress may be configured to give Services externally-reachable URLs, load balance traffic, terminate SSL / TLS, and offer name-based virtual hosting. An [Ingress controller](/docs/concepts/services-networking/ingress-controllers) is responsible for fulfilling the Ingress, usually with a load balancer, though it may also configure your edge router or additional frontends to help handle the traffic.
7777
-->
7878
Ingress 可为 Service 提供外部可访问的 URL、负载均衡流量、终止 SSL/TLS,以及基于名称的虚拟托管。
7979
[Ingress 控制器](/zh-cn/docs/concepts/services-networking/ingress-controllers)
@@ -93,7 +93,7 @@ Ingress 不会公开任意端口或协议。
9393
<!--
9494
## Prerequisites
9595
96-
You must have an [ingress controller](/docs/concepts/services-networking/ingress-controllers) to satisfy an Ingress. Only creating an Ingress resource has no effect.
96+
You must have an [Ingress controller](/docs/concepts/services-networking/ingress-controllers) to satisfy an Ingress. Only creating an Ingress resource has no effect.
9797
-->
9898
## 环境准备
9999

@@ -121,7 +121,7 @@ Make sure you review your Ingress controller's documentation to understand the c
121121
{{< /note >}}
122122

123123
<!--
124-
## The Ingress Resource
124+
## The Ingress resource
125125
126126
A minimal Ingress resource example:
127127
-->
@@ -194,18 +194,23 @@ Each HTTP rule contains the following information:
194194
* An optional host. In this example, no host is specified, so the rule applies to all inbound
195195
HTTP traffic through the IP address specified. If a host is provided (for example,
196196
foo.bar.com), the rules apply to that host.
197-
* A list of paths (for example, `/testpath`), each of which has an associated backend defined with a `serviceName`
198-
and `servicePort`. Both the host and path must match the content of an incoming request before the
199-
load balancer directs traffic to the referenced Service.
197+
* A list of paths (for example, `/testpath`), each of which has an associated
198+
backend defined with a `service.name` and a `service.port.name` or
199+
`service.port.number`. Both the host and path must match the content of an
200+
incoming request before the load balancer directs traffic to the referenced
201+
Service.
200202
* A backend is a combination of Service and port names as described in the
201-
[Service doc](/docs/concepts/services-networking/service/). HTTP (and HTTPS) requests to the
203+
[Service doc](/docs/concepts/services-networking/service/) or a [custom resource backend](#resource-backend) by way of a {{< glossary_tooltip term_id="CustomResourceDefinition" text="CRD" >}}. HTTP (and HTTPS) requests to the
202204
Ingress that match the host and path of the rule are sent to the listed backend.
203205
-->
204206
* 可选的 `host`。在此示例中,未指定 `host`,因此该规则适用于通过指定 IP 地址的所有入站 HTTP 通信。
205207
如果提供了 `host`(例如 foo.bar.com),则 `rules` 适用于该 `host`
206-
* 路径列表 paths(例如,`/testpath`),每个路径都有一个由 `serviceName``servicePort` 定义的关联后端。
208+
* 路径列表(例如 `/testpath`),每个路径都有一个由 `service.name``service.port.name`
209+
`service.port.number` 定义的关联后端。
207210
在负载均衡器将流量定向到引用的服务之前,主机和路径都必须匹配传入请求的内容。
208-
* `backend`(后端)是 [Service 文档](/zh-cn/docs/concepts/services-networking/service/)中所述的服务和端口名称的组合。
211+
* `backend`(后端)是 [Service 文档](/zh-cn/docs/concepts/services-networking/service/)中所述的服务和端口名称的组合,
212+
或者是通过 {{< glossary_tooltip term_id="CustomResourceDefinition" text="CRD" >}}
213+
方式来实现的[自定义资源后端](#resource-backend)
209214
与规则的 `host``path` 匹配的对 Ingress 的 HTTP(和 HTTPS )请求将发送到列出的 `backend`
210215

211216
<!--
@@ -283,7 +288,7 @@ Events: <none>
283288
```
284289

285290
<!--
286-
### Path Types
291+
### Path types
287292
288293
Each path in an Ingress is required to have a corresponding path type. Paths
289294
that do not include an explicit `pathType` will fail validation. There are three
@@ -373,8 +378,7 @@ Ingress 中的每个路径都需要有对应的路径类型(Path Type)。未
373378
| 混合 | `/foo` (Prefix), `/foo` (Exact) | `/foo` | 是,优选 Exact 类型 |
374379

375380
<!--
376-
#### Multiple Matches
377-
381+
#### Multiple matches
378382
In some cases, multiple paths within an Ingress will match a request. In those
379383
cases precedence will be given first to the longest matching path. If two paths
380384
are still equally matched, precedence will be given to paths with an exact path
@@ -569,7 +573,7 @@ spec:
569573
{{< /tabs >}}
570574

571575
<!--
572-
### Deprecated Annotation
576+
### Deprecated annotation
573577

574578
Before the IngressClass resource and `ingressClassName` field were added in
575579
Kubernetes 1.18, Ingress classes were specified with a
@@ -612,7 +616,7 @@ IngressClass.
612616
If you have more than one IngressClass marked as the default for your cluster,
613617
the admission controller prevents creating new Ingress objects that don't have
614618
an `ingressClassName` specified. You can resolve this by ensuring that at most 1
615-
IngressClasess are marked as default in your cluster.
619+
IngressClass is marked as default in your cluster.
616620
-->
617621
{{< caution >}}
618622
如果集群中有多个 IngressClass 被标记为默认,准入控制器将阻止创建新的未指定
@@ -743,12 +747,12 @@ Ingress 控制器将提供实现特定的负载均衡器来满足 Ingress,
743747
当它这样做时,你会在 Address 字段看到负载均衡器的地址。
744748

745749
<!--
746-
Depending on the [Ingress controller](/docs/concepts/services-networking/ingress-controllers)
750+
Depending on the [Ingress controller](/docs/concepts/services-networking/ingress-controllers/)
747751
you are using, you may need to create a default-http-backend
748752
[Service](/docs/concepts/services-networking/service/).
749753
-->
750754
{{< note >}}
751-
取决于你所使用的 [Ingress 控制器](/zh-cn/docs/concepts/services-networking/ingress-controllers)
755+
取决于你所使用的 [Ingress 控制器](/zh-cn/docs/concepts/services-networking/ingress-controllers/)
752756
你可能需要创建默认 HTTP 后端[服务](/zh-cn/docs/concepts/services-networking/service/)
753757
{{< /note >}}
754758

@@ -863,7 +867,7 @@ platform specific Ingress controller to understand how TLS works in your environ
863867
{{< /note >}}
864868

865869
<!--
866-
### Load Balancing {#load-balancing}
870+
### Load balancing {#load-balancing}
867871

868872
An Ingress controller is bootstrapped with some load balancing policy settings
869873
that it applies to all Ingress, such as the load balancing algorithm, backend
@@ -884,15 +888,15 @@ It's also worth noting that even though health checks are not exposed directly
884888
through the Ingress, there exist parallel concepts in Kubernetes such as
885889
[readiness probes](/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
886890
that allow you to achieve the same end result. Please review the controller
887-
specific documentation to see how they handle health checks (
888-
[nginx](https://git.k8s.io/ingress-nginx/README.md),
891+
specific documentation to see how they handle health checks (for example:
892+
[nginx](https://git.k8s.io/ingress-nginx/README.md), or
889893
[GCE](https://git.k8s.io/ingress-gce/README.md#health-checks)).
890894
-->
891895
值得注意的是,尽管健康检查不是通过 Ingress 直接暴露的,在 Kubernetes
892896
中存在并行的概念,比如
893897
[就绪检查](/zh-cn/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/),
894898
允许你实现相同的目的。
895-
请检查特定控制器的说明文档([nginx](https://git.k8s.io/ingress-nginx/README.md)、
899+
请检查特定控制器的说明文档(例如:[nginx](https://git.k8s.io/ingress-nginx/README.md)、
896900
[GCE](https://git.k8s.io/ingress-gce/README.md#health-checks))以了解它们是怎样处理健康检查的。
897901

898902
<!--
@@ -944,16 +948,20 @@ spec:
944948
http:
945949
paths:
946950
- backend:
947-
serviceName: service1
948-
servicePort: 80
951+
service:
952+
name: service1
953+
port:
954+
number: 80
949955
path: /foo
950956
pathType: Prefix
951957
- host: bar.baz.com
952958
http:
953959
paths:
954960
- backend:
955-
serviceName: service2
956-
servicePort: 80
961+
service:
962+
name: service2
963+
port:
964+
number: 80
957965
path: /foo
958966
pathType: Prefix
959967
..
@@ -1003,7 +1011,7 @@ You can achieve the same outcome by invoking `kubectl replace -f` on a modified
10031011
<!--
10041012
## Failing across availability zones
10051013
1006-
Techniques for spreading traffic across failure domains differs between cloud providers.
1014+
Techniques for spreading traffic across failure domains differ between cloud providers.
10071015
Please check the documentation of the relevant [Ingress controller](/docs/concepts/services-networking/ingress-controllers) for details.
10081016
-->
10091017
## 跨可用区失败 {#failing-across-availability-zones}
@@ -1031,7 +1039,7 @@ You can expose a Service in multiple ways that don't directly involve the Ingres
10311039

10321040
<!--
10331041
* Learn about the [Ingress](/docs/reference/kubernetes-api/service-resources/ingress-v1/) API
1034-
* Learn about [Ingress Controllers](/docs/concepts/services-networking/ingress-controllers/)
1042+
* Learn about [Ingress controllers](/docs/concepts/services-networking/ingress-controllers/)
10351043
* [Set up Ingress on Minikube with the NGINX Controller](/docs/tasks/access-application-cluster/ingress-minikube/)
10361044
-->
10371045
* 进一步了解 [Ingress](/zh-cn/docs/reference/kubernetes-api/service-resources/ingress-v1/) API

0 commit comments

Comments
 (0)