mirror of https://github.com/istio/istio.io.git
* sync l7 update part * finish translate * fix lint * fix lint
This commit is contained in:
parent
1727446158
commit
c4e8f533b2
|
|
@ -1,43 +1,65 @@
|
|||
---
|
||||
title: 使用 Layer 7 功能
|
||||
title: 使用七层功能
|
||||
description: 使用 L7 waypoint 代理时所支持的功能。
|
||||
weight: 50
|
||||
owner: istio/wg-networking-maintainers
|
||||
test: no
|
||||
---
|
||||
|
||||
通过向流量添加 waypoint 代理,您可以启用更多 [Istio 功能](/zh/docs/concepts)。
|
||||
|
||||
Ambient 模式支持使用 Kubernetes Gateway API 配置 waypoint。
|
||||
适用于 Gateway API 的配置被称为**策略**。
|
||||
通过向您的流量流添加 waypoint 代理,您可以启用更多 [Istio 的功能](/zh/docs/concepts)。
|
||||
waypoint 使用 {{< gloss "gateway api" >}}Kubernetes Gateway API{{< /gloss >}} 配置。
|
||||
|
||||
{{< warning >}}
|
||||
Istio 经典流量管理 API(虚拟服务、目标规则等)在 Ambient 数据平面模式下仍处于 Alpha 状态。
|
||||
Istio 经典流量管理 API(虚拟服务、目标规则等)在与 Ambient 数据平面模式一起使用时仍处于 Alpha 阶段。
|
||||
|
||||
不支持混合使用 Istio 经典 API 和 Gateway API 配置,这会导致未定义的行为。
|
||||
{{< /warning >}}
|
||||
|
||||
## 路由和策略附件 {#route-and-policy-attachment}
|
||||
|
||||
Gateway API 根据**附件**来定义对象(例如路由和网关)之间的关系。
|
||||
|
||||
* 路由对象(例如 [HTTPRoute](https://gateway-api.sigs.k8s.io/api-types/httproute/))
|
||||
包含一种引用其想要附加到的**父**资源的方法。
|
||||
* 策略对象被视为 [**metaresources**](https://gateway-api.sigs.k8s.io/geps/gep-713/):
|
||||
以标准方式增强**目标**对象行为的对象。
|
||||
|
||||
The tables below show the type of attachment that is configured for each object.
|
||||
下表展示了为每个对象配置的附件类型。
|
||||
|
||||
## 流量路由 {#traffic-routing}
|
||||
|
||||
部署 waypoint 代理后,您可以使用以下 API 类型:
|
||||
部署 waypoint 代理后,您可以使用以下流量路由类型:
|
||||
|
||||
| 名称 | 功能状态 | 附加方式 |
|
||||
| --- | --- | --- |
|
||||
| `HTTPRoute` | Beta | `parentRefs` |
|
||||
| `TCPRoute` | Alpha | `parentRefs` |
|
||||
| `TLSRoute` | Alpha | `parentRefs` |
|
||||
| [`HTTPRoute`](https://gateway-api.sigs.k8s.io/guides/http-routing/) | Beta | `parentRefs` |
|
||||
| [`TLSRoute`](https://gateway-api.sigs.k8s.io/guides/tls) | Alpha | `parentRefs` |
|
||||
| [`TCPRoute`](https://gateway-api.sigs.k8s.io/guides/tcp/) | Alpha | `parentRefs` |
|
||||
|
||||
请参阅[流量管理](/zh/docs/tasks/traffic-management/)文档以查看可以使用这些路由实现的功能范围。
|
||||
|
||||
## 安全 {#security}
|
||||
|
||||
如果没有安装航点,则只能使用 [Layer 4 安全策略](/zh/docs/ambient/usage/l4-policy/)。
|
||||
如果没有安装航点,则只能使用[四层安全策略](/zh/docs/ambient/usage/l4-policy/)。
|
||||
通过添加航点,您可以访问以下策略:
|
||||
|
||||
| 名称 | 功能状态 | 附加方式 |
|
||||
| --- | --- | --- |
|
||||
| `AuthorizationPolicy`(包括 L7 功能) | Beta | `targetRefs` |
|
||||
| `RequestAuthentication` | Beta | `targetRefs` |
|
||||
| [`AuthorizationPolicy`](/zh/docs/reference/config/security/authorization-policy/) (包括 L7 功能) | Beta | `targetRefs` |
|
||||
| [`RequestAuthentication`](/zh/docs/reference/config/security/request_authentication/) | Beta | `targetRefs` |
|
||||
|
||||
### 鉴权策略注意事项 {#considerations}
|
||||
|
||||
在 Ambient 模式下,鉴权策略可以是**目标**(用于 ztunnel 执行)或**附加**(用于 waypoint 执行)。
|
||||
要将鉴权策略附加到 waypoint,它必须具有引用 waypoint 的 `targetRef`,或使用该 waypoint 的服务。
|
||||
|
||||
ztunnel 无法强制执行 L7 策略。如果使用工作负载选择器(而不是附加 `targetRef`)
|
||||
来定位具有与 L7 属性匹配的规则的策略,从而由 ztunnel 强制执行,
|
||||
则该策略将由于安全被变更为 `DENY` 策略而失效。
|
||||
|
||||
有关更多信息,请参阅 [L4 策略指南](/zh/docs/ambient/usage/l4-policy/),
|
||||
包括何时将策略附加到仅限 TCP 用例的 waypoint。
|
||||
|
||||
## 可观测性 {#observability}
|
||||
|
||||
|
|
@ -46,36 +68,39 @@ Istio 经典流量管理 API(虚拟服务、目标规则等)在 Ambient 数
|
|||
## 扩展 {#extension}
|
||||
|
||||
由于 waypoint 代理是 {{< gloss >}}Envoy{{< /gloss >}} 的部署,
|
||||
因此在 {{< gloss "sidecar" >}}Sidecar{{< /gloss >}} 中 Envoy 可以使用的扩展机制模式也可用于 waypoint 代理。
|
||||
因此在 {{< gloss "sidecar">}}Sidecar 模式{{< /gloss >}}中 Envoy 可以使用的扩展机制模式也可用于 waypoint 代理。
|
||||
|
||||
| 名称 | 功能状态 | 附加方式 |
|
||||
| --- | --- | --- |
|
||||
| `WasmPlugin` | Alpha | `targetRefs` |
|
||||
| `WasmPlugin` † | Alpha | `targetRefs` |
|
||||
| `EnvoyFilter` | Alpha | `targetRefs` |
|
||||
|
||||
通过[此处](/zh/docs/ambient/usage/extend-waypoint-wasm/)阅读有关如何使用 Wasm 插件扩展 waypoint 的更多信息。
|
||||
† [阅读更多关于如何使用 WebAssembly 插件扩展 waypoint 的信息](/zh/docs/ambient/usage/extend-waypoint-wasm/)。
|
||||
|
||||
## 目标策略或路由规则 {#targeting-policies-or-routing-rules}
|
||||
扩展配置被 Gateway API 定义视为策略。
|
||||
|
||||
## 确定路由或策略的范围 {#scoping-routes-or-policies}
|
||||
|
||||
路由或策略可以适用于穿越 waypoint 代理的所有流量,或者仅适用于特定服务。
|
||||
|
||||
### 附加到整个 waypoint 代理 {#attach-to-the-entire-waypoint-proxy}
|
||||
|
||||
要将策略或路由规则附加到整个 waypoint - 因此它适用于注册并使用它的所有流量 - 请将
|
||||
`Gateway` 设置为 `parentRefs` 或 `targetRefs` 值,具体取决于类型。
|
||||
要将路由或策略附加到整个 waypoint(以便它适用于所有注册使用它的流量),
|
||||
请根据类型将 `Gateway` 设置为 `parentRefs` 或 `targetRefs` 值。
|
||||
|
||||
例如,要将 `AuthorizationPolicy` 策略应用到 `default` 命名空间的名为 `waypoint` 的 waypoint:
|
||||
要将 `AuthorizationPolicy` 策略应用于 `default` 命名空间中名为 `default` 的 waypoint,请执行以下操作:
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
apiVersion: security.istio.io/v1beta1
|
||||
{{< text yaml >}}
|
||||
apiVersion: security.istio.io/v1
|
||||
kind: AuthorizationPolicy
|
||||
metadata:
|
||||
name: viewer
|
||||
name: view-only
|
||||
namespace: default
|
||||
spec:
|
||||
targetRefs:
|
||||
- kind: Gateway
|
||||
group: gateway.networking.k8s.io
|
||||
name: waypoint
|
||||
name: default
|
||||
action: ALLOW
|
||||
rules:
|
||||
- from:
|
||||
|
|
@ -84,22 +109,21 @@ spec:
|
|||
to:
|
||||
- operation:
|
||||
methods: ["GET"]
|
||||
EOF
|
||||
{{< /text >}}
|
||||
|
||||
### 附加到特定服务 {#attach-to-a-specific-service}
|
||||
|
||||
您还可以将策略或路由规则附加到 waypoint 内的特定服务。
|
||||
在适当的情况下将 `Service` 设置为 `parentRefs` 或 `targetRefs` 值。
|
||||
您还可以将路由附加到 waypoint 内的一个或多个特定服务。
|
||||
根据需要将 `Service` 设置为 `parentRefs` 或 `targetRefs` 值。
|
||||
|
||||
下面的示例展示了如何将 `reviews` HTTPRoute 应用到 `default` 命名空间中的 `reviews` 服务:
|
||||
要将 `reviews` HTTPRoute 应用于 `default` 命名空间中的 `reviews` 服务:
|
||||
|
||||
{{< text bash >}}
|
||||
$ kubectl apply -f - <<EOF
|
||||
apiVersion: gateway.networking.k8s.io/v1beta1
|
||||
{{< text yaml >}}
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: reviews
|
||||
namespace: default
|
||||
spec:
|
||||
parentRefs:
|
||||
- group: ""
|
||||
|
|
@ -114,5 +138,4 @@ spec:
|
|||
- name: reviews-v2
|
||||
port: 9080
|
||||
weight: 10
|
||||
EOF
|
||||
{{< /text >}}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
---
|
||||
title: Gateway API
|
||||
test: n/a
|
||||
---
|
||||
|
||||
[Kubernetes Gateway API](https://gateway-api.sigs.k8s.io/)
|
||||
是用于 Kubernetes 中流量路由的配置 API。它代表了下一代 Kubernetes 入口、
|
||||
负载均衡和服务网格 API,其设计借鉴了 Istio 的传统 API。
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
title: 安全 L4 覆盖
|
||||
test: n/a
|
||||
---
|
||||
|
||||
术语“安全覆盖”或“安全 L4 覆盖”用于统称通过 ztunnel 代理在 Ambient 网格中实现的一组 L4 网络功能。
|
||||
在传输层,这是通过基于 HTTP CONNECT 的流量隧道协议(称为 [HBONE](/zh/docs/reference/glossary/#hbone))实现的。
|
||||
Loading…
Reference in New Issue