Skip to content

Commit

Permalink
[zh-cn] sync kubernetes-api/service-resources/ingress-v1.md
Browse files Browse the repository at this point in the history
Signed-off-by: xin.li <xin.li@daocloud.io>
  • Loading branch information
my-git9 committed Oct 2, 2022
1 parent 2fb4fc2 commit a1f9363
Showing 1 changed file with 16 additions and 11 deletions.
Expand Up @@ -88,14 +88,14 @@ IngressSpec 描述用户希望存在的 Ingress。
- **ingressClassName** (string)

<!--
IngressClassName is the name of the IngressClass cluster resource. The associated IngressClass defines which controller will implement the resource. This replaces the deprecated `kubernetes.io/ingress.class` annotation. For backwards compatibility, when that annotation is set, it must be given precedence over this field. The controller may emit a warning if the field and annotation have different values. Implementations of this API should ignore Ingresses without a class specified. An IngressClass resource may be marked as default, which can be used to set a default value for this field. For more information, refer to the IngressClass documentation.
IngressClassName is the name of an IngressClass cluster resource. Ingress controller implementations use this field to know whether they should be serving this Ingress resource, by a transitive connection (controller -> IngressClass -> Ingress resource). Although the `kubernetes.io/ingress.class` annotation (simple constant name) was never formally defined, it was widely supported by Ingress controllers to create a direct binding between Ingress controller and Ingress resources. Newly created Ingress resources should prefer using the field. However, even though the annotation is officially deprecated, for backwards compatibility reasons, ingress controllers should still honor that annotation if present.
-->

ingressClassName 是 IngressClass 集群资源的名称。关联的 Ingress 类定义了将实际实现 Ingress 资源的控制器。
这一字段将取代不再推荐使用的 `kubernetes.io/ingress.class` 注解
为了向后兼容,当设置了该注解时,注解必须优先于此字段。如果字段和注解具有不同的值,控制器可能会发出警告。
此 API 的实现应忽略未指定类的 Ingress 资源。IngressClass 资源可被标记为 default,用来设置此字段的默认值。
有关更多信息,请参阅 IngressClass 文档
IngressClassName 是 IngressClass 集群资源的名称。
Ingress 控制器实现使用此字段来了解它们是否应该通过传递连接(控制器 -> IngressClass -> Ingress 资源)为该
Ingress 资源提供服务。尽管 `kubernetes.io/ingress.class` 注解(简单的常量名称)从未正式定义,
但它被 Ingress 控制器广泛支持,以在 Ingress 控制器和 Ingress 资源之间创建直接绑定。
新创建的 Ingress 资源应该优先选择使用该字段。但是,即使注解已被正式弃用,
出于向后兼容性的原因,Ingress 控制器仍应能够处理该注解(如果存在)

- **rules** ([]IngressRule)

Expand Down Expand Up @@ -124,8 +124,8 @@ IngressSpec 描述用户希望存在的 Ingress。
Host is the fully qualified domain name of a network host, as defined by RFC 3986. Note the following deviations from the "host" part of the URI as defined in RFC 3986: 1. IPs are not allowed. Currently an IngressRuleValue can only apply to
the IP in the Spec of the parent Ingress.
2. The `:` delimiter is not respected because ports are not allowed.
Currently the port of an Ingress is implicitly :80 for http and
:443 for https.
Currently the port of an Ingress is implicitly :80 for http and
:443 for https.
Both these may change in the future. Incoming requests are matched against the host before the IngressRuleValue. If the host is unspecified, the Ingress routes all traffic based on the specified IngressRuleValue.
-->

Expand Down Expand Up @@ -204,7 +204,11 @@ IngressSpec 描述用户希望存在的 Ingress。
- **rules.http.paths.pathType** (string),必需

<!--
PathType determines the interpretation of the Path matching. PathType can be one of the following values: * Exact: Matches the URL path exactly. * Prefix: Matches based on a URL path prefix split by '/'. Matching is
PathType determines the interpretation of the Path matching. PathType can be one of the following values:
* Exact: Matches the URL path exactly.
* Prefix: Matches based on a URL path prefix split by '/'. Matching is
done on a path element by element basis. A path element refers is the
list of labels in the path split by the '/' separator. A request is a
match for path p if every p is an element-wise prefix of p of the
Expand All @@ -220,12 +224,13 @@ IngressSpec 描述用户希望存在的 Ingress。
pathType 决定如何解释 path 匹配。pathType 可以是以下值之一:

* `Exact`:与 URL 路径完全匹配。
* `Prefix`:根据按 “/” 拆分的 URL 路径前缀进行匹配。

* `Prefix`:根据按 “/” 拆分的 URL 路径前缀进行匹配。
匹配是按路径元素逐个元素完成。路径元素引用的是路径中由“/”分隔符拆分的标签列表。
如果每个 p 都是请求路径 p 的元素前缀,则请求与路径 p 匹配。
请注意,如果路径的最后一个元素是请求路径中的最后一个元素的子字符串,则匹配不成功
(例如 `/foo/bar` 匹配 `/foo/bar/baz`,但不匹配 `/foo/barbaz`)。

* ImplementationSpecific:路径匹配的解释取决于 IngressClass。
实现可以将其视为单独的路径类型,也可以将其视为前缀或确切的路径类型。
实现需要支持所有路径类型。
Expand Down

0 comments on commit a1f9363

Please sign in to comment.