[zh] Sync the latest Ambient HBONE and traffic redirection docs into Chinese (#15066)

* Sync latest Ambient HBONE and traffic redirection docs into Chinese

* Sync ambient arch home page

* Fix format
This commit is contained in:
Wilson Wu 2024-05-15 19:39:46 +08:00 committed by GitHub
parent b4dc5b104a
commit a9bd9b069d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 24 additions and 81 deletions

View File

@ -6,69 +6,5 @@ aliases:
- /zh/docs/ops/ambient/architecture
- /zh/latest/docs/ops/ambient/architecture
owner: istio/wg-networking-maintainers
test: n/a
test: table-of-contents
---
## Ambient API {#ambient-apis}
要实施 L7 策略,请将 `istio.io/use-waypoint`
标签添加到您的资源中,以便对被标记的资源使用 waypoint。
- 如果命名空间被标记为 `istio.io/use-waypoint` 并且拥有命名空间的默认 waypoint
则该 waypoint 将应用于命名空间中的所有 Pod。
- 当不需要为整个命名空间使用 waypoint 时,也可以在单个服务或 Pod 上设置 `istio.io/use-waypoint` 标签。
- 如果命名空间和服务上都存在 `istio.io/use-waypoint` 标签,
则只要服务 waypoint 可以处理服务流量或所有流量,则服务 waypoint 优先级就高于命名空间 waypoint。
同样Pod 上的标签优先级将高于命名空间标签。
### 标签 {#ambient-labels}
您可以使用以下标签将资源添加到网格中,
流向资源的流量使用 waypoint并控制被发送到 waypoint 的流量。
| 名称 | 功能状态 | 资源 | 描述 |
| --- | --- | --- | --- |
| `istio.io/dataplane-mode` | Beta | `Namespace` | 将您的资源添加到 Ambient 网格中。<br><br>有效值:`ambient`。 |
| `istio.io/use-waypoint` | Beta | `Namespace`、`Service` 或 `Pod` | 使用 waypoint 对被标记资源的流量执行 L7 策略。<br><br>有效值:`{waypoint-name}`、`{namespace}/{waypoint-name}` 或 `#none`(带有哈希值)。 |
| `istio.io/waypoint-for` | Alpha | `Gateway` | 指定 waypoint 将处理流量的端点类型。<br><br>有效值:`service`、`workload`、`none` 或 `all`。该标签是可选的,其默认值为 `service`。 |
为了使您的 `istio.io/use-waypoint` 标签值有效,
您必须确保为使用 waypoint 的端点配置 waypoint。默认情况下waypoint 接受针对服务端点的流量。
例如,当您通过 `istio.io/use-waypoint` 标签将 Pod 标记为使用特定 waypoint 时,
该 waypoint 应添加值为 `workload``all` 的标签 `istio.io./waypoint-for`
### 附加 7 层策略到 waypoint {#layer-7-policy-attachment-to-waypoints}
您可以使用 `targetRefs` 将 7 层策略
(例如 `AuthorizationPolicy`、`RequestAuthentication`、`Telemetry`、`WasmPlugin` 等)附加到您的 waypoint。
- 要将 L7 策略附加到整个 waypoint请将 `Gateway` 设置到 `targetRefs` 的值中。
下面的示例展示了如何将 `viewer` 策略附加到 `default` 命名空间的名为 `waypoint` 的 waypoint
{{< text yaml >}}
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: viewer
namespace: default
spec:
targetRefs:
- kind: Gateway
group: gateway.networking.k8s.io
name: waypoint
{{< /text >}}
- 要将 L7 策略附加到 waypoint 内的特定服务,请将 `Service` 设置到 `targetRefs` 的值中。
下面的示例展示了如何将 `productpage-viewer` 策略附加到 `default` 命名空间中的 `productpage` 服务:
{{< text yaml >}}
apiVersion: security.istio.io/v1beta1
kind: AuthorizationPolicy
metadata:
name: productpage-viewer
namespace: default
spec:
targetRefs:
- kind: Service
group: ""
name: productpage
{{< /text >}}

View File

@ -7,8 +7,9 @@ test: no
---
**HBONE**HTTP Based Overlay Network Encapsulation基于 HTTP 的覆盖网络封装)
是 Istio 组件之间使用的安全隧道协议。HBONE 是 Istio 特定的术语。
它是一种通过单个 mTLS 加密网络连接(加密隧道)透明地多路复用与许多不同应用程序连接相关的 TCP 流的机制。
是 Istio 组件之间使用的安全隧道协议。
HBONE 是 Istio 特定的术语。它是一种通过单个 mTLS 加密网络连接(加密隧道)
透明地多路复用与许多不同应用程序连接相关的 TCP 流的机制。
在 Istio 当前的实现中HBONE 协议包含三个开放标准:
@ -24,10 +25,10 @@ HTTP/2 用于在单个安全和加密隧道上复用应用程序连接流,并
根据 mTLS 规范的强制要求,每个底层隧道连接必须具有唯一的来源身份和唯一的目标身份,
并且必须使用这些身份为该连接进行加密。
这意味着通过 HBONE 协议从应用程序到同一个目标身份的连接将在同一个共享的
加密的和安全的底层 HTTP/2 连接上进行多路复用实际上,
即使该底层专用连接正在处理多个应用程序级连接,
每个唯一的来源和目标也必须获取自己专用的安全隧道连接。
这意味着通过 HBONE 协议到相同目标身份的应用程序连接将在相同的共享
加密的和安全的底层 HTTP/2 连接上进行多路复用 - 实际上,
每个唯一的源和目标都必须获得自己专用的安全隧道连接,
甚至如果该底层专用连接正在处理多个应用程序级连接。
## 实现细节 {#implementation-details}
@ -40,4 +41,10 @@ HTTP/2 用于在单个安全和加密隧道上复用应用程序连接流,并
link="hbone-packet.png"
caption="HBONE L3 数据包格式"
>}}
HBONE 隧道的一个重要特性是可以透明地代理原始应用程序请求,
而无需以任何方式改变底层应用程序流量流。
这意味着有关连接的元数据可以传送到目标代理,而无需更改应用程序请求 - 例如,
无需将 Istio 特定的标头附加到应用程序流量中。
随着 Ambient 模式和标准的发展,未来将研究 HBONE 和 HTTP 隧道(例如 UDP的其他用例。

View File

@ -10,10 +10,14 @@ test: no
---
在 Ambient 模式的上下文中,**流量重定向**指的是一项数据平面功能,
该功能拦截发送到和来自启用 Ambient 的工作负载的流量,
该功能拦截发送到启用 Ambient 的工作负载和从支持 Ambient 的工作负载发来的流量,
并通过处理核心数据路径的 {{< gloss >}}ztunnel{{< /gloss >}} 节点代理将其路由。
有时也使用术语**流量捕获**。
由于 ztunnel 旨在透明地加密和路由应用程序流量,
因此需要一种机制来捕获进入和离开“网格内” Pod 的所有流量。
这是一项安全关键任务:如果可以绕过 ztunnel则可以绕过鉴权策略。
## Istio 的 in-Pod 流量重定向模型 {#istio-s-in-pod-traffic-redirection-model}
Ambient 模式 in-Pod 流量重定向的核心设计原则是 ztunnel
@ -74,12 +78,8 @@ Pod 时通知 `istio-cni` 节点代理,并将新的 Pod 上下文传播到 `is
## Ambient 模式下流量重定向的观测与调试 {#observing-and-debugging-traffic-redirection-in-ambient-mode}
如果流量重定向在 Ambient 模式下无法正常工作,
可以进行一些快速检查以帮助缩小问题范围。要演示实际的流量重定向,
请首先按照 [ztunnel Layer 4 网络指南](/zh/docs/ops/ambient/usage/ztunnel)中描述的步骤进行操作,
包括在 Kubernetes 集群中部署启用 Ambient 模式的 Istio
以及在已被标记为 Ambient 模式的命名空间中部署 `httpbin``sleep`
验证应用程序在 Ambient 网格中成功运行后,您可以使用以下步骤来观察流量重定向。
如果流量重定向在 Ambient 模式下无法正常工作,可以进行一些快速检查以帮助缩小问题范围。
我们建议从 [ztunnel 调试指南](/zh/docs/ambient/usage/troubleshoot-ztunnel/)中描述的步骤开始进行故障排除。
### 检查 ztunnel 代理日志 {#check-the-ztunnel-proxy-logs}
@ -124,7 +124,7 @@ LISTEN 0 128 *:15008 *:*
$ kubectl debug $(kubectl get pod -l app=sleep -n ambient-demo -o jsonpath='{.items[0].metadata.name}') -it --image gcr.io/istio-release/base --profile=netadmin -n ambient-demo -- iptables-save
Defaulting debug container name to debugger-m44qc.
# Generated by iptables-save
# 由 iptables-save 生成
*mangle
:PREROUTING ACCEPT [320:53261]
:INPUT ACCEPT [23753:267657744]
@ -143,8 +143,8 @@ Defaulting debug container name to debugger-m44qc.
-A ISTIO_PRERT -p tcp -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A ISTIO_PRERT ! -d 127.0.0.1/32 -p tcp -m mark ! --mark 0x539/0xfff -j TPROXY --on-port 15006 --on-ip 0.0.0.0 --tproxy-mark 0x111/0xfff
COMMIT
# Completed
# Generated by iptables-save
# 已完成
# 由 iptables-save 生成
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]