You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/zh/docs/concepts/services-networking/connect-applications-service.md
+23-24Lines changed: 23 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -354,16 +354,18 @@ Till now we have only accessed the nginx server from within the cluster. Before
354
354
You can acquire all these from the [nginx https example](https://github.com/kubernetes/examples/tree/{{< param "githubbranch" >}}/staging/https-nginx/). This requires having go and make tools installed. If you don't want to install those, then follow the manual steps later. In short:
355
355
-->
356
356
357
-
## Service 安全
357
+
## 保护 Service {#securing-the-service}
358
358
359
-
到现在为止,我们只在集群内部访问了 Nginx server。在将 Service 暴露到 Internet 之前,我们希望确保通信信道是安全的。对于这可能需要:
359
+
到现在为止,我们只在集群内部访问了 Nginx 服务器。在将 Service 暴露到因特网之前,我们希望确保通信信道是安全的。
360
+
为实现这一目的,可能需要:
360
361
361
-
*https 自签名证书(除非已经有了一个识别身份的证书)
362
-
* 使用证书配置的 Nginx server
362
+
*用于 HTTPS 的自签名证书(除非已经有了一个识别身份的证书)
363
+
* 使用证书配置的 Nginx 服务器
363
364
* 使证书可以访问 Pod 的 [Secret](/zh/docs/concepts/configuration/secret/)
At this point you can reach the nginx server from any node.
492
492
-->
493
-
494
-
这时可以从任何节点访问到 Nginx server。
493
+
这时,你可以从任何节点访问到 Nginx 服务器。
495
494
496
495
```shell
497
496
kubectl get pods -o yaml | grep -i podip
@@ -506,10 +505,9 @@ Note how we supplied the `-k` parameter to curl in the last step, this is becaus
506
505
so we have to tell curl to ignore the CName mismatch. By creating a Service we linked the CName used in the certificate with the actual DNS name used by pods during Service lookup.
507
506
Let's test this from a pod (the same secret is being reused for simplicity, the pod only needs nginx.crt to access the Service):
508
507
-->
509
-
510
-
注意最后一步我们是如何提供 `-k` 参数执行 curl命令的,这是因为在证书生成时,
511
-
我们不知道任何关于运行 Nginx 的 Pod 的信息,所以不得不在执行 curl 命令时忽略 CName 不匹配的情况。
512
-
通过创建 Service,我们连接了在证书中的 CName 与在 Service 查询时被 Pod使用的实际 DNS 名字。
508
+
注意最后一步我们是如何提供 `-k` 参数执行 curl 命令的,这是因为在证书生成时,
509
+
我们不知道任何关于运行 nginx 的 Pod 的信息,所以不得不在执行 curl 命令时忽略 CName 不匹配的情况。
510
+
通过创建 Service,我们连接了在证书中的 CName 与在 Service 查询时被 Pod 使用的实际 DNS 名字。
513
511
让我们从一个 Pod 来测试(为了简化使用同一个秘钥,Pod 仅需要使用 nginx.crt 去访问 Service):
0 commit comments