Sync #16007 the ambient mode quickstart update into Chinese (#16023)

This commit is contained in:
Wilson Wu 2024-12-02 09:15:34 +08:00 committed by GitHub
parent e652c99081
commit 3ba650f202
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 58 additions and 50 deletions

View File

@ -34,8 +34,8 @@ $ export PATH=$PWD/bin:$PATH
{{< text syntax=bash snip_id=none >}}
$ istioctl version
no ready Istio pods in "istio-system"
{{< istio_full_version >}}
Istio is not present in the cluster: no running Istio pods in namespace "istio-system"
client version: {{< istio_full_version >}}
{{< /text >}}
## 将 Istio 安装到你的集群上 {#install-istio-on-to-your-cluster}
@ -48,7 +48,7 @@ no ready Istio pods in "istio-system"
$ istioctl install --set profile=ambient --skip-confirmation
{{< /text >}}
安装 Istio 组件可能需要一分钟。安装完成后,您将看到以下输出,表明所有组件已成功安装。
安装完成后,您将看到以下输出,表明所有组件已成功安装。
{{< text syntax=plain snip_id=none >}}
✔ Istio core installed
@ -58,17 +58,13 @@ $ istioctl install --set profile=ambient --skip-confirmation
✔ Installation complete
{{< /text >}}
{{< tip >}}
您可以使用命令 `istioctl verify-install` 验证已安装的组件。
{{< /tip >}}
## 安装 Kubernetes Gateway API CRD {#install-the-kubernetes-gateway-api-crds}
{{< boilerplate gateway-api-install-crds >}}
您将使用 Kubernetes Gateway API 来配置流量路由。
{{< boilerplate gateway-api-install-crds >}}
## 下一步 {#next-steps}
恭喜!您已成功安装支持 Ambient 模式的 Istio。
继续下一步以[安装示应用程序并将其添加到 Ambient 网格](/zh/docs/ambient/getting-started/deploy-sample-app/)。
恭喜!您已成功安装支持 Ambient 模式的 Istio。
继续下一步以[安装示应用程序](/zh/docs/ambient/getting-started/deploy-sample-app/)。

View File

@ -8,22 +8,38 @@ test: yes
如果您不再需要 Istio 和相关资源,可以按照本节中的步骤删除它们。
## 删除 Ambient 和 waypoint 标签 {#remove-the-ambient-and-waypoint-labels}
## 删除 waypoint 代理 {#remove-waypoint-proxies}
指示 Istio 自动将 `default` 命名空间中的应用程序包含到 Ambient
网格的标签默认情况下不会被删除。如果不再需要,请使用以下命令将其删除:
要删除所有 waypoint 代理,请运行以下命令:
{{< text bash >}}
$ kubectl label namespace default istio.io/use-waypoint-
$ istioctl waypoint delete --all
{{< /text >}}
## 从 Ambient 数据平面中删除命名空间 {#remove-the-namespace-from-the-ambient-data-plane}
删除 Istio 时,指示 Istio 自动将 `default`
命名空间中的应用程序包含到 Ambient 网格的标签不会被删除。使用以下命令将其删除:
{{< text bash >}}
$ kubectl label namespace default istio.io/dataplane-mode-
$ kubectl label namespace default istio.io/use-waypoint-
{{< /text >}}
## 删除 waypoint 代理 {#remove-waypoint-proxies}
在卸载 Istio 之前,您必须从 Ambient 数据平面中删除工作负载。
要删除 waypoint 代理、已安装的策略并卸载 Istio请运行以下命令
## 删除示例应用程序 {#remove-the-sample-application}
要删除 Bookinfo 示例应用程序和 `curl` 部署,请运行以下命令:
{{< text bash >}}
$ istioctl waypoint delete --all
$ kubectl delete httproute reviews
$ kubectl delete authorizationpolicy productpage-viewer
$ kubectl delete -f samples/curl/curl.yaml
$ kubectl delete -f samples/bookinfo/platform/kube/bookinfo.yaml
$ kubectl delete -f samples/bookinfo/platform/kube/bookinfo-versions.yaml
$ kubectl delete -f samples/bookinfo/gateway-api/bookinfo-gateway.yaml
{{< /text >}}
## 卸载 Istio {#uninstall-istio}
@ -35,16 +51,6 @@ $ istioctl uninstall -y --purge
$ kubectl delete namespace istio-system
{{< /text >}}
## 删除示例应用程序 {#remove-the-sample-application}
要删除 Bookinfo 示例应用程序和 `curl` 部署,请运行以下命令:
{{< text bash >}}
$ kubectl delete -f samples/bookinfo/platform/kube/bookinfo.yaml
$ kubectl delete -f samples/bookinfo/platform/kube/bookinfo-versions.yaml
$ kubectl delete -f samples/curl/curl.yaml
{{< /text >}}
## 删除 Kubernetes Gateway API CRD {#remove-the-kubernetes-gateway-api-crds}
{{< boilerplate gateway-api-remove-crds >}}

