From 659045b9fd83dfa1fd1f8d663d3382961de2ddd4 Mon Sep 17 00:00:00 2001 From: sxg <946479704@qq.com> Date: Thu, 28 Jul 2022 14:28:49 +0800 Subject: [PATCH] modify ingress-v1.md --- .../service-resources/ingress-v1.md | 757 +++++++++--------- 1 file changed, 388 insertions(+), 369 deletions(-) diff --git a/content/zh-cn/docs/reference/kubernetes-api/service-resources/ingress-v1.md b/content/zh-cn/docs/reference/kubernetes-api/service-resources/ingress-v1.md index 637bc16a5f3d6..7d95f710b90ae 100644 --- a/content/zh-cn/docs/reference/kubernetes-api/service-resources/ingress-v1.md +++ b/content/zh-cn/docs/reference/kubernetes-api/service-resources/ingress-v1.md @@ -7,10 +7,8 @@ content_type: "api_reference" description: "Ingress 是允许入站连接到达后端定义的端点的规则集合。" title: "Ingress" weight: 4 -auto_generated: true --- @@ -36,29 +33,11 @@ auto_generated: true Ingress is a collection of rules that allow inbound connections to reach the endpoints defined by a backend. An Ingress can be configured to give services externally-reachable urls, load balance traffic, terminate SSL, offer name based virtual hosting etc.
- -- **apiVersion**: networking.k8s.io/v1 - - -- **kind**: Ingress - - -- **metadata** (}}">ObjectMeta) - - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - -- **spec** (}}">IngressSpec) - - Spec is the desired state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - -- **status** (}}">IngressStatus) - - Status is the current state of the Ingress. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status --> ## Ingress {#Ingress} Ingress 是允许入站连接到达后端定义的端点的规则集合。 -Ingress 可以配置为向服务提供外部可访问的URL、负载平衡流量、终止SSL、提供基于名称的虚拟主机等。 +Ingress 可以配置为向服务提供外部可访问的 URL、负载平衡流量、终止 SSL、提供基于名称的虚拟主机等。
@@ -67,54 +46,55 @@ Ingress 可以配置为向服务提供外部可访问的URL、负载平衡流量 - **kind**: Ingress - - **metadata** (}}">ObjectMeta) - - 标准对象的元数据。 + + + 标准的对象元数据。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata - **spec** (}}">IngressSpec) + Spec 是 Ingress 的所需状态。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - **status** (}}">IngressStatus) - Status是 Ingress 的当前状态。 + + Status 是 Ingress 的当前状态。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status - - - -## IngressSpec {#IngressSpec} - IngressSpec 描述用户希望存在的 Ingress。
- **defaultBackend** (}}">IngressBackend) + DefaultBackend 是应该处理与任何规则都不匹配的请求的后端。 如果未指定规则,则必须指定 DefaultBackend。 如果未设置 DefaultBackend,则不符合任何规则的请求的处理将由 Ingress 控制器决定。 + - **ingressClassName** (string) + IngressClassName 是 IngressClass 群集资源的名称。 关联的 Ingress 类定义了将实现资源的控制器。 这将取代不推荐使用的 `kubernetes.io/ingress.class` 注释。 @@ -124,97 +104,99 @@ IngressSpec 描述用户希望存在的 Ingress。 IngressClass 资源可标记为default,可用于设置此字段的默认值。 有关更多信息,请参阅 IngressClass 文档。 - + **Atomic: 将在合并期间被替换** + + 用于配置入口的主机规则列表。 + 如果未指定或没有规则匹配,则所有流量都将发送到默认后端。 + + + **IngressRule表示将指定主机下的路径映射到相关后端服务的规则。传入请求首先评估主机匹配,然后路由到与匹配的 IngressRuleValue 关联的后端。** - **rules.host** (string) - + -- **rules** ([]IngressRule) - - *Atomic: 将在合并期间被替换* - - 用于配置入口的主机规则列表。 - 如果未指定或没有规则匹配,则所有流量都将发送到默认后端。 - - - *IngressRule表示将指定主机下的路径映射到相关后端服务的规则。传入请求首先评估主机匹配,然后路由到与匹配的 IngressRuleValue 关联的后端。* - - - **rules.host** (string) - - 主机是RFC 3986 定义的网络主机的完全限定域名。请注意以下与 RFC 3986 中定义的 URI 的“主机”部分的偏差: + --> + 主机是 RFC 3986 定义的网络主机的完全限定域名。请注意以下与 RFC 3986 中定义的 URI 的“主机”部分的偏差: 1.不允许 IP。当前 IngressRuleValue 只能应用于父 Ingress Spec 中的 IP。 2. 由于不允许使用端口,因此不遵守“:”分隔符。 当前 Ingress 的端口隐式为: - :80用于 http + :80 用于 http :443 用于 https。 这两种情况在未来都可能发生变化。 传入请求在 IngressRuleValue 之前与主机匹配。 - 如果主机未指定, Ingress 将根据指定的 IngressRuleValue 规则路由所有流量。 - + 如果主机未指定, Ingress 将根据指定的 IngressRuleValue 规则路由所有流量 + + 主机可以是“精确“的,它是一个没有网络主机终止点的域名(例如 “foo.bar.com” )或“通配符”,它是一个以单个通配符标签为前缀的域名(例如 “*.foo.com”)。 通配符 “*” 必须单独显示为第一个 DNS 标签,并且仅与单个标签匹配。 您不能单独拥有通配符标签(例如,Host=“*”)。 - 请求将按以下方式与主机字段匹配:1.如果主机是精确的,则如果 http 主机标头等于主机,则请求与此规则匹配。 + 请求将按以下方式与主机字段匹配: + 1.如果主机是精确的,则如果 http 主机标头等于主机,则请求与此规则匹配。 2、如果主机是通配符,那么如果 http 主机头等于通配符规则的后缀(删除第一个标签),则请求与此规则匹配。 - + - **rules.http** (HTTPIngressRuleValue) - + -- **rules.http** (HTTPIngressRuleValue) - + --> + **HTTPIngressRuleValue 是指向后端的 http 选择器列表。在示例中 http:///? -> 其中url的部分对应 于RFC 3986,此资源将用于匹配最后一个 “/” 之后和第一个“ ?”之前的所有内容或 “#”。** - - *HTTPIngressRuleValue 是指向后端的 http 选择器列表。在示例中 http:///? -> 其中url的部分对应 于RFC 3986,此资源将用于匹配最后一个 “/” 之后和第一个“ ?”之前的所有内容或 “#”。* - + - **rules.http.paths** ([]HTTPIngressPath), 必需 + - - **rules.http.paths** ([]HTTPIngressPath), 必选 - - *Atomic: 将在合并期间被替换* + --> + **Atomic: 将在合并期间被替换** 将请求映射到后端的路径集合。. - *HTTPIngressPath 将路径与后端关联。与路径匹配的传入 URL 将转发到后端。* + **HTTPIngressPath 将路径与后端关联。与路径匹配的传入 URL 将转发到后端。** + - **rules.http.paths.backend** (}}">IngressBackend), 必选 后端定义将流量转发到的引用服务端点。 - + - **rules.http.paths.pathType** (string), 必需 + - - **rules.http.paths.pathType** (string), 必选 - - 路径类型决定路径匹配的解释。路径类型可以是以下值之一:*精确:与URL路径完全匹配。*前缀:根据按“/”拆分的URL路径前缀进行匹配。 - 匹配是按路径元素逐个元素完成。 - 路径元素引用的是路径中由“/”分隔符拆分的标签列表。 - 如果每个p都是请求路径p的元素前缀,则请求与路径p匹配。 - 请注意,如果路径的最后一个元素是子字符串对于请求路径中的最后一个元素,它不匹配(例如/foo/bar匹配/foo/bar/baz,但不匹配/foo/barbaz)。 + --> + 路径类型决定路径匹配的解释。路径类型可以是以下值之一:*精确:与URL路径完全匹配。*前缀:根据按“/”拆分的URL路径前缀进行匹配。 + 匹配是按路径元素逐个元素完成。 + 路径元素引用的是路径中由“/”分隔符拆分的标签列表。 + 如果每个p都是请求路径 p 的元素前缀,则请求与路径p匹配。 + 请注意,如果路径的最后一个元素是子字符串对于请求路径中的最后一个元素,它不匹配(例如/foo/bar匹配/foo/bar/baz,但不匹配/foo/barbaz)。 * 具体实现:路径匹配的解释取决于 IngressClass。 实现可以将其视为单独的路径类型,也可以将其视为前缀或确切的路径类型。 实现需要支持所有路径类型。 - - - **rules.http.paths.path** (string) + --> 路径与传入请求的路径匹配。 目前,它可以包含 RFC 3986 定义的 URL 的常规“路径”部分不允许的字符。 路径必须以“/”开头,并且在使用值为 “Exact” 或 “Prefix” 的路径类型时必须存在。 - - - **tls** ([]IngressTLS) - - *Atomic: 将在合并期间被替换* + --> + **Atomic: 将在合并期间被替换** TLS配置。 - 目前,入口仅支持一个TLS端口443。 - 如果此列表的多个成员指定了不同的主机,如果实现 ingress 的 ingress 控制器支持SNI,则它们将根据通过 SNI TLS 扩展指定的主机名在同一端口上多路复用。 + 目前,入口仅支持一个 TLS 端口 443。 + 如果此列表的多个成员指定了不同的主机,如果实现 ingress 的 ingress 控制器支持 SNI,则它们将根据通过 SNI TLS 扩展指定的主机名在同一端口上多路复用。 - + + **IngressTLS 描述与 Ingress 相关的传输层安全性。** - **tls.hosts** ([]string) + - - *IngressTLS 描述与 Ingress 相关的传输层安全性。* - - - **tls.hosts** ([]string) - - *Atomic: 将在合并期间被替换* + --> + **Atomic: 将在合并期间被替换** - 主机是TLS证书中包含的主机列表。 + 主机是 TLS 证书中包含的主机列表。 此列表中的值必须与 tlsSecret 中使用的名称匹配。 默认为实现此 Ingress 的负载均衡控制器的通配符主机设置(如果未指定)。 - - **tls.secretName** (string) + + SecretName 是用于终止端口 443 上 TLS 通信的密码的名称。 字段是可选的,以允许仅基于SNI主机名的 TLS 路由。 @@ -306,7 +284,7 @@ IngressBackend describes all endpoints for a given service and port. IngressBackend 描述给定服务和端口的所有端点。 - + -- **service** (IngressServiceBackend) - + --> + Service 引用一个 Service 作为后端。 - 这是一个与 “Resource” 互斥的设置。 + 此字段是一个与 “Resource” 互斥的设置。 - + - **service.name** (string), 必选 + + - - *IngressServiceBackend 引用一个 Kubernetes Service 作为后端。* - - - **service.name** (string), 必选 - - Name 是引用的 service。service 必须与 Ingress 对象位于同一命名空间中。 + --> + Name 是引用的 service。service 必须与 Ingress 对象位于同一命名空间中。 - - **service.port.name** (string) - + --> Name 是 service 上端口的名称。 - 这是一个与 “Number” 互斥的设置。 + 此字段是一个与 “Number” 互斥的设置。 - **service.port.number** (int32) + Number是 service 上的数字端口号(例如80)。 - 这是一个与 “Name” 的互斥设置。 + 此字段一个与 “Name” 的互斥设置。 @@ -398,30 +371,29 @@ IngressStatus 描述 Ingress 当前状态。
- -- **loadBalancer** (LoadBalancerStatus) - + --> LoadBalancer 包含负载平衡器的当前状态。 *LoadBalancerStatus 表示负载平衡器的状态。* - + - **loadBalancer.ingress** ([]LoadBalancerIngress) + - - **loadBalancer.ingress** ([]LoadBalancerIngress) + --> Ingress 是一个包含负载平衡器入口点的列表。 用于服务的流量应发送到这些入口点。 @@ -429,74 +401,71 @@ IngressStatus 描述 Ingress 当前状态。 *LoadBalancerIngress 表示负载平衡器入口点的状态:用于服务的流量应发送到入口点。* - - **loadBalancer.ingress.hostname** (string) + 为基于 DNS 的负载平衡器入口点设置主机名(通常为 AWS 负载平衡器) - **loadBalancer.ingress.ip** (string) + 为基于 IP 的负载平衡器入口点设置 IP(通常为 GCE 或 OpenStack 负载平衡器) - - - **loadBalancer.ingress.ports** ([]PortStatus) - - *Atomic: 将在合并期间被替换* + --> + **Atomic: 将在合并期间被替换** - Ports 是服务端口的记录列表(如果使用),服务中定义的每个端口中都应该有一个条目 + Ports 是服务端口的记录列表(如果使用),服务中定义的每个端口中都应该有一个条目。 - ** - + - **loadBalancer.ingress.ports.port** (int32), 必需 + + Port 在此是记录其状态的服务端口的端口号 + + - **loadBalancer.ingress.ports.protocol** (string), 必需 + + - - **loadBalancer.ingress.ports.port** (int32), 必选 - - Port 是此处记录其状态的服务端口的端口号 - - - **loadBalancer.ingress.ports.protocol** (string), 必选 - + --> Protocol 是服务端口的协议,其状态记录在此。 支持的值为:“TCP”、“UDP”、“SCTP” - -- **loadBalancer.ingress.ports.error** (string) - - 错误是记录服务端口的问题。 - 错误的格式应符合以下规则: - -应在此文件中指定内置错误值,这些值应使用 CamelCase 名称 - - 云提供程序特定的错误值的名称必须符合 foo.example.com/CamelCase 格式。 + --> + 错误是记录服务端口的问题。 + 错误的格式应符合以下规则: + - 应在此文件中指定内置错误码,错误码应使用驼峰法命名。 + 云提供程序特定的错误码的名称必须符合 foo.example.com/CamelCase 格式。 + - **apiVersion** (string) APIVersion定义对象表示的版本化架构。 服务器应将已识别的架构转换为最新的内部值,并且可能会拒绝未识别的值。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources - -- **kind** (string) - - Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - -- **metadata** (}}">ListMeta) - Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata ---> - **kind** (string) + Kind 是一个字符串值,表示此对象表示的REST资源。 服务器可以从客户端向其提交请求的端点推断出这一点。 不能被更新。 - 在CamelCase。 + 在 CamelCase。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds - **metadata** (}}">ListMeta) + + - 标准对象的元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + 标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata ## Operations {#Operations} - -
- - - - +- **name** (*路径参数*): string, 必需 + Ingress 名称 + -- **name** (*in path*): string, 必选 - - Ingress名称 -- **namespace** (*in path*): string, 必选 +- **namespace** (*路径参数*): string, 必需 }}">namespace -- **pretty** (*in query*): string +- **pretty** (*查询参数*): string }}">pretty + #### 应答 200 (}}">Ingress): OK -401: 未授权 +401: Unauthorized -- **name** (*in path*): string, 必选 +- **name** (*路径参数*): string, 必需 - Ingress名称 + Ingress 名称 -- **namespace** (*in path*): string, 必选 +- **namespace** (*路径参数*): string, 必需 }}">namespace -- **pretty** (*in query*): string +- **pretty** (*查询参数*): string }}">pretty +#### 应答 200 (}}">Ingress): OK 401: Unauthorized ---> + -- **namespace** (*in path*): string, 必选 +- **namespace** (*in path*): string, 必需 }}">namespace + +- **allowWatchBookmarks** (*查询参数*): boolean }}">allowWatchBookmarks - + +- **continue** (*查询参数*): string }}">continue - + +- **fieldSelector** (*查询参数*): string }}">fieldSelector - + +- **labelSelector** (*查询参数*): string }}">labelSelector - + +- **limit** (*查询参数*): integer }}">limit - + +- **pretty** (*查询参数*): string }}">pretty - + +- **resourceVersion** (*查询参数*): string }}">resourceVersion - + +- **resourceVersionMatch** (*查询参数*): string }}">resourceVersionMatch - + +- **timeoutSeconds** (*查询参数*): integer }}">timeoutSeconds - + +- **watch** (*查询参数*): boolean }}">watch - + #### 应答 - 200 (}}">IngressList): OK -401: 未授权 +401: Unauthorized + +- **allowWatchBookmarks** (*查询参数*): boolean }}">allowWatchBookmarks - + +- **continue** (*查询参数*): string }}">continue - + +- **fieldSelector** (*查询参数*): string }}">fieldSelector - + +- **labelSelector** (*查询参数*): string }}">labelSelector - + +- **limit** (*查询参数*): integer }}">limit - + +- **pretty** (*查询参数*): string }}">pretty - + +- **resourceVersion** (*查询参数*): string }}">resourceVersion - + - **resourceVersionMatch** (*in query*): string +--> +- **resourceVersionMatch** (*查询参数*): string }}">resourceVersionMatch - + +- **timeoutSeconds** (*查询参数*): integer }}">timeoutSeconds - + +- **watch** (*查询参数*): boolean }}">watch @@ -854,11 +851,6 @@ GET /apis/networking.k8s.io/v1/ingresses --> #### 应答 - -200 (}}">IngressList): OK - -401: 未授权 - 200 (}}">IngressList): OK 401: Unauthorized @@ -888,7 +880,7 @@ POST /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses - **body**: }}">Ingress, required --> -- **namespace** (*in path*): string, required +- **namespace** (*路径参数*): string, 必选 }}">namespace @@ -896,49 +888,47 @@ POST /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses - **body**: }}">Ingress, 必选 - + +- **dryRun** (*查询参数*): string }}">dryRun - + +- **fieldManager** (*查询参数*): string }}">fieldManager - + +- **fieldValidation** (*查询参数*): string }}">fieldValidation - + +- **pretty** (*查询参数*): string }}">pretty #### 应答 - 200 (}}">Ingress): OK 201 (}}">Ingress): Created 202 (}}">Ingress): Accepted -401: 未授权 +401: Unauthorized -- **name** (*in path*): string, 必选 +- **name** (*路径参数*): string, 必选 - Ingress名称 + Ingress 名称 -- **namespace** (*in path*): string, 必选 +- **namespace** (*路径参数*): string, 必选 }}">namespace - **body**: }}">Ingress, 必选 - - + +- **dryRun** (*查询参数*): string }}">dryRun - + +- **fieldManager** (*查询参数*): string }}">fieldManager - + +- **fieldValidation** (*查询参数*): string }}">fieldValidation - + +- **pretty** (*查询参数*): string }}">pretty +#### 应答 200 (}}">Ingress): OK 201 (}}">Ingress): Created 401: Unauthorized ---> + -- **name** (*in path*): string, 必选 +- **name** (*路径参数*): string, 必需 - Ingress名称 + Ingress 名称 -- **namespace** (*in path*): string, 必选 +- **namespace** (*路径参数*): string, 必需 }}">namespace -- **body**: }}">Ingress, 必选 - - +- **body**: }}">Ingress, 必需 + +- **dryRun** (*查询参数*): string }}">dryRun - + +- **fieldManager** (*查询参数*): string }}">fieldManager - + +- **fieldValidation** (*查询参数*): string }}">fieldValidation - + +- **pretty** (*查询参数*): string }}">pretty - + #### 应答 - 200 (}}">Ingress): OK 201 (}}">Ingress): Created -401: 未授权 +401: Unauthorized + -- **name** (*in path*): string, 必选 +- **name** (*路径参数*): string, 必需 - Ingress名称 + Ingress 名称 -- **namespace** (*in path*): string, 必选 +- **namespace** (*路径参数*): string, 必需 }}">namespace -- **body**: }}">Patch, 必选 - +- **body**: }}">Patch, 必需 + +- **dryRun** (*查询参数*): string }}">dryRun - + +- **fieldManager** (*查询参数*): string }}">fieldManager - + +- **fieldValidation** (*查询参数*): string }}">fieldValidation - + +- **force** (*查询参数*): boolean }}">force - + +- **pretty** (*查询参数*): string }}">pretty #### 应答 - 200 (}}">Ingress): OK 201 (}}">Ingress): Created -401: 未授权 +401: Unauthorized + -- **name** (*in path*): string, required +- **name** (*路径参数*): string, 必需 - Ingress名称 + Ingress 名称 -- **namespace** (*in path*): string, 必选 +- **namespace** (*路径参数*): string, 必需 }}">namespace -- **body**: }}">Patch, 必选 +- **body**: }}">Patch, 必需 - + +- **dryRun** (*查询参数*): string }}">dryRun - + +- **fieldManager** (*查询参数*): string }}">fieldManager - + +- **fieldValidation** (*查询参数*): string }}">fieldValidation - + +- **force** (*查询参数*): boolean }}">force - + +- **pretty** (*查询参数*): string }}">pretty #### 应答 - 200 (}}">Ingress): OK 201 (}}">Ingress): Created -401: 未授权 +401: Unauthorized + -- **name** (*in path*): string, 必选 +- **name** (*路径参数*): string, 必需 - Ingress名称 + Ingress 名称 -- **namespace** (*in path*): string, 必选 +- **namespace** (*路径参数*): string, 必需 }}">namespace - - - **body**: }}">DeleteOptions - + +- **dryRun** (*查询参数*): string }}">dryRun - + +- **gracePeriodSeconds** (*查询参数*): integer }}">gracePeriodSeconds - + +- **pretty** (*查询参数*): string }}">pretty - + +- **propagationPolicy** (*查询参数*): string }}">propagationPolicy #### 应答 @@ -1357,7 +1360,7 @@ DELETE /apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name} 202 (}}">Status): Accepted -401: 未授权 +401: Unauthorized -- **namespace** (*in path*): string, 必选 +- **namespace** (*路径参数*): string, 必需 }}">namespace - **body**: }}">DeleteOptions - - - + +- **continue** (*查询参数*): string }}">continue - + +- **dryRun** (*查询参数*): string }}">dryRun - + +- **fieldSelector** (*查询参数*): string }}">fieldSelector - + +- **gracePeriodSeconds** (*查询参数*): integer }}">gracePeriodSeconds - + +- **labelSelector** (*查询参数*): string }}">labelSelector - + +- **limit** (*查询参数*): integer }}">limit - + +- **pretty** (*查询参数*): string }}">pretty - + +- **propagationPolicy** (*查询参数*): string }}">propagationPolicy - + +- **resourceVersion** (*查询参数*): string }}">resourceVersion - + +- **resourceVersionMatch** (*查询参数*): string }}">resourceVersionMatch - + +- **timeoutSeconds** (*查询参数*): integer }}">timeoutSeconds +#### 应答 200 (}}">Status): OK 401: Unauthorized ---> -#### 应答 - -200 (}}">Status): OK -401: 未授权