Skip to content

Commit e003fd2

Browse files
authored
[zh] Fix more anchor issues in zh docs (#16956)
* [zh] Fix anchor issues in zh docs * apply reviewer's suggestions
1 parent 57bbf96 commit e003fd2

File tree

27 files changed

+175
-175
lines changed

27 files changed

+175
-175
lines changed

content/zh/blog/2018/delayering-istio/index.md

Lines changed: 20 additions & 20 deletions
Large diffs are not rendered by default.

content/zh/blog/2018/egress-https/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ target_release: 1.1
1919
我将展示如何使用 _mesh-external service entries_ 在 Istio 中启用外部 HTTPS 流量。最后,
2020
我解释了当前与 Istio 出口流量控制相关的问题。
2121

22-
## 初始设定{#initial-setting}
22+
## 初始设定 {#initial-setting}
2323

2424
为了演示使用外部 Web 服务的场景,我首先使用安装了 [Istio](/zh/docs/setup/getting-started/)
2525
Kubernetes 集群, 然后我部署 [Istio Bookinfo 示例应用程序](/zh/docs/examples/bookinfo/),
@@ -39,7 +39,7 @@ target_release: 1.1
3939
执行[部署应用程序](/zh/docs/examples/bookinfo/#deploying-the-application)[确认应用正在运行](/zh/docs/examples/bookinfo/#confirm-the-app-is-accessible-from-outside-the-cluster),以及
4040
[应用默认目标规则](/zh/docs/examples/bookinfo/#apply-default-destination-rules)中的步骤部分。
4141

42-
### Bookinfo 使用 HTTPS 访问 Google 图书网络服务{#Bookinfo-with-https-access-to-a-google-books-web-service}
42+
### Bookinfo 使用 HTTPS 访问 Google 图书网络服务 {#bookinfo-with-https-access-to-a-google-books-web-service}
4343

4444
让我们添加一个新版本的 _details_ 微服务,_v2_,从 [Google Books APIs](https://developers.google.com/books/docs/v1/getting_started) 中获取图书详细信息。
4545
它设定了服务容器的 `DO_NOT_ENCRYPT` 环境变量为 `false`。此设置将指示已部署服务使用 HTTPS(而不是 HTTP )来访问外部服务。
@@ -81,7 +81,7 @@ $ kubectl apply -f @samples/bookinfo/networking/virtual-service-details-v2.yaml@
8181
默认情况下,Istio sidecar 代理([Envoy proxies](https://www.envoyproxy.io)
8282
**阻止到集群外目的地的所有流量**, 要启用此类流量,我们必须定义 [mesh-external service entry](/zh/docs/reference/config/networking/service-entry/)
8383

84-
### 启用对 Google Books 网络服务的 HTTPS 访问{#enable-https-access-to-a-google-books-web-service}
84+
### 启用对 Google Books 网络服务的 HTTPS 访问 {#enable-https-access-to-a-google-books-web-service}
8585

8686
不用担心,让我们定义**网格外部 `ServiceEntry`** 并修复我们的应用程序。您还必须定义 _virtual
8787
service_ 使用 [SNI](https://en.wikipedia.org/wiki/Server_Name_Indication) 对外部服务执行路由。
@@ -148,7 +148,7 @@ serviceentry "googleapis" deleted
148148
正如我们所看到的,与许多其他 Istio 配置一样,`ServiceEntry`**动态定义**的 , Istio 运算符可以动态决定
149149
它们允许微服务访问哪些域, 他们可以动态启用和禁用外部域的流量,而无需重新部署微服务。
150150

151-
### 清除对 Google 图书网络服务的 HTTPS 访问权限{#cleanup-of-https-access-to-a-google-books-web-service}
151+
### 清除对 Google 图书网络服务的 HTTPS 访问权限 {#cleanup-of-https-access-to-a-google-books-web-service}
152152

153153
{{< text bash >}}
154154
$ kubectl delete serviceentry googleapis
@@ -157,7 +157,7 @@ $ kubectl delete -f @samples/bookinfo/networking/virtual-service-details-v2.yaml
157157
$ kubectl delete -f @samples/bookinfo/platform/kube/bookinfo-details-v2.yaml@
158158
{{< /text >}}
159159

160-
## 由 Istio 发起的 TLS{#TLS-origination-by-Istio}
160+
## 由 Istio 发起的 TLS {#tls-origination-by-istio}
161161

162162
这个故事有一个警告。假设您要监视您的微服务使用 [Google API](https://developers.google.com/apis-explorer/) 的哪个特定集
163163
[书籍](https://developers.google.com/books/docs/v1/getting_started)[日历](https://developers.google.com/calendar/)[任务](https://developers.google.com/tasks/)等)
@@ -208,7 +208,7 @@ env:
208208

209209
在下一节中,您将配置 TLS 发起以访问外部 Web 服务。
210210

211-
## 具有 TLS 的 Bookinfo 起源于 Google Books 网络服务{#Bookinfo-with-TLS-origination-to-a-google-books-web-service}
211+
## 具有 TLS 的 Bookinfo 起源于 Google Books 网络服务 {#bookinfo-with-TLS-origination-to-a-google-books-web-service}
212212

213213
1. 部署 _details v2_ 版本,将 HTTP 请求发送到 [Google Books API](https://developers.google.com/books/docs/v1/getting_started)
214214
[`bookinfo-details-v2.yaml`]({{<github_file>}}/samples/bookinfo/platform/kube/bookinfo-details-v2.yaml) 中,
@@ -292,7 +292,7 @@ env:
292292
请注意日志中的 URL 路径,可以监视路径并根据它来应用访问策略。要了解有关 HTTP 出口流量的监控和访问策略
293293
的更多信息,请查看[归档博客之出口流量监控之日志](https://archive.istio.io/v0.8/blog/2018/egress-monitoring-access-control/#logging)
294294

295-
### 清除 TLS 原始数据到 Google Books 网络服务{#cleanup-of-TLS-origination-to-a-google-books-web-service}
295+
### 清除 TLS 原始数据到 Google Books 网络服务 {#cleanup-of-tls-origination-to-a-google-books-web-service}
296296

297297
{{< text bash >}}
298298
$ kubectl delete serviceentry googleapis
@@ -302,15 +302,15 @@ $ kubectl delete -f @samples/bookinfo/networking/virtual-service-details-v2.yaml
302302
$ kubectl delete -f @samples/bookinfo/platform/kube/bookinfo-details-v2.yaml@
303303
{{< /text >}}
304304

305-
### Istio 双向 TLS 的关系{#relation-to-Istio-mutual-TLS}
305+
### Istio 双向 TLS 的关系 {#relation-to-istio-mutual-tls}
306306

307307
请注意,在这种情况下,TLS 的源与 Istio 应用的[双向 TLS](/zh/docs/concepts/security/#mutual-TLS-authentication) 无关,
308308
无论 Istio 双向 TLS 是否启用,外部服务的 TLS 源都将起作用 , 保证服务网****的服务到服务通信,
309309
并为每个服务提供强大的身份认证, 在此博客文章中的 **外部服务**的情况下,我们有**单向** TLS,
310310
这是用于保护 Web 浏览器和 Web 服务器之间通信的相同机制 , TLS 应用于与外部服务的通信,
311311
以验证外部服务器的身份并加密流量。
312312

313-
## 结论{#conclusion}
313+
## 结论 {#conclusion}
314314

315315
在这篇博文中,我演示了 Istio 服务网格中的微服务如何通过 HTTPS 使用外部 Web 服务, 默认情况下,
316316
Istio 会阻止集群外主机的所有流量, 要启用此类流量,请使用 mesh-external, 必须为服务网格创建 `ServiceEntry` ,

content/zh/blog/2018/egress-mongo/index.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ target_release: 1.1
1313
服务。您将使用 [Istio Bookinfo 示例应用程序](/zh/docs/examples/bookinfo/),它的书籍评级数据保存在 MongoDB 数据库中。您会将此数据库部署在集群外部,并配置 `ratings`
1414
微服务使用它。您将学习控制到外部 MongoDB 服务流量的多种选择及其利弊。
1515

16-
## 使用外部 ratings 数据库的 Bookinfo {#Bookinfo-with-external-ratings-database}
16+
## 使用外部 ratings 数据库的 Bookinfo {#bookinfo-with-external-ratings-database}
1717

1818
首先,在您的 Kubernetes 集群外部建立一个 MongoDB 数据库实例以保存书籍评级数据。然后修改 [Bookinfo 示例应用程序](/zh/docs/examples/bookinfo/)使用该数据库。
1919

20-
### 建立 ratings 数据库{#setting-up-the-ratings-database}
20+
### 建立 ratings 数据库 {#setting-up-the-ratings-database}
2121

2222
在这个任务中您将建立一个 [MongoDB](https://www.mongodb.com) 实例。您可以使用任何 MongoDB 实例;我使用 [Compose for MongoDB](https://www.ibm.com/cloud/compose/mongodb)
2323

@@ -83,7 +83,7 @@ target_release: 1.1
8383
bye
8484
{{< /text >}}
8585

86-
### Bookinfo 应用程序的初始设置{#Initial-setting-of-Bookinfo-application}
86+
### Bookinfo 应用程序的初始设置 {#initial-setting-of-bookinfo-application}
8787

8888
为了演示使用外部数据库的场景,请首先运行一个[安装了 Istio](/zh/docs/setup/getting-started/) 的 Kubernetes 集群。然后部署
8989
[Istio Bookinfo 示例应用程序](/zh/docs/examples/bookinfo/)[应用默认 destination rules](/zh/docs/examples/bookinfo/#apply-default-destination-rules)[改变 Istio 到 blocking-egress-by-default 策略](/zh/docs/tasks/traffic-management/egress/egress-control/#change-to-the-blocking-by-default-policy)
@@ -97,7 +97,7 @@ target_release: 1.1
9797

9898
{{< image width="80%" link="/zh/docs/examples/bookinfo/withistio.svg" caption="The original Bookinfo application" >}}
9999

100-
### 在 Bookinfo 应用程序中使用外部数据库{#use-the-external-database-in-Bookinfo-application}
100+
### 在 Bookinfo 应用程序中使用外部数据库 {#use-the-external-database-in-bookinfo-application}
101101

102102
1. 部署使用 MongoDB 数据库的 _ratings_ 微服务(_ratings v2_):
103103

@@ -131,7 +131,7 @@ target_release: 1.1
131131

132132
请注意,MongoDB 数据库位于 Istio 服务网格之外,或者更确切地说是在 Kubernetes 集群之外。服务网格的边界使用虚线标记。
133133

134-
### 访问网页{#access-the-webpage}
134+
### 访问网页 {#access-the-webpage}
135135

136136
[确认 ingress IP 和端口之后](/zh/docs/examples/bookinfo/#determine-the-ingress-IP-and-port),访问应用程序的网页。
137137

@@ -141,7 +141,7 @@ target_release: 1.1
141141

142142
在以下部分中,您将使用不同的 Istio egress 控制选项,配置对外部 MongoDB 服务的访问。
143143

144-
## TCP 的 egress 控制{#egress-control-for-TCP}
144+
## TCP 的 egress 控制 {#egress-control-for-tcp}
145145

146146
由于 [MongoDB 协议](https://zh/docs.mongodb.com/manual/reference/mongodb-wire-protocol/)运行在 TCP 之上,您可以像控制到[其余 TCP 服务](/zh/blog/2018/egress-tcp/)的流量一样控制到 MongoDB 的 egress 流量。为了控制 TCP 流量,您必须指定一个 [CIDR](https://tools.ietf.org/html/rfc2317) 表示的 IP 块,该 IP 块包含 MongoDB 的地址。需要注意的是,有时候 MongoDB 主机的 IP 并不稳定或无法事先得知。
147147

@@ -153,7 +153,7 @@ target_release: 1.1
153153
$ export MONGODB_IP=$(host $MONGODB_HOST | grep " has address " | cut -d" " -f4)
154154
{{< /text >}}
155155

156-
### 在没有 gateway 的情况下控制 TCP egress 流量{#control-TCP-egress-traffic-without-a-gateway}
156+
### 在没有 gateway 的情况下控制 TCP egress 流量 {#control-tcp-egress-traffic-without-a-gateway}
157157

158158
如果您不用通过 [egress gateway](/zh/docs/tasks/traffic-management/egress/egress-gateway/#use-case) 定向流量,例如不要求所有流量都通过 gateway 流出网格时,请遵循以下部分的说明。或者,如果您确实希望通过 egress gateway 定向流量,请继续阅读[通过 egress gateway 定向 TCP egress 流量](#direct-tcp-egress-traffic-through-an-egress-gateway)
159159

@@ -193,7 +193,7 @@ $ export MONGODB_IP=$(host $MONGODB_HOST | grep " has address " | cut -d" " -f4)
193193

194194
1. 如果要通过出口网关引导流量,请继续下一节。否则,请执行 [cleanup](#cleanup-of-TCP-egress-traffic-control).
195195

196-
### 通过 egress gateway 定向 TCP Egress 流量{#direct-TCP-egress-traffic-through-an-egress-gateway}
196+
### 通过 egress gateway 定向 TCP Egress 流量 {#direct-tcp-egress-traffic-through-an-egress-gateway}
197197

198198
在本节中,您将处理通过 [egress gateway](/zh/docs/tasks/traffic-management/egress/egress-gateway/#use-case) 定向流量的情况。Sidecar 代理通过匹配 MongoDB 主机的 IP 地址(一个 32 位长度的 CIDR 块),将 TCP 连接从 MongoDB 客户端路由到 egress gateway。Egress gateway 按照其 hostname,转发流量到 MongoDB 主机。
199199

@@ -205,7 +205,7 @@ $ export MONGODB_IP=$(host $MONGODB_HOST | grep " has address " | cut -d" " -f4)
205205
如果你不想开启双向 TLS,参考 [Mutual TLS between the sidecar proxies and the egress gateway](#mutual-TLS-between-the-sidecar-proxies-and-the-egress-gateway) 小节
206206
否则,请继续以下部分。
207207

208-
#### 配置从 sidecar 到 egress gateway 的 TCP 流量{#configure-TCP-traffic-from-sidecars-to-the-egress-gateway}
208+
#### 配置从 sidecar 到 egress gateway 的 TCP 流量 {#configure-tcp-traffic-from-sidecars-to-the-egress-gateway}
209209

210210
1. 定义 `EGRESS_GATEWAY_MONGODB_PORT` 环境变量来保存用于通过 egress gateway 定向流量的端口,例如 `7777`。必须选择没有被网格中其余 service 使用的端口。
211211

@@ -315,7 +315,7 @@ $ export MONGODB_IP=$(host $MONGODB_HOST | grep " has address " | cut -d" " -f4)
315315

316316
1. [验证 TCP egress 流量是否被定向到 egress gateway](#verify-that-egress-traffic-is-directed-through-the-egress-gateway).
317317

318-
#### Sidecar 代理和 egress gateway 之间的双向 TLS{#mutual-TLS-between-the-sidecar-proxies-and-the-egress-gateway}
318+
#### Sidecar 代理和 egress gateway 之间的双向 TLS {#mutual-tls-between-the-sidecar-proxies-and-the-egress-gateway}
319319

320320
1. 删除前面小节中的配置:
321321

@@ -430,7 +430,7 @@ $ export MONGODB_IP=$(host $MONGODB_HOST | grep " has address " | cut -d" " -f4)
430430

431431
1. 继续下一节。
432432

433-
#### 验证 TCP egress 流量是否通过 egress gateway 定向{#verify-that-egress-traffic-is-directed-through-the-egress-gateway}
433+
#### 验证 TCP egress 流量是否通过 egress gateway 定向 {#verify-that-egress-traffic-is-directed-through-the-egress-gateway}
434434

435435
1. 再次刷新应用程序的网页,并验证等级是否仍正确显示。
436436

@@ -453,7 +453,7 @@ $ kubectl delete destinationrule egressgateway-for-mongo mongo --ignore-not-foun
453453
$ kubectl delete policy istio-egressgateway -n istio-system --ignore-not-found=true
454454
{{< /text >}}
455455

456-
## TLS egress 控制{#egress-control-for-TLS}
456+
## TLS egress 控制 {#egress-control-for-tls}
457457

458458
在现实生活中,绝大多数到外部服务的通信都必须被加密,而 [MongoDB 协议在 TLS 之上运行](https://zh/docs.mongodb.com/manual/tutorial/configure-ssl/)
459459
并且,TLS 客户端经常发送[服务器名称指示](https://en.wikipedia.org/wiki/Server_Name_Indication),SNI,作为握手的一部分。
@@ -469,7 +469,7 @@ $ openssl s_client -connect $MONGODB_HOST:$MONGODB_PORT -servername $MONGODB_HOS
469469

470470
如果上述命令打印了一个服务器返回的证书,说明该服务器支持 TLS。如果没有,您就需要像前面小节描述的一样在 TCP 层面控制 MongoDB egress 流量。
471471

472-
### 无 gateway 情况下控制 TLS egress 流量{#control-TLS-egress-traffic-without-a-gateway}
472+
### 无 gateway 情况下控制 TLS egress 流量 {#control-tls-egress-traffic-without-a-gateway}
473473

474474
如果您[不需要 egress gateway](/zh/docs/tasks/traffic-management/egress/egress-gateway/#use-case),请遵循本小节中的说明。
475475
如果您需要通过 egress gateway 定向流量,请继续阅读[通过 egress gateway 定向 TCP Egress 流量](#direct-tcp-egress-traffic-through-an-egress-gateway)
@@ -495,7 +495,7 @@ $ openssl s_client -connect $MONGODB_HOST:$MONGODB_PORT -servername $MONGODB_HOS
495495

496496
1. 刷新应用程序的网页。应用程序应该正确显示评级数据。
497497

498-
#### 清理 TLS 的 egress 配置{#cleanup-of-the-egress-configuration-for-TLS}
498+
#### 清理 TLS 的 egress 配置 {#cleanup-of-the-egress-configuration-for-tls}
499499

500500
{{< text bash >}}
501501
$ kubectl delete serviceentry mongo
@@ -696,7 +696,7 @@ Egress gateway 在 443 端口上接受 MongoDB 流量,按照 SNI 匹配 MongoD
696696

697697
1. [验证 TCP egress 流量是否通过 egress gateway 定向](#verify-that-egress-traffic-is-directed-through-the-egress-gateway)
698698

699-
#### 清除通过 egress gateway 定向 TLS Egress 流量的配置{#cleanup-directing-TLS-Egress-traffic-through-an-egress-gateway}
699+
#### 清除通过 egress gateway 定向 TLS Egress 流量的配置 {#cleanup-directing-tls-Egress-traffic-through-an-egress-gateway}
700700

701701
{{< text bash >}}
702702
$ kubectl delete serviceentry mongo
@@ -705,7 +705,7 @@ $ kubectl delete virtualservice direct-mongo-through-egress-gateway
705705
$ kubectl delete destinationrule egressgateway-for-mongo
706706
{{< /text >}}
707707

708-
### 启用到任意通配符域名的 MongoDB TLS egress 流量{#enable-MongoDB-TLS-egress-traffic-to-arbitrary-wildcarded-domains}
708+
### 启用到任意通配符域名的 MongoDB TLS egress 流量 {#enable-mongodb-tls-egress-traffic-to-arbitrary-wildcarded-domains}
709709

710710
有时,您希望将 egress 流量配置为来自同一域的多个主机名,例如到 `*.<your company domain>.com` 中的所有 MongoDB service。
711711
您不希望创建多个配置项,而是一个用于公司中所有 MongoDB service 的通用配置项。
@@ -718,7 +718,7 @@ $ kubectl delete destinationrule egressgateway-for-mongo
718718
要为通配符域名配置 egress gateway 流量,
719719
您需要使用[一个额外的 SNI 代理](/zh/docs/tasks/traffic-management/egress/wildcard-egress-hosts/#wildcard-configuration-for-arbitrary-domains)来部署一个自定义的 egress gateway。由于 Envoy(Istio egress gateway 使用的标准代理)目前的限制,这是必须的。
720720

721-
#### 准备一个 SNI 代理使用新的 egress gateway{#prepare-a-new-egress-gateway-with-an-SNI-proxy}
721+
#### 准备一个 SNI 代理使用新的 Egress Gateway {#prepare-a-new-egress-gateway-with-an-sni-proxy}
722722

723723
在本节中,除了标准的 Istio Envoy 代理之外,您还将部署具有 SNI 代理的 egress gateway。您可以使用任何能够根据任意未预先配置的 SNI 值路由流量的 SNI 代理;我们使用 [Nginx](http://nginx.org) 来实现这一功能。
724724

@@ -852,7 +852,7 @@ $ kubectl delete destinationrule egressgateway-for-mongo
852852
EOF
853853
{{< /text >}}
854854

855-
#### 使用新 egress gateway 配置到 `*.com` 的访问{#configure-access-to-com-using-the-new-egress-gateway}
855+
#### 使用新 egress gateway 配置到 `*.com` 的访问 {#configure-access-to-com-using-the-new-egress-gateway}
856856

857857
1.`*.com` 定义一个 `ServiceEntry`
858858

@@ -1023,7 +1023,7 @@ $ kubectl delete destinationrule egressgateway-for-mongo
10231023
127.0.0.1 [23/Aug/2018:03:28:18 +0000] TCP [<your MongoDB host>]200 2590 1248 0.095
10241024
{{< /text >}}
10251025

1026-
#### 理解原理{#understanding-what-happened}
1026+
#### 理解原理 {#understanding-what-happened}
10271027

10281028
在本节中,您使用通配符域名为您的 MongoDB 主机配置了 egress 流量。对于单个 MongoDB 主机使用通配符域名没有任何好处(可以指定确切的主机名),
10291029
而当集群中的应用程序需要访问多个匹配某个通配符域名的 MongoDB 主机时可能有用。
@@ -1033,7 +1033,7 @@ egress 流量可以使用针对泛域名 `*.composedb.com` 的单个配置实现
10331033
当配置一个应用使用另一个主机名匹配本小节中的通配符域名的 MongoDB 实例时,不需要额外的 Istio 配置。
10341034
我将这留作一个练习,让读者自行验证。
10351035

1036-
#### 清理到任意通配符域名的 MongoDB TLS egress 流量的配置{#cleanup-of-configuration-for-MongoDB-TLS-egress-traffic-to-arbitrary-wildcarded-domains}
1036+
#### 清理到任意通配符域名的 MongoDB TLS egress 流量的配置{#cleanup-of-configuration-for-mongodb-tls-egress-traffic-to-arbitrary-wildcarded-domains}
10371037

10381038
1. 删除针对 `*.com` 的配置项:
10391039

@@ -1061,7 +1061,7 @@ egress 流量可以使用针对泛域名 `*.composedb.com` 的单个配置实现
10611061
$ rm ./nginx-sni-proxy.conf
10621062
{{< /text >}}
10631063

1064-
## 清理{#cleanup}
1064+
## 清理 {#cleanup}
10651065

10661066
1. 删除`bookinfo`用户:
10671067

@@ -1102,7 +1102,7 @@ egress 流量可以使用针对泛域名 `*.composedb.com` 的单个配置实现
11021102
deployment "ratings-v2" deleted
11031103
{{< /text >}}
11041104

1105-
## 总结{#conclusion}
1105+
## 总结 {#conclusion}
11061106

11071107
在这篇博文中,我演示了 MongoDB egress 流量控制的各种选项。您可以在 TCP 或 TLS 层面上控制 MongoDB egress 流量。
11081108
根据您的组织的安全需求,在 TCP 和 TLS 场景下您都可以将流量从 sidecar 代理定向到外部 MongoDB 主机

0 commit comments

Comments
 (0)