Skip to content

Commit eb7ccd4

Browse files
committed
[zh-cn]sync ingress
Signed-off-by: xin.li <xin.li@daocloud.io>
1 parent 01a801e commit eb7ccd4

File tree

2 files changed

+45
-56
lines changed

2 files changed

+45
-56
lines changed

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

Lines changed: 45 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ weight: 30
1414
---
1515
<!--
1616
reviewers:
17-
- bprashanthluster: A set of Nodes that run containerized app
17+
- robscott
18+
- rikatz
1819
title: Ingress
1920
api_metadata:
2021
- apiVersion: "networking.k8s.io/v1"
@@ -38,9 +39,25 @@ weight: 30
3839

3940
{{< note >}}
4041
<!--
41-
Ingress is frozen. New features are being added to the [Gateway API](/docs/concepts/services-networking/gateway/).
42+
The Kubernetes project recommends using [Gateway](https://gateway-api.sigs.k8s.io/) instead of
43+
[Ingress](/docs/concepts/services-networking/ingress/).
44+
The Ingress API has been frozen.
45+
46+
This means that:
47+
* The Ingress API is generally available, and is subject to the [stability guarantees](/docs/reference/using-api/deprecation-policy/#deprecating-parts-of-the-api) for generally available APIs.
48+
The Kubernetes project has no plans to remove Ingress from Kubernetes.
49+
* The Ingress API is no longer being developed, and will have no further changes
50+
or updates made to it.
4251
-->
43-
入口(Ingress)目前已停止更新。新的功能正在集成至[网关 API](/zh-cn/docs/concepts/services-networking/gateway/) 中。
52+
Kubernetes 项目推荐使用 [Gateway](https://gateway-api.sigs.k8s.io/) 而不是
53+
[Ingress](/zh-cn/docs/concepts/services-networking/ingress/)
54+
Ingress API 已经被冻结。
55+
56+
这意味着:
57+
* Ingress API 一般是可用的,并且遵循一般可用 API
58+
[稳定性保证](/docs/reference/using-api/deprecation-policy/#deprecating-parts-of-the-api)
59+
Kubernetes 项目没有计划从 Kubernetes 中移除 Ingress。
60+
* Ingress API 不再进行开发,也不会对其进行进一步的更改或更新。
4461
{{< /note >}}
4562

4663
<!-- body -->
@@ -135,11 +152,9 @@ to satisfy an Ingress. Only creating an Ingress resource has no effect.
135152
你必须拥有一个 [Ingress 控制器](/zh-cn/docs/concepts/services-networking/ingress-controllers) 才能满足
136153
Ingress 的要求。仅创建 Ingress 资源本身没有任何效果。
137154

138-
<!--
139-
You may need to deploy an Ingress controller such as [ingress-nginx](https://kubernetes.github.io/ingress-nginx/deploy/).
155+
<!--
140156
You can choose from a number of [Ingress controllers](/docs/concepts/services-networking/ingress-controllers).
141157
-->
142-
你可能需要部署一个 Ingress 控制器,例如 [ingress-nginx](https://kubernetes.github.io/ingress-nginx/deploy/)
143158
你可以从许多 [Ingress 控制器](/zh-cn/docs/concepts/services-networking/ingress-controllers)中进行选择。
144159

145160
<!--
@@ -175,20 +190,16 @@ For general information about working with config files, see
175190
[deploying applications](/docs/tasks/run-application/run-stateless-application-deployment/),
176191
[configuring containers](/docs/tasks/configure-pod-container/configure-pod-configmap/),
177192
[managing resources](/docs/concepts/cluster-administration/manage-deployment/).
178-
Ingress frequently uses annotations to configure some options depending on the Ingress controller, an example of which
179-
is the [rewrite-target annotation](https://github.com/kubernetes/ingress-nginx/blob/main/docs/examples/rewrite/README.md).
180-
Different [Ingress controllers](/docs/concepts/services-networking/ingress-controllers) support different annotations.
181-
Review the documentation for your choice of Ingress controller to learn which annotations are supported.
193+
Ingress controllers frequently use [annotations](/docs/concepts/overview/working-with-objects/annotations/) to configure behavior.
194+
Review the documentation for your choice of ingress controller to learn which annotations are expected and / or supported.
182195
-->
183196
Ingress 需要指定 `apiVersion``kind``metadata``spec` 字段。
184197
Ingress 对象的命名必须是合法的 [DNS 子域名名称](/zh-cn/docs/concepts/overview/working-with-objects/names#dns-subdomain-names)
185198
关于如何使用配置文件的一般性信息,请参见[部署应用](/zh-cn/docs/tasks/run-application/run-stateless-application-deployment/)
186199
[配置容器](/zh-cn/docs/tasks/configure-pod-container/configure-pod-configmap/)
187200
[管理资源](/zh-cn/docs/concepts/cluster-administration/manage-deployment/)
188-
Ingress 经常使用注解(Annotations)来配置一些选项,具体取决于 Ingress 控制器,
189-
例如 [rewrite-target 注解](https://github.com/kubernetes/ingress-nginx/blob/main/docs/examples/rewrite/README.md)
190-
不同的 [Ingress 控制器](/zh-cn/docs/concepts/services-networking/ingress-controllers)支持不同的注解。
191-
查看你所选的 Ingress 控制器的文档,以了解其所支持的注解。
201+
Ingress 控制器经常使用[注解](/zh-cn/docs/concepts/overview/working-with-objects/annotations/)来配置行为。
202+
请查阅你选择的 Ingress 控制器的文档,以了解预期和/或支持的注解。
192203

193204
<!--
194205
The [Ingress spec](/docs/reference/kubernetes-api/service-resources/ingress-v1/#IngressSpec)
@@ -205,19 +216,16 @@ Ingress 资源仅支持用于转发 HTTP(S) 流量的规则。
205216
If the `ingressClassName` is omitted, a [default Ingress class](#default-ingress-class)
206217
should be defined.
207218
208-
There are some ingress controllers, that work without the definition of a
209-
default `IngressClass`. For example, the Ingress-NGINX controller can be
210-
configured with a [flag](https://kubernetes.github.io/ingress-nginx/user-guide/k8s-122-migration/#what-is-the-flag-watch-ingress-without-class)
211-
`--watch-ingress-without-class`. It is [recommended](https://kubernetes.github.io/ingress-nginx/user-guide/k8s-122-migration/#i-have-only-one-ingress-controller-in-my-cluster-what-should-i-do) though, to specify the
212-
default `IngressClass` as shown [below](#default-ingress-class).
219+
Some ingress controllers work even without the definition of a
220+
default IngressClass. Even if you use an ingress controller that is able
221+
to operate without any IngressClass, the Kubernetes project still recommends
222+
that you define a default IngressClass.
213223
-->
214224
如果 `ingressClassName` 被省略,那么你应该定义一个[默认的 Ingress 类](#default-ingress-class)
215225

216-
有些 Ingress 控制器不需要定义默认的 `IngressClass`。比如:Ingress-NGINX
217-
控制器可以通过[参数](https://kubernetes.github.io/ingress-nginx/user-guide/k8s-122-migration/#what-is-the-flag-watch-ingress-without-class)
218-
`--watch-ingress-without-class` 来配置。
219-
不过仍然[推荐](https://kubernetes.github.io/ingress-nginx/user-guide/k8s-122-migration/#i-have-only-one-ingress-controller-in-my-cluster-what-should-i-do)
220-
[下文](#default-ingress-class)所示来设置默认的 `IngressClass`
226+
有些 Ingress 控制器甚至可以在没有定义默认 IngressClass 的情况下工作。
227+
即使你使用的 Ingress 控制器能够在没有任何 IngressClass 的情况下运行,
228+
Kubernetes 项目仍然建议你定义一个默认的 IngressClass。
221229

222230
<!--
223231
### Ingress rules
@@ -675,17 +683,11 @@ IngressClass is marked as default in your cluster.
675683
{{< /caution >}}
676684

677685
<!--
678-
There are some ingress controllers, that work without the definition of a
679-
default `IngressClass`. For example, the Ingress-NGINX controller can be
680-
configured with a [flag](https://kubernetes.github.io/ingress-nginx/#what-is-the-flag-watch-ingress-without-class)
681-
`--watch-ingress-without-class`. It is [recommended](https://kubernetes.github.io/ingress-nginx/#i-have-only-one-instance-of-the-ingresss-nginx-controller-in-my-cluster-what-should-i-do) though, to specify the
682-
default `IngressClass`:
686+
Start by defining a
687+
default IngressClass. It is recommended though, to specify the default
688+
IngressClass:
683689
-->
684-
有一些 Ingress 控制器不需要定义默认的 `IngressClass`。比如:Ingress-NGINX
685-
控制器可以通过[参数](https://kubernetes.github.io/ingress-nginx/#what-is-the-flag-watch-ingress-without-class)
686-
`--watch-ingress-without-class` 来配置。
687-
不过仍然[推荐](https://kubernetes.github.io/ingress-nginx/#i-have-only-one-instance-of-the-ingresss-nginx-controller-in-my-cluster-what-should-i-do)
688-
设置默认的 `IngressClass`。
690+
首先定义一个默认的 IngressClass。建议指定默认的 IngressClass:
689691

690692
{{% code_sample file="service/networking/default-ingressclass.yaml" %}}
691693

@@ -822,7 +824,7 @@ The following Ingress tells the backing load balancer to route requests based on
822824
the [Host header](https://tools.ietf.org/html/rfc7230#section-5.4).
823825
-->
824826
以下 Ingress 让后台负载均衡器基于
825-
[host 头部字段](https://tools.ietf.org/html/rfc7230#section-5.4)来路由请求。
827+
[Host 头部字段](https://tools.ietf.org/html/rfc7230#section-5.4)来路由请求。
826828

827829
{{% code_sample file="service/networking/name-virtual-host-ingress.yaml" %}}
828830

@@ -906,16 +908,13 @@ section.
906908

907909
{{< note >}}
908910
<!--
909-
There is a gap between TLS features supported by various Ingress
910-
controllers. Please refer to documentation on
911-
[nginx](https://kubernetes.github.io/ingress-nginx/user-guide/tls/),
912-
[GCE](https://git.k8s.io/ingress-gce/README.md#frontend-https), or any other
913-
platform specific Ingress controller to understand how TLS works in your environment.
911+
There is a gap between TLS features supported by various ingress controllers.
912+
You should refer to the documentation for the ingress controller(s) you've chosen to
913+
understand how TLS works in your environment.
914914
-->
915-
各种 Ingress 控制器在所支持的 TLS 特性上参差不齐。请参阅与
916-
[nginx](https://kubernetes.github.io/ingress-nginx/user-guide/tls/)、
917-
[GCE](https://git.k8s.io/ingress-gce/README.md#frontend-https)
918-
或者任何其他平台特定的 Ingress 控制器有关的文档,以了解 TLS 如何在你的环境中工作。
915+
各种 Ingress 控制器在所支持的 TLS 特性上参差不齐。
916+
你应参考所选的 Ingress 控制器的文档,以了解 TLS
917+
在你的环境中是如何工作的。
919918
{{< /note >}}
920919

921920
<!--
@@ -940,16 +939,12 @@ It's also worth noting that even though health checks are not exposed directly
940939
through the Ingress, there exist parallel concepts in Kubernetes such as
941940
[readiness probes](/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
942941
that allow you to achieve the same end result. Please review the controller
943-
specific documentation to see how they handle health checks (for example:
944-
[nginx](https://git.k8s.io/ingress-nginx/README.md), or
945-
[GCE](https://git.k8s.io/ingress-gce/README.md#health-checks)).
942+
specific documentation to see how they handle health checks.
946943
-->
947944
值得注意的是,尽管健康检查不是通过 Ingress 直接暴露的,在 Kubernetes
948945
中存在[就绪态探针](/zh-cn/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
949946
这类等价的概念,供你实现相同的目的。
950-
请查阅特定控制器的说明文档(例如:[nginx](https://git.k8s.io/ingress-nginx/README.md)、
951-
[GCE](https://git.k8s.io/ingress-gce/README.md#health-checks))
952-
以了解它们是怎样处理健康检查的。
947+
请查阅特定控制器的说明文档。
953948

954949
<!--
955950
## Updating an Ingress
@@ -974,8 +969,6 @@ Rules:
974969
---- ---- --------
975970
foo.bar.com
976971
/foo service1:80 (10.8.0.90:80)
977-
Annotations:
978-
nginx.ingress.kubernetes.io/rewrite-target: /
979972
Events:
980973
Type Reason Age From Message
981974
---- ------ ---- ---- -------
@@ -1046,8 +1039,6 @@ Rules:
10461039
/foo service1:80 (10.8.0.90:80)
10471040
bar.baz.com
10481041
/foo service2:80 (10.8.0.91:80)
1049-
Annotations:
1050-
nginx.ingress.kubernetes.io/rewrite-target: /
10511042
Events:
10521043
Type Reason Age From Message
10531044
---- ------ ---- ---- -------

content/zh-cn/examples/service/networking/minimal-ingress.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ apiVersion: networking.k8s.io/v1
22
kind: Ingress
33
metadata:
44
name: minimal-ingress
5-
annotations:
6-
nginx.ingress.kubernetes.io/rewrite-target: /
75
spec:
86
ingressClassName: nginx-example
97
rules:

0 commit comments

Comments
 (0)