5.1 KiB
title | description | weight | owner | test |
---|---|---|---|---|
使用七层功能 | 使用 L7 waypoint 代理时所支持的功能。 | 50 | istio/wg-networking-maintainers | no |
通过向您的流量流添加 waypoint 代理,您可以启用更多 Istio 的功能。 waypoint 使用 {{< gloss "gateway api" >}}Kubernetes Gateway API{{< /gloss >}} 配置。
{{< warning >}} Istio 经典流量管理 API(虚拟服务、目标规则等)在与 Ambient 数据平面模式一起使用时仍处于 Alpha 阶段。
不支持混合使用 Istio 经典 API 和 Gateway API 配置,这会导致未定义的行为。 {{< /warning >}}
路由和策略附件
Gateway API 根据附件来定义对象(例如路由和网关)之间的关系。
- 路由对象(例如 HTTPRoute) 包含一种引用其想要附加到的父资源的方法。
- 策略对象被视为 metaresources: 以标准方式增强目标对象行为的对象。
The tables below show the type of attachment that is configured for each object. 下表展示了为每个对象配置的附件类型。
流量路由
部署 waypoint 代理后,您可以使用以下流量路由类型:
名称 | 功能状态 | 附加方式 |
---|---|---|
HTTPRoute |
Beta | parentRefs |
TLSRoute |
Alpha | parentRefs |
TCPRoute |
Alpha | parentRefs |
请参阅流量管理文档以查看可以使用这些路由实现的功能范围。
安全
如果没有安装航点,则只能使用四层安全策略。 通过添加航点,您可以访问以下策略:
名称 | 功能状态 | 附加方式 |
---|---|---|
AuthorizationPolicy (包括 L7 功能) |
Beta | targetRefs |
RequestAuthentication |
Beta | targetRefs |
鉴权策略注意事项
在 Ambient 模式下,鉴权策略可以是目标(用于 ztunnel 执行)或附加(用于 waypoint 执行)。
要将鉴权策略附加到 waypoint,它必须具有引用 waypoint 的 targetRef
,或使用该 waypoint 的服务。
ztunnel 无法强制执行 L7 策略。如果使用工作负载选择器(而不是附加 targetRef
)
来定位具有与 L7 属性匹配的规则的策略,从而由 ztunnel 强制执行,
则该策略将由于安全被变更为 DENY
策略而失效。
有关更多信息,请参阅 L4 策略指南, 包括何时将策略附加到仅限 TCP 用例的 waypoint。
可观测性
全套 Istio 流量指标 由 waypoint 代理导出。
扩展
由于 waypoint 代理是 {{< gloss >}}Envoy{{< /gloss >}} 的部署, 因此在 {{< gloss "sidecar">}}Sidecar 模式{{< /gloss >}}中 Envoy 可以使用的扩展机制模式也可用于 waypoint 代理。
名称 | 功能状态 | 附加方式 |
---|---|---|
WasmPlugin † |
Alpha | targetRefs |
EnvoyFilter |
Alpha | targetRefs |
† 阅读更多关于如何使用 WebAssembly 插件扩展 waypoint 的信息。
扩展配置被 Gateway API 定义视为策略。
确定路由或策略的范围
路由或策略可以适用于穿越 waypoint 代理的所有流量,或者仅适用于特定服务。
附加到整个 waypoint 代理
要将路由或策略附加到整个 waypoint(以便它适用于所有注册使用它的流量),
请根据类型将 Gateway
设置为 parentRefs
或 targetRefs
值。
要将 AuthorizationPolicy
策略应用于 default
命名空间中名为 default
的 waypoint,请执行以下操作:
{{< text yaml >}} apiVersion: security.istio.io/v1 kind: AuthorizationPolicy metadata: name: view-only namespace: default spec: targetRefs:
- kind: Gateway group: gateway.networking.k8s.io name: default action: ALLOW rules:
- from:
- source: namespaces: ["default", "istio-system"] to:
- operation: methods: ["GET"] {{< /text >}}
附加到特定服务
您还可以将路由附加到 waypoint 内的一个或多个特定服务。
根据需要将 Service
设置为 parentRefs
或 targetRefs
值。
要将 reviews
HTTPRoute 应用于 default
命名空间中的 reviews
服务:
{{< text yaml >}} apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: reviews namespace: default spec: parentRefs:
- group: "" kind: Service name: reviews port: 9080 rules:
- backendRefs:
- name: reviews-v1 port: 9080 weight: 90
- name: reviews-v2 port: 9080 weight: 10 {{< /text >}}