View File

@ -1,5 +1,5 @@
---
title: 部署应用程序
title: 部署示例应用程序
description: 部署 Bookinfo 示例应用程序。
weight: 2
owner: istio/wg-networking-maintainers
@ -45,8 +45,9 @@ reviews-v3-7d99fd7978-dm6mx 1/1 Running 0 42s
$ kubectl apply -f {{< github_file >}}/samples/bookinfo/gateway-api/bookinfo-gateway.yaml
{{< /text >}}
默认情况下Istio 会为网关创建一个 `LoadBalancer` 服务。
由于我们将通过隧道访问此网关,因此不需要负载均衡器。通过注解将网关的服务类型更改为 `ClusterIP`
在默认情况下Istio 会为网关创建一个 `LoadBalancer` 服务。
由于您将通过隧道访问此网关,因此不需要负载均衡器。
通过注解将网关的服务类型更改为 `ClusterIP`
{{< text syntax=bash snip_id=annotate_bookinfo_gateway >}}
$ kubectl annotate gateway bookinfo-gateway networking.istio.io/service-type=ClusterIP --namespace=default
@ -60,6 +61,8 @@ NAME CLASS ADDRESS PR
bookinfo-gateway istio bookinfo-gateway-istio.default.svc.cluster.local True 42s
{{< /text >}}
等待网关按照程序显示后再继续。
## 访问应用程序 {#access-the-application}
您将通过刚刚配置的网关连接到 Bookinfo `productpage` 服务。
@ -73,8 +76,10 @@ $ kubectl port-forward svc/bookinfo-gateway-istio 8080:80
{{< image width="80%" link="./bookinfo-browser.png" caption="Bookinfo 应用程序" >}}
如果您刷新页面,您应该会看到 reviews 和 ratings 发生变化,因为请求分布在 `reviews` 服务的不同版本上。
如果您刷新页面,您应该会看到书籍的 ratings 发生变化,
因为请求分布在 `reviews` 服务的不同版本上。
## 下一步 {#next-steps}
[继续下一部分](../secure-and-visualize/)将应用程序添加到网格中,并了解如何保护和可视化应用程序之间的通信。
[继续下一部分](../secure-and-visualize/)将应用程序添加到网格中,
并了解如何保护和可视化应用程序之间的通信。

View File

@ -13,9 +13,9 @@ test: yes
## 执行四层鉴权策略 {#enforce-layer-4-authorization-policy}
让我们创建一个[鉴权策略](/zh/docs/reference/config/security/authorization-policy/)
以限制哪些服务可以与 `productpage` 服务进行通信。该策略应用于带有 `app: productpage` 标签的 Pod
并且仅允许来自服务帐户 `cluster.local/ns/default/sa/bookinfo-gateway-istio` 的调用。
这是您在上一步中部署的 Bookinfo 网关所使用的服务帐户。
以限制哪些服务可以与 `productpage` 服务进行通信。该策略应用于带有 `app: productpage`
标签的 Pod并且仅允许来自服务帐户 `cluster.local/ns/default/sa/bookinfo-gateway-istio` 的调用。
这是您在上一步中部署的 Bookinfo 网关所使用的服务帐户。
{{< text syntax=bash snip_id=deploy_l4_policy >}}
$ kubectl apply -f - <<EOF
@ -40,7 +40,7 @@ EOF
如果您在浏览器中打开 Bookinfo 应用程序(`http://localhost:8080/productpage`
如之前一样,您将看到产品页面。但是,如果您尝试从不同的服务帐户访问 `productpage` 服务,则会看到错误。
让我们尝试从 `curl` Pod 访问 Bookinfo 应用程序:
让我们尝试从集群中的不同客户端访问 Bookinfo 应用程序:
{{< text syntax=bash snip_id=deploy_curl >}}
$ kubectl apply -f samples/curl/curl.yaml
@ -99,8 +99,8 @@ spec:
EOF
{{< /text >}}
请注意,`targetRefs` 字段用于指定 waypoint 代理授权策略的目标服务。
规则部分与以前类似,但这次我们添加了 `to` 部分来指定允许的操作。
请注意,`targetRefs` 字段使用于指定 waypoint 代理授权策略的目标服务。
规则部分与以前类似,但这次添加了 `to` 部分来指定允许的操作。
{{< tip >}}
要了解如何启用更多 Istio 功能,请阅读[使用七层功能用户指南](/zh/docs/ambient/usage/l7-features/)。
@ -109,25 +109,25 @@ EOF
确认新的 waypoint 代理正在执行更新后的鉴权策略:
{{< text bash >}}
$ # This fails with an RBAC error because we're not using a GET operation
$ # 由于您没有使用 GET 操作,因此此操作会失败并出现 RBAC 错误
$ kubectl exec deploy/curl -- curl -s "http://productpage:9080/productpage" -X DELETE
RBAC: access denied
{{< /text >}}
{{< text bash >}}
$ # This fails with an RBAC error because the identity of the reviews-v1 service is not allowed
$ # 由于 reviews-v1 服务的身份不被允许,因此此操作失败并出现 RBAC 错误
$ kubectl exec deploy/reviews-v1 -- curl -s http://productpage:9080/productpage
RBAC: access denied
{{< /text >}}
{{< text bash >}}
$ # This works as we're explicitly allowing GET requests from the curl pod
$ # 这是有效的,因为您明确允许来自 curl Pod 的 GET 请求
$ kubectl exec deploy/curl -- curl -s http://productpage:9080/productpage | grep -o "<title>.*</title>"
<title>Simple Bookstore App</title>
{{< /text >}}
## 下一步 {#next-steps}
使用 waypoint 代理后,您现在可以在命名空间中执行七层策略。除了鉴权策略之外,
[我们还可以使用 waypoint 代理在服务之间拆分流量](../manage-traffic/)。
使用 waypoint 代理后,您现在可以在命名空间中执行七层策略。
除了鉴权策略之外,[您还可以使用 waypoint 代理在服务之间拆分流量](../manage-traffic/)。
这在进行金丝雀部署或 A/B 测试时非常有用。

View File

@ -6,7 +6,7 @@ owner: istio/wg-networking-maintainers
test: yes
---
现在我们已经安装了 waypoint 代理,我们将学习如何在服务之间分割流量。
现在您已经安装了 waypoint 代理,您将学习如何在服务之间分割流量。
## 在服务之间分割流量 {#split-traffic-between-services}
@ -49,6 +49,6 @@ $ kubectl exec deploy/curl -- sh -c "for i in \$(seq 1 100); do curl -s http://p
## 下一步 {#next-steps}
本节总结了 Ambient 模式的入门指南。
本节总结了 Istio 的 Ambient 模式的入门指南。
您可以继续前往[清理](/zh/docs/ambient/getting-started/cleanup)部分以删除 Istio
或继续探索 [Ambient 模式用户指南](/zh/docs/ambient/usage/)以了解有关 Istio 特性和功能的更多信息。

View File

@ -48,10 +48,11 @@ $ istioctl dashboard kiali
让我们向 Bookinfo 应用程序发送一些流量,以便 Kiali 生成流量图:
{{< text bash >}}
$ for i in $(seq 1 100); do curl -s http://localhost:8080/productpage; done
$ for i in $(seq 1 100); do curl -sSI -o /dev/null http://localhost:8080/productpage; done
{{< /text >}}
接下来,单击 Traffic Graph您应该会看到 Bookinfo 应用程序:
接下来,点击流量图并从 "Select Namespaces" 下拉菜单中选择 "Default"。
您应该看到 Bookinfo 应用程序:
{{< image link="./kiali-ambient-bookinfo.png" caption="Kiali 仪表盘" >}}
@ -70,5 +71,5 @@ $ for i in $(seq 1 100); do curl -s http://localhost:8080/productpage; done
## 下一步 {#next-steps}
现在我们已为服务分配了身份,
接下来让我们[执行鉴权策略](/zh/docs/ambient/getting-started/enforce-auth-policies/)确保应用程序访问的安全。
现在已为服务分配了身份,
接下来让我们[执行鉴权策略](/zh/docs/ambient/getting-started/enforce-auth-policies/)确保应用程序访问的安全。

Binary file not shown.

Before

Width:  |  Height:  |  Size: 258 KiB

After

Width:  |  Height:  |  Size: 467 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 KiB

After

Width:  |  Height:  |  Size: 82 KiB