Merge pull request #22813 from tengqm/zh-tune-ingress
[zh] Tune the Chinese localization for Ingresspull/22833/head
commit
5a63e3346a
|
@ -4,8 +4,6 @@ content_type: concept
|
||||||
weight: 40
|
weight: 40
|
||||||
---
|
---
|
||||||
<!--
|
<!--
|
||||||
reviewers:
|
|
||||||
- bprashanth
|
|
||||||
title: Ingress
|
title: Ingress
|
||||||
content_type: concept
|
content_type: concept
|
||||||
weight: 40
|
weight: 40
|
||||||
|
@ -21,7 +19,7 @@ weight: 40
|
||||||
<!--
|
<!--
|
||||||
## Terminology
|
## Terminology
|
||||||
-->
|
-->
|
||||||
## 专用术语
|
## 术语
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
For clarity, this guide defines the following terms:
|
For clarity, this guide defines the following terms:
|
||||||
|
@ -36,10 +34,14 @@ For clarity, this guide defines the following terms:
|
||||||
* Service: A Kubernetes {{< glossary_tooltip term_id="service" >}} that identifies a set of Pods using {{< glossary_tooltip text="label" term_id="label" >}} selectors. Unless mentioned otherwise, Services are assumed to have virtual IPs only routable within the cluster network.
|
* Service: A Kubernetes {{< glossary_tooltip term_id="service" >}} that identifies a set of Pods using {{< glossary_tooltip text="label" term_id="label" >}} selectors. Unless mentioned otherwise, Services are assumed to have virtual IPs only routable within the cluster network.
|
||||||
-->
|
-->
|
||||||
* 节点(Node): Kubernetes 集群中其中一台工作机器,是集群的一部分。
|
* 节点(Node): Kubernetes 集群中其中一台工作机器,是集群的一部分。
|
||||||
* 集群(Cluster): 一组运行程序(这些程序是容器化的,被 Kubernetes 管理的)的节点。 在此示例中,和在大多数常见的Kubernetes部署方案,集群中的节点都不会是公共网络。
|
* 集群(Cluster): 一组运行由 Kubernetes 管理的容器化应用程序的节点。
|
||||||
* 边缘路由器(Edge router): 在集群中强制性执行防火墙策略的路由器(router)。可以是由云提供商管理的网关,也可以是物理硬件。
|
在此示例和在大多数常见的 Kubernetes 部署环境中,集群中的节点都不在公共网络中。
|
||||||
* 集群网络(Cluster network): 一组逻辑或物理的链接,根据 Kubernetes [网络模型](/docs/concepts/cluster-administration/networking/) 在集群内实现通信。
|
* 边缘路由器(Edge router): 在集群中强制执行防火墙策略的路由器(router)。可以是由云提供商管理的网关,也可以是物理硬件。
|
||||||
* 服务(Service):Kubernetes {{< glossary_tooltip term_id="service" >}} 使用 {{< glossary_tooltip text="标签" term_id="label" >}} 选择器(selectors)标识的一组 Pod。除非另有说明,否则假定服务只具有在集群网络中可路由的虚拟 IP。
|
* 集群网络(Cluster network): 一组逻辑的或物理的连接,根据 Kubernetes
|
||||||
|
[网络模型](/zh/docs/concepts/cluster-administration/networking/) 在集群内实现通信。
|
||||||
|
* 服务(Service):Kubernetes {{< glossary_tooltip text="服务" term_id="service" >}}使用
|
||||||
|
{{< glossary_tooltip text="标签" term_id="label" >}} 选择算符(selectors)标识的一组 Pod。
|
||||||
|
除非另有说明,否则假定服务只具有在集群网络中可路由的虚拟 IP。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
## What is Ingress?
|
## What is Ingress?
|
||||||
|
@ -52,7 +54,8 @@ For clarity, this guide defines the following terms:
|
||||||
Traffic routing is controlled by rules defined on the Ingress resource.
|
Traffic routing is controlled by rules defined on the Ingress resource.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
[Ingress](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#ingress-v1beta1-networking-k8s-io) 公开了从集群外部到集群内 {{< link text="services" url="/docs/concepts/services-networking/service/" >}} 的 HTTP 和 HTTPS 路由。
|
[Ingress](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#ingress-v1beta1-networking-k8s-io)
|
||||||
|
公开了从集群外部到集群内[服务](/zh/docs/concepts/services-networking/service/)的 HTTP 和 HTTPS 路由。
|
||||||
流量路由由 Ingress 资源上定义的规则控制。
|
流量路由由 Ingress 资源上定义的规则控制。
|
||||||
|
|
||||||
```none
|
```none
|
||||||
|
@ -66,7 +69,9 @@ Traffic routing is controlled by rules defined on the Ingress resource.
|
||||||
<!--
|
<!--
|
||||||
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.
|
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.
|
||||||
-->
|
-->
|
||||||
可以将 Ingress 配置为提供服务外部可访问的 URL、负载均衡流量、终止 SSL / TLS,以及提供基于名称的虚拟主机。[Ingress 控制器](/docs/concepts/services-networking/ingress-controllers) 通常负责通过负载均衡器来实现 Ingress,尽管它也可以配置边缘路由器或其他前端来帮助处理流量。
|
可以将 Ingress 配置为服务提供外部可访问的 URL、负载均衡流量、终止 SSL/TLS,以及提供基于名称的虚拟主机等能力。
|
||||||
|
[Ingress 控制器](/zh/docs/concepts/services-networking/ingress-controllers)
|
||||||
|
通常负责通过负载均衡器来实现 Ingress,尽管它也可以配置边缘路由器或其他前端来帮助处理流量。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
An Ingress does not expose arbitrary ports or protocols. Exposing services other than HTTP and HTTPS to the internet typically
|
An Ingress does not expose arbitrary ports or protocols. Exposing services other than HTTP and HTTPS to the internet typically
|
||||||
|
@ -74,23 +79,27 @@ uses a service of type [Service.Type=NodePort](/docs/concepts/services-networkin
|
||||||
[Service.Type=LoadBalancer](/docs/concepts/services-networking/service/#loadbalancer).
|
[Service.Type=LoadBalancer](/docs/concepts/services-networking/service/#loadbalancer).
|
||||||
-->
|
-->
|
||||||
Ingress 不会公开任意端口或协议。
|
Ingress 不会公开任意端口或协议。
|
||||||
将 HTTP 和 HTTPS 以外的服务公开到 Internet 时,通常使用 [Service.Type=NodePort](/docs/concepts/services-networking/service/#nodeport) 或者 [Service.Type=LoadBalancer](/docs/concepts/services-networking/service/#loadbalancer) 类型的服务。
|
将 HTTP 和 HTTPS 以外的服务公开到 Internet 时,通常使用
|
||||||
|
[Service.Type=NodePort](/zh/docs/concepts/services-networking/service/#nodeport)
|
||||||
|
或 [Service.Type=LoadBalancer](/zh/docs/concepts/services-networking/service/#loadbalancer)
|
||||||
|
类型的服务。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
## Prerequisites
|
## Prerequisites
|
||||||
|
|
||||||
|
You must have an [ingress controller](/docs/concepts/services-networking/ingress-controllers) to satisfy an Ingress. Only creating an Ingress resource has no effect.
|
||||||
-->
|
-->
|
||||||
## 环境准备
|
## 环境准备
|
||||||
|
|
||||||
<!--
|
你必须具有 [Ingress 控制器](/zh/docs/concepts/services-networking/ingress-controllers) 才能满足 Ingress 的要求。
|
||||||
You must have an [ingress controller](/docs/concepts/services-networking/ingress-controllers) to satisfy an Ingress. Only creating an Ingress resource has no effect.
|
仅创建 Ingress 资源本身没有任何效果。
|
||||||
-->
|
|
||||||
您必须具有 [ingress 控制器](/docs/concepts/services-networking/ingress-controllers) 才能满足 Ingress 的要求。仅创建 Ingress 资源无效。
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
You may need to deploy an Ingress controller such as [ingress-nginx](https://kubernetes.github.io/ingress-nginx/deploy/). You can choose from a number of
|
You may need to deploy an Ingress controller such as [ingress-nginx](https://kubernetes.github.io/ingress-nginx/deploy/). You can choose from a number of
|
||||||
[Ingress controllers](/docs/concepts/services-networking/ingress-controllers).
|
[Ingress controllers](/docs/concepts/services-networking/ingress-controllers).
|
||||||
-->
|
-->
|
||||||
您可能需要部署 Ingress 控制器,例如 [ingress-nginx](https://kubernetes.github.io/ingress-nginx/deploy/)。您可以从许多[Ingress 控制器](/docs/concepts/services-networking/ingress-controllers) 中进行选择。
|
你可能需要部署 Ingress 控制器,例如 [ingress-nginx](https://kubernetes.github.io/ingress-nginx/deploy/)。
|
||||||
|
你可以从许多 [Ingress 控制器](/zh/docs/concepts/services-networking/ingress-controllers) 中进行选择。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Ideally, all Ingress controllers should fit the reference specification. In reality, the various Ingress
|
Ideally, all Ingress controllers should fit the reference specification. In reality, the various Ingress
|
||||||
|
@ -107,12 +116,11 @@ Make sure you review your Ingress controller's documentation to understand the c
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
## The Ingress Resource
|
## The Ingress Resource
|
||||||
|
|
||||||
|
A minimal Ingress resource example:
|
||||||
-->
|
-->
|
||||||
## Ingress 资源
|
## Ingress 资源
|
||||||
|
|
||||||
<!--
|
|
||||||
A minimal Ingress resource example:
|
|
||||||
-->
|
|
||||||
一个最小的 Ingress 资源示例:
|
一个最小的 Ingress 资源示例:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
@ -144,10 +152,14 @@ Different [Ingress controller](/docs/concepts/services-networking/ingress-contro
|
||||||
your choice of Ingress controller to learn which annotations are supported.
|
your choice of Ingress controller to learn which annotations are supported.
|
||||||
-->
|
-->
|
||||||
与所有其他 Kubernetes 资源一样,Ingress 需要使用 `apiVersion`、`kind` 和 `metadata` 字段。
|
与所有其他 Kubernetes 资源一样,Ingress 需要使用 `apiVersion`、`kind` 和 `metadata` 字段。
|
||||||
Ingress 对象的命名必须是合法的 [DNS 子域名名称](/docs/concepts/overview/working-with-objects/names#dns-subdomain-names)。
|
Ingress 对象的命名必须是合法的 [DNS 子域名名称](/zh/docs/concepts/overview/working-with-objects/names#dns-subdomain-names)。
|
||||||
有关使用配置文件的一般信息,请参见[部署应用](/docs/tasks/run-application/run-stateless-application-deployment/)、 [配置容器](/docs/tasks/configure-pod-container/configure-pod-configmap/)、[管理资源](/docs/concepts/cluster-administration/manage-deployment/)。
|
有关使用配置文件的一般信息,请参见[部署应用](/zh/docs/tasks/run-application/run-stateless-application-deployment/)、
|
||||||
Ingress 经常使用注解(annotations)来配置一些选项,具体取决于 Ingress 控制器,例如 [rewrite-target annotation](https://github.com/kubernetes/ingress-nginx/blob/master/docs/examples/rewrite/README.md)。
|
[配置容器](/zh/docs/tasks/configure-pod-container/configure-pod-configmap/)、
|
||||||
不同的 [Ingress 控制器](/docs/concepts/services-networking/ingress-controllers) 支持不同的注解(annotations)。查看文档以供您选择 Ingress 控制器,以了解支持哪些注解(annotations)。
|
[管理资源](/zh/docs/concepts/cluster-administration/manage-deployment/)。
|
||||||
|
Ingress 经常使用注解(annotations)来配置一些选项,具体取决于 Ingress 控制器,例如
|
||||||
|
[重写目标注解](https://github.com/kubernetes/ingress-nginx/blob/master/docs/examples/rewrite/README.md)。
|
||||||
|
不同的 [Ingress 控制器](/zh/docs/concepts/services-networking/ingress-controllers)
|
||||||
|
支持不同的注解。查看文档以供您选择 Ingress 控制器,以了解支持哪些注解。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
The Ingress [spec](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status)
|
The Ingress [spec](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status)
|
||||||
|
@ -155,12 +167,15 @@ has all the information needed to configure a load balancer or proxy server. Mos
|
||||||
contains a list of rules matched against all incoming requests. Ingress resource only supports rules
|
contains a list of rules matched against all incoming requests. Ingress resource only supports rules
|
||||||
for directing HTTP traffic.
|
for directing HTTP traffic.
|
||||||
-->
|
-->
|
||||||
Ingress [规范](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status) 具有配置负载均衡器或者代理服务器所需的所有信息。最重要的是,它包含与所有传入请求匹配的规则列表。Ingress 资源仅支持用于定向 HTTP 流量的规则。
|
Ingress [规约](https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status)
|
||||||
|
提供了配置负载均衡器或者代理服务器所需的所有信息。
|
||||||
|
最重要的是,其中包含与所有传入请求匹配的规则列表。
|
||||||
|
Ingress 资源仅支持用于转发 HTTP 流量的规则。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
### Ingress rules
|
### Ingress rules
|
||||||
-->
|
-->
|
||||||
### Ingress 规则
|
### Ingress 规则 {#ingress-rules}
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Each HTTP rule contains the following information:
|
Each HTTP rule contains the following information:
|
||||||
|
@ -178,43 +193,46 @@ Each HTTP rule contains the following information:
|
||||||
[Service doc](/docs/concepts/services-networking/service/). HTTP (and HTTPS) requests to the
|
[Service doc](/docs/concepts/services-networking/service/). HTTP (and HTTPS) requests to the
|
||||||
Ingress that matches the host and path of the rule are sent to the listed backend.
|
Ingress that matches the host and path of the rule are sent to the listed backend.
|
||||||
-->
|
-->
|
||||||
* 可选主机。在此示例中,未指定主机,因此该规则适用于通过指定 IP 地址的所有入站 HTTP 通信。如果提供了主机(例如 foo.bar.com),则规则适用于该主机。
|
* 可选主机。在此示例中,未指定主机,因此该规则适用于通过指定 IP 地址的所有入站 HTTP 通信。
|
||||||
* 路径列表(例如,`/testpath`),每个路径都有一个由 `serviceName` 和 `servicePort` 定义的关联后端。在负载均衡器将流量定向到引用的服务之前,主机和路径都必须匹配传入请求的内容。
|
如果提供了主机(例如 foo.bar.com),则规则适用于该主机。
|
||||||
* 后端是 [Service 文档](/docs/concepts/services-networking/service/)中所述的服务和端口名称的组合。与规则的主机和路径匹配的对 Ingress 的 HTTP(和 HTTPS )请求将发送到列出的后端。
|
* 路径列表(例如,`/testpath`),每个路径都有一个由 `serviceName` 和 `servicePort` 定义的关联后端。
|
||||||
|
在负载均衡器将流量定向到引用的服务之前,主机和路径都必须匹配传入请求的内容。
|
||||||
|
* 后端是 [Service 文档](/zh/docs/concepts/services-networking/service/)中所述的服务和端口名称的组合。
|
||||||
|
与规则的主机和路径匹配的对 Ingress 的 HTTP(和 HTTPS )请求将发送到列出的后端。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
A default backend is often configured in an Ingress controller to service any requests that do not
|
A default backend is often configured in an Ingress controller to service any requests that do not
|
||||||
match a path in the spec.
|
match a path in the spec.
|
||||||
-->
|
-->
|
||||||
通常在 Ingress 控制器中配置默认后端,以服务任何不符合规范中路径的请求。
|
通常在 Ingress 控制器中会配置默认后端,以服务任何不符合规范中路径的请求。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
### Default Backend
|
### Default Backend
|
||||||
-->
|
|
||||||
### 默认后端
|
|
||||||
|
|
||||||
<!--
|
|
||||||
An Ingress with no rules sends all traffic to a single default backend. The default
|
An Ingress with no rules sends all traffic to a single default backend. The default
|
||||||
backend is typically a configuration option of the [Ingress controller](/docs/concepts/services-networking/ingress-controllers) and is not specified in your Ingress resources.
|
backend is typically a configuration option of the [Ingress controller](/docs/concepts/services-networking/ingress-controllers) and is not specified in your Ingress resources.
|
||||||
-->
|
-->
|
||||||
没有规则的 Ingress 将所有流量发送到单个默认后端。默认后端通常是 [Ingress 控制器](/docs/concepts/services-networking/ingress-controllers)的配置选项,并且未在 Ingress 资源中指定。
|
### 默认后端
|
||||||
|
|
||||||
|
没有规则的 Ingress 将所有流量发送到同一个默认后端。
|
||||||
|
默认后端通常是 [Ingress 控制器](/zh/docs/concepts/services-networking/ingress-controllers)
|
||||||
|
的配置选项,并且未在 Ingress 资源中指定。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
If none of the hosts or paths match the HTTP request in the Ingress objects, the traffic is
|
If none of the hosts or paths match the HTTP request in the Ingress objects, the traffic is
|
||||||
routed to your default backend.
|
routed to your default backend.
|
||||||
-->
|
-->
|
||||||
如果没有主机或路径与 Ingress 对象中的 HTTP 请求匹配,则流量将路由到您的默认后端。
|
如果主机或路径都没有与 Ingress 对象中的 HTTP 请求匹配,则流量将路由到默认后端。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
### Path Types
|
### Path Types
|
||||||
-->
|
|
||||||
### 路径类型
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Each path in an Ingress has a corresponding path type. There are three supported
|
Each path in an Ingress has a corresponding path type. There are three supported
|
||||||
path types:
|
path types:
|
||||||
-->
|
-->
|
||||||
Ingress 中的每个路径都有对应的路径类型。支持三种类型:
|
### 路径类型 {#path-types}
|
||||||
|
|
||||||
|
Ingress 中的每个路径都有对应的路径类型。当前支持的路径类型有三种:
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
* _`ImplementationSpecific`_ (default): With this path type, matching is up to
|
* _`ImplementationSpecific`_ (default): With this path type, matching is up to
|
||||||
|
@ -232,13 +250,18 @@ Ingress 中的每个路径都有对应的路径类型。支持三种类型:
|
||||||
last element in request path, it is not a match (for example:
|
last element in request path, it is not a match (for example:
|
||||||
`/foo/bar` matches`/foo/bar/baz`, but does not match `/foo/barbaz`).
|
`/foo/bar` matches`/foo/bar/baz`, but does not match `/foo/barbaz`).
|
||||||
-->
|
-->
|
||||||
* _`ImplementationSpecific`_ (默认):对于这种类型,匹配取决于 IngressClass. 具体实现可以将其作为单独的 `pathType` 处理或者与 `Prefix` 或 `Exact` 类型作相同处理。
|
* _`ImplementationSpecific`_ (默认):对于这种类型,匹配取决于 IngressClass。
|
||||||
|
具体实现可以将其作为单独的 `pathType` 处理或者与 `Prefix` 或 `Exact` 类型作相同处理。
|
||||||
|
|
||||||
* _`Exact`_:精确匹配 URL 路径且对大小写敏感。
|
* _`Exact`_:精确匹配 URL 路径,且对大小写敏感。
|
||||||
|
|
||||||
|
* _`Prefix`_:基于以 `/` 分隔的 URL 路径前缀匹配。匹配对大小写敏感,并且对路径中的元素逐个完成。
|
||||||
|
路径元素指的是由 `/` 分隔符分隔的路径中的标签列表。
|
||||||
|
如果每个 _p_ 都是请求路径 _p_ 的元素前缀,则请求与路径 _p_ 匹配。
|
||||||
|
|
||||||
* _`Prefix`_:基于以 `/` 分割的 URL 路径前缀匹配。匹配对大小写敏感,并且对路径中的元素逐个完成。路径元素指的是由 `/` 分隔符分割的路径中的标签列表。如果每个 _p_ 都是请求路径 _p_ 的元素前缀,则请求与路径 _p_ 匹配。
|
|
||||||
{{< note >}}
|
{{< note >}}
|
||||||
如果路径的最后一个元素是请求路径中最后一个元素的子字符串,则不会匹配(例如:`/foo/bar` 匹配 `/foo/bar/baz`, 但不匹配 `/foo/barbaz`)。
|
如果路径的最后一个元素是请求路径中最后一个元素的子字符串,则不会匹配
|
||||||
|
(例如:`/foo/bar` 匹配 `/foo/bar/baz`, 但不匹配 `/foo/barbaz`)。
|
||||||
{{< /note >}}
|
{{< /note >}}
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
@ -248,22 +271,25 @@ cases precedence will be given first to the longest matching path. If two paths
|
||||||
are still equally matched, precedence will be given to paths with an exact path
|
are still equally matched, precedence will be given to paths with an exact path
|
||||||
type over prefix path type.
|
type over prefix path type.
|
||||||
-->
|
-->
|
||||||
#### 多重匹配
|
#### 多重匹配 {#multiple-matches}
|
||||||
|
|
||||||
在某些情况下,Ingress 中的多条路径会匹配同一个请求。这种情况下最长的匹配路径优先。如果仍然有两条同等的匹配路径,则精确路径类型优先于前缀路径类型。
|
在某些情况下,Ingress 中的多条路径会匹配同一个请求。
|
||||||
|
这种情况下最长的匹配路径优先。
|
||||||
|
如果仍然有两条同等的匹配路径,则精确路径类型优先于前缀路径类型。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
## Ingress Class
|
## Ingress Class
|
||||||
-->
|
|
||||||
## Ingress 类
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Ingresses can be implemented by different controllers, often with different
|
Ingresses can be implemented by different controllers, often with different
|
||||||
configuration. Each Ingress should specify a class, a reference to an
|
configuration. Each Ingress should specify a class, a reference to an
|
||||||
IngressClass resource that contains additional configuration including the name
|
IngressClass resource that contains additional configuration including the name
|
||||||
of the controller that should implement the class.
|
of the controller that should implement the class.
|
||||||
-->
|
-->
|
||||||
Ingress 可以由不同的控制器实现,通常使用不同的配置。每个 Ingress 应当指定一个类,一个对 IngressClass 资源的引用,该资源包含额外的配置,其中包括应当实现该类的控制器名称。
|
## Ingress 类 {#ingress-class}
|
||||||
|
|
||||||
|
Ingress 可以由不同的控制器实现,通常使用不同的配置。
|
||||||
|
每个 Ingress 应当指定一个类,也就是一个对 IngressClass 资源的引用。
|
||||||
|
IngressClass 资源包含额外的配置,其中包括应当实现该类的控制器名称。
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: networking.k8s.io/v1beta1
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
@ -282,21 +308,21 @@ spec:
|
||||||
IngressClass resources contain an optional parameters field. This can be used to
|
IngressClass resources contain an optional parameters field. This can be used to
|
||||||
reference additional configuration for this class.
|
reference additional configuration for this class.
|
||||||
-->
|
-->
|
||||||
IngressClass 资源包含一个可选的参数字段。可用于引用该类的额外配置。
|
IngressClass 资源包含一个可选的参数字段,可用于为该类引用额外配置。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
### Deprecated Annotation
|
### Deprecated Annotation
|
||||||
-->
|
|
||||||
### 废弃的注解
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Before the IngressClass resource and `ingressClassName` field were added in
|
Before the IngressClass resource and `ingressClassName` field were added in
|
||||||
Kubernetes 1.18, Ingress classes were specified with a
|
Kubernetes 1.18, Ingress classes were specified with a
|
||||||
`kubernetes.io/ingress.class` annotation on the Ingress. This annotation was
|
`kubernetes.io/ingress.class` annotation on the Ingress. This annotation was
|
||||||
never formally defined, but was widely supported by Ingress controllers.
|
never formally defined, but was widely supported by Ingress controllers.
|
||||||
-->
|
-->
|
||||||
在 IngressClass 资源和 `ingressClassName` 字段被引入 Kubernetes 1.18 之前,Ingress 类是通过 Ingress 中的一个
|
### 废弃的注解
|
||||||
`kubernetes.io/ingress.class` 注解来指定的。这个注解从未被正式定义过,但是得到了 Ingress 控制器的广泛支持。
|
|
||||||
|
在 Kubernetes 1.18 版本引入 IngressClass 资源和 `ingressClassName` 字段之前,
|
||||||
|
Ingress 类是通过 Ingress 中的一个 `kubernetes.io/ingress.class` 注解来指定的。
|
||||||
|
这个注解从未被正式定义过,但是得到了 Ingress 控制器的广泛支持。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
The newer `ingressClassName` field on Ingresses is a replacement for that
|
The newer `ingressClassName` field on Ingresses is a replacement for that
|
||||||
|
@ -305,21 +331,25 @@ used to reference the name of the Ingress controller that should implement the
|
||||||
Ingress, the field is a reference to an IngressClass resource that contains
|
Ingress, the field is a reference to an IngressClass resource that contains
|
||||||
additional Ingress configuration, including the name of the Ingress controller.
|
additional Ingress configuration, including the name of the Ingress controller.
|
||||||
-->
|
-->
|
||||||
Ingress 中新的 `ingressClassName` 字段是该注解的替代品,但并非完全等价。该注解通常用于引用实现该 Ingress 的控制器的名称,
|
Ingress 中新的 `ingressClassName` 字段是该注解的替代品,但并非完全等价。
|
||||||
而这个新的字段则是对一个包含额外 Ingress 配置的 IngressClass 资源的引用,包括 Ingress 控制器的名称。
|
该注解通常用于引用实现该 Ingress 的控制器的名称,
|
||||||
|
而这个新的字段则是对一个包含额外 Ingress 配置的 IngressClass 资源的引用,
|
||||||
|
包括 Ingress 控制器的名称。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
### Default Ingress Class
|
### Default Ingress Class
|
||||||
-->
|
|
||||||
### 默认 Ingress 类
|
|
||||||
|
|
||||||
<!--
|
|
||||||
You can mark a particular IngressClass as default for your cluster. Setting the
|
You can mark a particular IngressClass as default for your cluster. Setting the
|
||||||
`ingressclass.kubernetes.io/is-default-class` annotation to `true` on an
|
`ingressclass.kubernetes.io/is-default-class` annotation to `true` on an
|
||||||
IngressClass resource will ensure that new Ingresses without an
|
IngressClass resource will ensure that new Ingresses without an
|
||||||
`ingressClassName` field specified will be assigned this default IngressClass.
|
`ingressClassName` field specified will be assigned this default IngressClass.
|
||||||
-->
|
-->
|
||||||
您可以将一个特定的 IngressClass 标记为集群默认项。将一个 IngressClass 资源的 `ingressclass.kubernetes.io/is-default-class` 注解设置为 `true` 将确保新的未指定 `ingressClassName` 字段的 Ingress 能够分配为这个默认的 IngressClass.
|
### 默认 Ingress 类 {#default-ingress-class}
|
||||||
|
|
||||||
|
您可以将一个特定的 IngressClass 标记为集群默认选项。
|
||||||
|
将一个 IngressClass 资源的 `ingressclass.kubernetes.io/is-default-class` 注解设置为
|
||||||
|
`true` 将确保新的未指定 `ingressClassName` 字段的 Ingress 能够分配为这个默认的
|
||||||
|
IngressClass.
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
If you have more than one IngressClass marked as the default for your cluster,
|
If you have more than one IngressClass marked as the default for your cluster,
|
||||||
|
@ -328,26 +358,26 @@ an `ingressClassName` specified. You can resolve this by ensuring that at most 1
|
||||||
IngressClasess are marked as default in your cluster.
|
IngressClasess are marked as default in your cluster.
|
||||||
-->
|
-->
|
||||||
{{< caution >}}
|
{{< caution >}}
|
||||||
如果集群中有多个 IngressClass 被标记为默认,准入控制器将阻止创建新的未指定 `ingressClassName` 字段的 Ingress 对象。
|
如果集群中有多个 IngressClass 被标记为默认,准入控制器将阻止创建新的未指定 `ingressClassName`
|
||||||
|
的 Ingress 对象。
|
||||||
解决这个问题只需确保集群中最多只能有一个 IngressClass 被标记为默认。
|
解决这个问题只需确保集群中最多只能有一个 IngressClass 被标记为默认。
|
||||||
{{< /caution >}}
|
{{< /caution >}}
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
## Types of Ingress
|
## Types of Ingress
|
||||||
-->
|
|
||||||
## Ingress 类型
|
|
||||||
|
|
||||||
<!--
|
|
||||||
### Single Service Ingress
|
### Single Service Ingress
|
||||||
-->
|
|
||||||
### 单服务 Ingress
|
|
||||||
|
|
||||||
<!--
|
|
||||||
There are existing Kubernetes concepts that allow you to expose a single Service
|
There are existing Kubernetes concepts that allow you to expose a single Service
|
||||||
(see [alternatives](#alternatives)). You can also do this with an Ingress by specifying a
|
(see [alternatives](#alternatives)). You can also do this with an Ingress by specifying a
|
||||||
*default backend* with no rules.
|
*default backend* with no rules.
|
||||||
-->
|
-->
|
||||||
现有的 Kubernetes 概念允许您暴露单个 Service (查看[替代方案](#alternatives)),您也可以通过指定无规则的 *默认后端* 来对 Ingress 进行此操作。
|
## Ingress 类型 {#types-of-ingress}
|
||||||
|
|
||||||
|
### 单服务 Ingress {#single-service-ingress}
|
||||||
|
|
||||||
|
现有的 Kubernetes 概念允许您暴露单个 Service (查看[替代方案](#alternatives))。
|
||||||
|
你也可以通过指定无规则的 *默认后端* 来对 Ingress 进行此操作。
|
||||||
|
|
||||||
{{< codenew file="service/networking/ingress.yaml" >}}
|
{{< codenew file="service/networking/ingress.yaml" >}}
|
||||||
|
|
||||||
|
@ -377,19 +407,19 @@ Ingress controllers and load balancers may take a minute or two to allocate an I
|
||||||
Until that time, you often see the address listed as `<pending>`.
|
Until that time, you often see the address listed as `<pending>`.
|
||||||
-->
|
-->
|
||||||
{{< note >}}
|
{{< note >}}
|
||||||
入口控制器和负载平衡器可能需要一两分钟才能分配IP地址。 在此之前,您通常会看到地址字段的值被设定为 `<pending>`。
|
入口控制器和负载平衡器可能需要一两分钟才能分配 IP 地址。在此之前,您通常会看到地址字段的值被设定为
|
||||||
|
`<pending>`。
|
||||||
{{< /note >}}
|
{{< /note >}}
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
### Simple fanout
|
### Simple fanout
|
||||||
-->
|
|
||||||
### 简单分列
|
|
||||||
|
|
||||||
<!--
|
|
||||||
A fanout configuration routes traffic from a single IP address to more than one Service,
|
A fanout configuration routes traffic from a single IP address to more than one Service,
|
||||||
based on the HTTP URI being requested. An Ingress allows you to keep the number of load balancers
|
based on the HTTP URI being requested. An Ingress allows you to keep the number of load balancers
|
||||||
down to a minimum. For example, a setup like:
|
down to a minimum. For example, a setup like:
|
||||||
-->
|
-->
|
||||||
|
### 简单分列
|
||||||
|
|
||||||
一个分列配置根据请求的 HTTP URI 将流量从单个 IP 地址路由到多个服务。
|
一个分列配置根据请求的 HTTP URI 将流量从单个 IP 地址路由到多个服务。
|
||||||
Ingress 允许您将负载均衡器的数量降至最低。例如,这样的设置:
|
Ingress 允许您将负载均衡器的数量降至最低。例如,这样的设置:
|
||||||
|
|
||||||
|
@ -401,7 +431,7 @@ foo.bar.com -> 178.91.123.132 -> / foo service1:4200
|
||||||
<!--
|
<!--
|
||||||
would require an Ingress such as:
|
would require an Ingress such as:
|
||||||
-->
|
-->
|
||||||
将需要一个 Ingress,例如:
|
将需要一个如下所示的 Ingress:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: networking.k8s.io/v1beta1
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
@ -428,7 +458,7 @@ spec:
|
||||||
<!--
|
<!--
|
||||||
When you create the Ingress with `kubectl apply -f`:
|
When you create the Ingress with `kubectl apply -f`:
|
||||||
-->
|
-->
|
||||||
当您使用 `kubectl apply -f` 创建 Ingress 时:
|
当你使用 `kubectl apply -f` 创建 Ingress 时:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl describe ingress simple-fanout-example
|
kubectl describe ingress simple-fanout-example
|
||||||
|
@ -459,9 +489,8 @@ that satisfies the Ingress, as long as the Services (`service1`, `service2`) exi
|
||||||
When it has done so, you can see the address of the load balancer at the
|
When it has done so, you can see the address of the load balancer at the
|
||||||
Address field.
|
Address field.
|
||||||
-->
|
-->
|
||||||
|
|
||||||
Ingress 控制器将提供实现特定的负载均衡器来满足 Ingress,只要 Service (`service1`,`service2`) 存在。
|
Ingress 控制器将提供实现特定的负载均衡器来满足 Ingress,只要 Service (`service1`,`service2`) 存在。
|
||||||
当它这样做了,您会在地址栏看到负载均衡器的地址。
|
当它这样做了,你会在地址字段看到负载均衡器的地址。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Depending on the [Ingress controller](/docs/concepts/services-networking/ingress-controllers)
|
Depending on the [Ingress controller](/docs/concepts/services-networking/ingress-controllers)
|
||||||
|
@ -469,19 +498,18 @@ you are using, you may need to create a default-http-backend
|
||||||
[Service](/docs/concepts/services-networking/service/).
|
[Service](/docs/concepts/services-networking/service/).
|
||||||
-->
|
-->
|
||||||
{{< note >}}
|
{{< note >}}
|
||||||
根据您使用的 [Ingress 控制器](/docs/concepts/services-networking/ingress-controllers),您可能需要创建默认 HTTP 后端 [Service](/docs/concepts/services-networking/service/)。
|
取决于你使用的 [Ingress 控制器](/zh/docs/concepts/services-networking/ingress-controllers),
|
||||||
|
你可能需要创建默认 HTTP 后端[服务](/zh/docs/concepts/services-networking/service/)。
|
||||||
{{< /note >}}
|
{{< /note >}}
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
### Name based virtual hosting
|
### Name based virtual hosting
|
||||||
|
|
||||||
|
Name-based virtual hosts support routing HTTP traffic to multiple host names at the same IP address.
|
||||||
-->
|
-->
|
||||||
### 基于名称的虚拟托管
|
### 基于名称的虚拟托管
|
||||||
|
|
||||||
<!--
|
基于名称的虚拟主机支持将针对多个主机名的 HTTP 流量路由到同一 IP 地址上。
|
||||||
Name-based virtual hosts support routing HTTP traffic to multiple host names at the same IP address.
|
|
||||||
-->
|
|
||||||
基于名称的虚拟主机支持将 HTTP 流量路由到同一 IP 地址上的多个主机名。
|
|
||||||
|
|
||||||
```none
|
```none
|
||||||
foo.bar.com --| |-> foo.bar.com service1:80
|
foo.bar.com --| |-> foo.bar.com service1:80
|
||||||
|
@ -489,12 +517,12 @@ foo.bar.com --| |-> foo.bar.com service1:80
|
||||||
bar.foo.com --| |-> bar.foo.com service2:80
|
bar.foo.com --| |-> bar.foo.com service2:80
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
The following Ingress tells the backing load balancer to route requests based on
|
The following Ingress tells the backing load balancer to route requests based on
|
||||||
the [Host header](https://tools.ietf.org/html/rfc7230#section-5.4).
|
the [Host header](https://tools.ietf.org/html/rfc7230#section-5.4).
|
||||||
-->
|
-->
|
||||||
以下 Ingress 让后台负载均衡器基于[主机 header](https://tools.ietf.org/html/rfc7230#section-5.4) 路由请求。
|
以下 Ingress 让后台负载均衡器基于[host 头部字段](https://tools.ietf.org/html/rfc7230#section-5.4)
|
||||||
|
来路由请求。
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: networking.k8s.io/v1beta1
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
@ -522,7 +550,8 @@ If you create an Ingress resource without any hosts defined in the rules, then a
|
||||||
web traffic to the IP address of your Ingress controller can be matched without a name based
|
web traffic to the IP address of your Ingress controller can be matched without a name based
|
||||||
virtual host being required.
|
virtual host being required.
|
||||||
-->
|
-->
|
||||||
如果您创建的 Ingress 资源没有规则中定义的任何主机,则可以匹配到您 Ingress 控制器 IP 地址的任何网络流量,而无需基于名称的虚拟主机。
|
如果您创建的 Ingress 资源没有规则中定义的任何主机,则可以匹配指向 Ingress 控制器 IP 地址
|
||||||
|
的任何网络流量,而无需基于名称的虚拟主机。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
For example, the following Ingress resource will route traffic
|
For example, the following Ingress resource will route traffic
|
||||||
|
@ -530,7 +559,9 @@ requested for `first.bar.com` to `service1`, `second.foo.com` to `service2`, and
|
||||||
to the IP address without a hostname defined in request (that is, without a request header being
|
to the IP address without a hostname defined in request (that is, without a request header being
|
||||||
presented) to `service3`.
|
presented) to `service3`.
|
||||||
-->
|
-->
|
||||||
例如,以下 Ingress 资源会将 `first.bar.com` 请求的流量路由到 `service1`,将 `second.foo.com` 请求的流量路由到 `service2`,而没有在请求中定义主机名的 IP 地址的流量路由(即,不提供请求标头)到 `service3`。
|
例如,以下 Ingress 资源会将 `first.bar.com` 请求的流量路由到 `service1`,
|
||||||
|
将 `second.foo.com` 请求的流量路由到 `service2`,
|
||||||
|
而没有在请求中定义主机名的 IP 地址的流量路由(即,不提供请求标头)到 `service3`。
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: networking.k8s.io/v1beta1
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
@ -560,11 +591,7 @@ spec:
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
### TLS
|
### TLS
|
||||||
-->
|
|
||||||
### TLS
|
|
||||||
|
|
||||||
|
|
||||||
<!--
|
|
||||||
You can secure an Ingress by specifying a {{< glossary_tooltip term_id="secret" >}}
|
You can secure an Ingress by specifying a {{< glossary_tooltip term_id="secret" >}}
|
||||||
that contains a TLS private key and certificate. Currently the Ingress only
|
that contains a TLS private key and certificate. Currently the Ingress only
|
||||||
supports a single TLS port, 443, and assumes TLS termination. If the TLS
|
supports a single TLS port, 443, and assumes TLS termination. If the TLS
|
||||||
|
@ -574,12 +601,16 @@ SNI TLS extension (provided the Ingress controller supports SNI). The TLS secret
|
||||||
must contain keys named `tls.crt` and `tls.key` that contain the certificate
|
must contain keys named `tls.crt` and `tls.key` that contain the certificate
|
||||||
and private key to use for TLS. For example:
|
and private key to use for TLS. For example:
|
||||||
-->
|
-->
|
||||||
|
### TLS
|
||||||
|
|
||||||
您可以通过指定包含 TLS 私钥和证书的 secret {{< glossary_tooltip term_id="secret" >}} 来加密 Ingress。
|
你可以通过设定包含 TLS 私钥和证书的{{< glossary_tooltip text="Secret" term_id="secret" >}}
|
||||||
|
来保护 Ingress。
|
||||||
目前,Ingress 只支持单个 TLS 端口 443,并假定 TLS 终止。
|
目前,Ingress 只支持单个 TLS 端口 443,并假定 TLS 终止。
|
||||||
|
|
||||||
如果 Ingress 中的 TLS 配置部分指定了不同的主机,那么它们将根据通过 SNI TLS 扩展指定的主机名(如果 Ingress 控制器支持 SNI)在同一端口上进行复用。
|
如果 Ingress 中的 TLS 配置部分指定了不同的主机,那么它们将根据通过 SNI TLS 扩展指定的主机名
|
||||||
TLS Secret 必须包含名为 `tls.crt` 和 `tls.key` 的密钥,这些密钥包含用于 TLS 的证书和私钥,例如:
|
(如果 Ingress 控制器支持 SNI)在同一端口上进行复用。
|
||||||
|
TLS Secret 必须包含名为 `tls.crt` 和 `tls.key` 的键名。
|
||||||
|
这些数据包含用于 TLS 的证书和私钥。例如:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
|
@ -599,7 +630,9 @@ secure the channel from the client to the load balancer using TLS. You need to m
|
||||||
sure the TLS secret you created came from a certificate that contains a Common
|
sure the TLS secret you created came from a certificate that contains a Common
|
||||||
Name (CN), also known as a Fully Qualified Domain Name (FQDN) for `sslexample.foo.com`.
|
Name (CN), also known as a Fully Qualified Domain Name (FQDN) for `sslexample.foo.com`.
|
||||||
-->
|
-->
|
||||||
在 Ingress 中引用此 Secret 将会告诉 Ingress 控制器使用 TLS 加密从客户端到负载均衡器的通道。您需要确保创建的 TLS secret 来自包含 `sslexample.foo.com` 的公用名称(CN)的证书,也被称为全限定域名(FQDN)。
|
在 Ingress 中引用此 Secret 将会告诉 Ingress 控制器使用 TLS 加密从客户端到负载均衡器的通道。
|
||||||
|
你需要确保创建的 TLS Secret 来自包含 `sslexample.foo.com` 的公用名称(CN)的证书。
|
||||||
|
这里的公共名称也被称为全限定域名(FQDN)。
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: networking.k8s.io/v1beta1
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
|
@ -629,17 +662,15 @@ controllers. Please refer to documentation on
|
||||||
platform specific Ingress controller to understand how TLS works in your environment.
|
platform specific Ingress controller to understand how TLS works in your environment.
|
||||||
-->
|
-->
|
||||||
{{< note >}}
|
{{< note >}}
|
||||||
各种 Ingress 控制器所支持的 TLS 功能之间存在差异。请参阅有关文件
|
各种 Ingress 控制器所支持的 TLS 功能之间存在差异。请参阅有关
|
||||||
[nginx](https://kubernetes.github.io/ingress-nginx/user-guide/tls/)、
|
[nginx](https://kubernetes.github.io/ingress-nginx/user-guide/tls/)、
|
||||||
[GCE](https://git.k8s.io/ingress-gce/README.md#frontend-https) 或者任何其他平台特定的 Ingress 控制器,以了解 TLS 如何在您的环境中工作。
|
[GCE](https://git.k8s.io/ingress-gce/README.md#frontend-https)
|
||||||
|
或者任何其他平台特定的 Ingress 控制器的文档,以了解 TLS 如何在你的环境中工作。
|
||||||
{{< /note >}}
|
{{< /note >}}
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
### Loadbalancing
|
### Loadbalancing
|
||||||
-->
|
|
||||||
### 负载均衡
|
|
||||||
|
|
||||||
<!--
|
|
||||||
An Ingress controller is bootstrapped with some load balancing policy settings
|
An Ingress controller is bootstrapped with some load balancing policy settings
|
||||||
that it applies to all Ingress, such as the load balancing algorithm, backend
|
that it applies to all Ingress, such as the load balancing algorithm, backend
|
||||||
weight scheme, and others. More advanced load balancing concepts
|
weight scheme, and others. More advanced load balancing concepts
|
||||||
|
@ -647,32 +678,36 @@ weight scheme, and others. More advanced load balancing concepts
|
||||||
Ingress. You can instead get these features through the load balancer used for
|
Ingress. You can instead get these features through the load balancer used for
|
||||||
a Service.
|
a Service.
|
||||||
-->
|
-->
|
||||||
|
### 负载均衡
|
||||||
|
|
||||||
Ingress 控制器使用一些适用于所有 Ingress 的负载均衡策略设置进行自举,例如负载均衡算法、后端权重方案和其他等。更高级的负载均衡概念(例如,持久会话、动态权重)尚未通过 Ingress 公开。您可以通过用于服务的负载均衡器来获取这些功能。
|
Ingress 控制器启动引导时使用一些适用于所有 Ingress 的负载均衡策略设置,
|
||||||
|
例如负载均衡算法、后端权重方案和其他等。
|
||||||
|
更高级的负载均衡概念(例如持久会话、动态权重)尚未通过 Ingress 公开。
|
||||||
|
你可以通过用于服务的负载均衡器来获取这些功能。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
It's also worth noting that even though health checks are not exposed directly
|
It's also worth noting that even though health checks are not exposed directly
|
||||||
through the Ingress, there exist parallel concepts in Kubernetes such as
|
through the Ingress, there exist parallel concepts in Kubernetes such as
|
||||||
[readiness probes](/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/)
|
[readiness probes](/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
|
||||||
that allow you to achieve the same end result. Please review the controller
|
that allow you to achieve the same end result. Please review the controller
|
||||||
specific documentation to see how they handle health checks (
|
specific documentation to see how they handle health checks (
|
||||||
[nginx](https://git.k8s.io/ingress-nginx/README.md),
|
[nginx](https://git.k8s.io/ingress-nginx/README.md),
|
||||||
[GCE](https://git.k8s.io/ingress-gce/README.md#health-checks)).
|
[GCE](https://git.k8s.io/ingress-gce/README.md#health-checks)).
|
||||||
-->
|
-->
|
||||||
值得注意的是,即使健康检查不是通过 Ingress 直接暴露的,但是在 Kubernetes 中存在并行概念,比如 [就绪检查](/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/),它允许您实现相同的最终结果。
|
值得注意的是,即使健康检查不是通过 Ingress 直接暴露的,在 Kubernetes
|
||||||
请检查控制器特殊说明文档,以了解他们是怎样处理健康检查的 (
|
中存在并行概念,比如[就绪检查](/zh/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/)
|
||||||
|
允许你实现相同的目的。
|
||||||
|
请检查特定控制器的说明文档,以了解它们是怎样处理健康检查的 (
|
||||||
[nginx](https://git.k8s.io/ingress-nginx/README.md),
|
[nginx](https://git.k8s.io/ingress-nginx/README.md),
|
||||||
[GCE](https://git.k8s.io/ingress-gce/README.md#health-checks))。
|
[GCE](https://git.k8s.io/ingress-gce/README.md#health-checks))。
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
## Updating an Ingress
|
## Updating an Ingress
|
||||||
|
|
||||||
|
To update an existing Ingress to add a new Host, you can update it by editing the resource:
|
||||||
-->
|
-->
|
||||||
## 更新 Ingress
|
## 更新 Ingress
|
||||||
|
|
||||||
<!--
|
|
||||||
To update an existing Ingress to add a new Host, you can update it by editing the resource:
|
|
||||||
-->
|
|
||||||
要更新现有的 Ingress 以添加新的 Host,可以通过编辑资源来对其进行更新:
|
要更新现有的 Ingress 以添加新的 Host,可以通过编辑资源来对其进行更新:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
@ -705,8 +740,7 @@ kubectl edit ingress test
|
||||||
This pops up an editor with the existing configuration in YAML format.
|
This pops up an editor with the existing configuration in YAML format.
|
||||||
Modify it to include the new Host:
|
Modify it to include the new Host:
|
||||||
-->
|
-->
|
||||||
|
这一命令将打开编辑器,允许你以 YAML 格式编辑现有配置。
|
||||||
这将弹出具有 YAML 格式的现有配置的编辑器。
|
|
||||||
修改它来增加新的主机:
|
修改它来增加新的主机:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
@ -768,45 +802,42 @@ Events:
|
||||||
<!--
|
<!--
|
||||||
You can achieve the same outcome by invoking `kubectl replace -f` on a modified Ingress YAML file.
|
You can achieve the same outcome by invoking `kubectl replace -f` on a modified Ingress YAML file.
|
||||||
-->
|
-->
|
||||||
您可以通过 `kubectl replace -f` 命令调用修改后的 Ingress yaml 文件来获得同样的结果。
|
你也可以通过 `kubectl replace -f` 命令调用修改后的 Ingress yaml 文件来获得同样的结果。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
## Failing across availability zones
|
## Failing across availability zones
|
||||||
-->
|
|
||||||
## 跨可用区失败
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Techniques for spreading traffic across failure domains differs between cloud providers.
|
Techniques for spreading traffic across failure domains differs between cloud providers.
|
||||||
Please check the documentation of the relevant [Ingress controller](/docs/concepts/services-networking/ingress-controllers) for details. You can also refer to the [federation documentation](https://github.com/kubernetes-sigs/federation-v2)
|
Please check the documentation of the relevant [Ingress controller](/docs/concepts/services-networking/ingress-controllers) for details. You can also refer to the [federation documentation](https://github.com/kubernetes-sigs/federation-v2)
|
||||||
for details on deploying Ingress in a federated cluster.
|
for details on deploying Ingress in a federated cluster.
|
||||||
-->
|
-->
|
||||||
|
## 跨可用区失败 {#failing-across-availability-zones}
|
||||||
|
|
||||||
用于跨故障域传播流量的技术在云提供商之间是不同的。详情请查阅相关 Ingress 控制器的文档。
|
不同的云厂商使用不同的技术来实现跨故障域的流量分布。详情请查阅相关 Ingress 控制器的文档。
|
||||||
请查看相关[ Ingress 控制器](/docs/concepts/services-networking/ingress-controllers) 的文档以了解详细信息。
|
请查看相关[ Ingress 控制器](/zh/docs/concepts/services-networking/ingress-controllers) 的文档以了解详细信息。
|
||||||
您还可以参考[联邦文档](https://github.com/kubernetes-sigs/federation-v2),以获取有关在联合集群中部署 Ingress 的详细信息。
|
你还可以参考[联邦文档](https://github.com/kubernetes-sigs/federation-v2),以获取有关在联合集群中部署 Ingress 的详细信息。
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
## Future Work
|
## Future Work
|
||||||
-->
|
|
||||||
## 未来工作
|
|
||||||
|
|
||||||
<!--
|
|
||||||
Track [SIG Network](https://github.com/kubernetes/community/tree/master/sig-network)
|
Track [SIG Network](https://github.com/kubernetes/community/tree/master/sig-network)
|
||||||
for more details on the evolution of Ingress and related resources. You may also track the
|
for more details on the evolution of Ingress and related resources. You may also track the
|
||||||
[Ingress repository](https://github.com/kubernetes/ingress/tree/master) for more details on the
|
[Ingress repository](https://github.com/kubernetes/ingress/tree/master) for more details on the
|
||||||
evolution of various Ingress controllers.
|
evolution of various Ingress controllers.
|
||||||
-->
|
-->
|
||||||
跟踪 [SIG 网络](https://github.com/kubernetes/community/tree/master/sig-network)以获得有关 Ingress 和相关资源演变的更多细节。您还可以跟踪 [Ingress 仓库](https://github.com/kubernetes/ingress/tree/master)以获取有关各种 Ingress 控制器的更多细节。
|
## 未来工作
|
||||||
|
跟踪 [SIG Network](https://github.com/kubernetes/community/tree/master/sig-network)
|
||||||
|
的活动以获得有关 Ingress 和相关资源演变的更多细节。
|
||||||
|
你还可以跟踪 [Ingress 仓库](https://github.com/kubernetes/ingress/tree/master)
|
||||||
|
以获取有关各种 Ingress 控制器的更多细节。
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
## Alternatives
|
## Alternatives
|
||||||
-->
|
|
||||||
## 替代方案
|
|
||||||
|
|
||||||
<!--
|
|
||||||
You can expose a Service in multiple ways that don't directly involve the Ingress resource:
|
You can expose a Service in multiple ways that don't directly involve the Ingress resource:
|
||||||
-->
|
-->
|
||||||
|
## 替代方案 {#alternatives}
|
||||||
|
|
||||||
不直接使用 Ingress 资源,也有多种方法暴露 Service:
|
不直接使用 Ingress 资源,也有多种方法暴露 Service:
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
@ -816,8 +847,6 @@ You can expose a Service in multiple ways that don't directly involve the Ingres
|
||||||
* 使用 [Service.Type=LoadBalancer](/docs/concepts/services-networking/service/#loadbalancer)
|
* 使用 [Service.Type=LoadBalancer](/docs/concepts/services-networking/service/#loadbalancer)
|
||||||
* 使用 [Service.Type=NodePort](/docs/concepts/services-networking/service/#nodeport)
|
* 使用 [Service.Type=NodePort](/docs/concepts/services-networking/service/#nodeport)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## {{% heading "whatsnext" %}}
|
## {{% heading "whatsnext" %}}
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
@ -825,7 +854,7 @@ You can expose a Service in multiple ways that don't directly involve the Ingres
|
||||||
* Learn about [Ingress Controllers](/docs/concepts/services-networking/ingress-controllers/)
|
* Learn about [Ingress Controllers](/docs/concepts/services-networking/ingress-controllers/)
|
||||||
* [Set up Ingress on Minikube with the NGINX Controller](/docs/tasks/access-application-cluster/ingress-minikube)
|
* [Set up Ingress on Minikube with the NGINX Controller](/docs/tasks/access-application-cluster/ingress-minikube)
|
||||||
-->
|
-->
|
||||||
* 了解更多 [Ingress API](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#ingress-v1beta1-networking-k8s-io)
|
* 进一步了解 [Ingress API](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#ingress-v1beta1-networking-k8s-io)
|
||||||
* 了解更多 [Ingress 控制器](/docs/concepts/services-networking/ingress-controllers/)
|
* 进一步了解 [Ingress 控制器](/zh/docs/concepts/services-networking/ingress-controllers/)
|
||||||
* [使用 NGINX 控制器在 Minikube 上安装 Ingress](/docs/tasks/access-application-cluster/ingress-minikube)
|
* [使用 NGINX 控制器在 Minikube 上安装 Ingress](/zh/docs/tasks/access-application-cluster/ingress-minikube)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue