Skip to content

Commit c3f2b92

Browse files
author
zhuzhenghao
committed
[zh] Resync tasks/tls pages
1 parent 237fdab commit c3f2b92

File tree

2 files changed

+32
-28
lines changed

2 files changed

+32
-28
lines changed

content/zh-cn/docs/tasks/tls/managing-tls-in-a-cluster.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,12 @@ is still to be created.
177177
<!--
178178
## Create a CertificateSigningRequest object to send to the Kubernetes API
179179
180-
Generate a CSR yaml blob and send it to the apiserver by running the following
181-
command:
180+
Generate a CSR manifest (in YAML), and send it to the API server. You can do that by
181+
running the following command:
182182
-->
183183
## 创建证书签名请求(CSR)对象发送到 Kubernetes API
184184

185-
使用以下命令创建 CSR YAML 文件,并发送到 API 服务器:
185+
你可以使用以下命令创建 CSR 清单(YAML 格式),并发送到 API 服务器:
186186

187187
```shell
188188
cat <<EOF | kubectl apply -f -
@@ -338,7 +338,7 @@ EOF
338338
```
339339

340340
<!--
341-
This produces a certificate authority key file (`ca-key.pem`) and certificate (`ca.pem`).
341+
This produces a certificate authority key file (`ca-key.pem`) and certificate (`ca.pem`).
342342
-->
343343
这会产生一个证书颁发机构密钥文件(`ca-key.pem`)和证书(`ca.pem`)。
344344

@@ -361,14 +361,18 @@ kubectl get csr my-svc.my-namespace -o jsonpath='{.spec.request}' | \
361361
cfssljson -bare ca-signed-server
362362
```
363363

364-
<!-- You should see output similar to: -->
364+
<!--
365+
You should see the output similar to:
366+
-->
365367
你应该看到类似于以下的输出:
366368

367369
```
368370
2022/02/01 11:52:26 [INFO] signed certificate with serial number 576048928624926584381415936700914530534472870337
369371
```
370372

371-
<!-- This produces a signed serving certificate file, `ca-signed-server.pem`. -->
373+
<!--
374+
This produces a signed serving certificate file, `ca-signed-server.pem`.
375+
-->
372376
这会生成一个签名的服务证书文件,`ca-signed-server.pem`
373377

374378
<!--
@@ -437,7 +441,7 @@ kubectl get csr my-svc.my-namespace -o jsonpath='{.status.certificate}' \
437441
Now you can populate `server.crt` and `server-key.pem` in a
438442
{{< glossary_tooltip text="Secret" term_id="secret" >}}
439443
that you could later mount into a Pod (for example, to use with a webserver
440-
that serves HTTPS).
444+
that serves HTTPS).
441445
-->
442446
现在你可以将 `server.crt``server-key.pem` 填充到
443447
{{<glossary_tooltip text="Secret" term_id="secret" >}} 中,
@@ -535,7 +539,7 @@ reference page.
535539
<!--
536540
## Configuring your cluster to provide signing
537541
538-
This page assumes that a signer is setup to serve the certificates API. The
542+
This page assumes that a signer is set up to serve the certificates API. The
539543
Kubernetes controller manager provides a default implementation of a signer. To
540544
enable it, pass the `--cluster-signing-cert-file` and
541545
`--cluster-signing-key-file` parameters to the controller manager with paths to

content/zh-cn/docs/tasks/tls/manual-rotation-of-ca-certificates.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This page shows how to manually rotate the certificate authority (CA) certificat
1616

1717
## {{% heading "prerequisites" %}}
1818

19-
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
19+
{{< include "task-tutorial-prereqs.md" >}}
2020

2121
<!--
2222
- For more information about authentication in Kubernetes, see
@@ -55,22 +55,22 @@ Configurations with a single API server will experience unavailability while the
5555
{{< /caution >}}
5656

5757
<!--
58-
1. Distribute the new CA certificates and private keys
59-
(for example: `ca.crt`, `ca.key`, `front-proxy-ca.crt`, and `front-proxy-ca.key`)
60-
to all your control plane nodes in the Kubernetes certificates directory.
58+
1. Distribute the new CA certificates and private keys (for example: `ca.crt`, `ca.key`, `front-proxy-ca.crt`,
59+
and `front-proxy-ca.key`) to all your control plane nodes in the Kubernetes certificates directory.
6160
-->
6261
1. 将新的 CA 证书和私钥(例如:`ca.crt``ca.key``front-proxy-ca.crt`
6362
`front-proxy-client.key`)分发到所有控制面节点,放在其 Kubernetes 证书目录下。
6463

6564
<!--
6665
1. Update the `--root-ca-file` flag for the {{< glossary_tooltip term_id="kube-controller-manager" >}} to include
67-
both old and new CA. Then restart the component.
66+
both old and new CA, then restart the kube-controller-manager.
6867
6968
Any {{< glossary_tooltip text="ServiceAccount" term_id="service-account" >}} created after this point will get
7069
Secrets that include both old and new CAs.
7170
-->
7271
2. 更新 {{< glossary_tooltip text="kube-controller-manager" term_id="kube-controller-manager" >}}
73-
`--root-ca-file` 标志,使之同时包含老的和新的 CA,之后重启组件。
72+
`--root-ca-file` 标志,使之同时包含老的和新的 CA,之后重启
73+
kube-controller-manager。
7474

7575
自此刻起,所创建的所有{{< glossary_tooltip text="ServiceAccount" term_id="service-account" >}}
7676
都会获得同时包含老的 CA 和新的 CA 的 Secret。
@@ -79,9 +79,9 @@ Configurations with a single API server will experience unavailability while the
7979
<!--
8080
The files specified by the kube-controller-manager flags `--client-ca-file` and `--cluster-signing-cert-file`
8181
cannot be CA bundles. If these flags and `--root-ca-file` point to the same `ca.crt` file which is now a
82-
bundle (includes both old and new CA) you will face an error. To workaround this problem you can copy the new CA to a separate
83-
file and make the flags `--client-ca-file` and `--cluster-signing-cert-file` point to the copy. Once `ca.crt` is no longer
84-
a bundle you can restore the problem flags to point to `ca.crt` and delete the copy.
82+
bundle (includes both old and new CA) you will face an error. To workaround this problem you can copy the new CA
83+
to a separate file and make the flags `--client-ca-file` and `--cluster-signing-cert-file` point to the copy.
84+
Once `ca.crt` is no longer a bundle you can restore the problem flags to point to `ca.crt` and delete the copy.
8585
-->
8686
kube-controller-manager 标志 `--client-ca-file``--cluster-signing-cert-file`
8787
所引用的文件不能是 CA 证书包。如果这些标志和 `--root-ca-file` 指向同一个 `ca.crt` 包文件
@@ -99,7 +99,7 @@ Configurations with a single API server will experience unavailability while the
9999
{{< /note >}}
100100

101101
<!--
102-
1. Wait for the controller manager to update ca.crt in the service account Secrets to include both old and new CA certificates.
102+
1. Wait for the controller manager to update `ca.crt` in the service account Secrets to include both old and new CA certificates.
103103
104104
If any Pods are started before new CA is used by API servers, the new Pods get this update and will trust both old and new CAs.
105105
-->
@@ -114,10 +114,10 @@ If any Pods are started before new CA is used by API servers, the new Pods get t
114114
115115
* Make sure CoreDNS, kube-proxy and other Pods using in-cluster configurations are working as expected.
116116
117-
1. Append the both old and new CA to the file against `-client-ca-file` and `-kubelet-certificate-authority`
117+
1. Append the both old and new CA to the file against `--client-ca-file` and `--kubelet-certificate-authority`
118118
flag in the `kube-apiserver` configuration.
119119
120-
1. Append the both old and new CA to the file against `-client-ca-file` flag in the `kube-scheduler` configuration.
120+
1. Append the both old and new CA to the file against `--client-ca-file` flag in the `kube-scheduler` configuration.
121121
-->
122122
4. 重启所有使用集群内配置的 Pod(例如:kube-proxy、CoreDNS 等),以便这些 Pod
123123
能够使用与 ServiceAccount 相关联的 Secret 中的、已更新的证书机构数据。
@@ -161,28 +161,28 @@ If any Pods are started before new CA is used by API servers, the new Pods get t
161161
{{< /note >}}
162162

163163
<!--
164-
1. Follow below steps in a rolling fashion.
164+
1. Follow the steps below in a rolling fashion.
165165
166166
1. Restart any other
167167
[aggregated API servers](/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/) or
168168
webhook handlers to trust the new CA certificates.
169169
170170
1. Restart the kubelet by update the file against `clientCAFile` in kubelet configuration and
171-
`certificate-authority-data` in kubelet.conf to use both the old and new CA on all nodes.
171+
`certificate-authority-data` in `kubelet.conf` to use both the old and new CA on all nodes.
172172
173-
If your kubelet is not using client certificate rotation update `client-certificate-data` and
174-
`client-key-data` in kubelet.conf on all nodes along with the kubelet client certificate file
173+
If your kubelet is not using client certificate rotation, update `client-certificate-data` and
174+
`client-key-data` in `kubelet.conf` on all nodes along with the kubelet client certificate file
175175
usually found in `/var/lib/kubelet/pki`.
176176
-->
177177
9. 遵循下列步骤执行滚动更新
178178

179179
1. 重新启动所有其他[被聚合的 API 服务器](/zh-cn/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/)
180180
或者 Webhook 处理程序,使之信任新的 CA 证书。
181181

182-
1. 在所有节点上更新 kubelet 配置中的 `clientCAFile` 所指文件以及 kubelet.conf 中的
182+
2. 在所有节点上更新 kubelet 配置中的 `clientCAFile` 所指文件以及 `kubelet.conf` 中的
183183
`certificate-authority-data` 并重启 kubelet 以同时使用老的和新的 CA 证书。
184184

185-
如果你的 kubelet 并未使用客户端证书轮换,则在所有节点上更新 kubelet.conf 中
185+
如果你的 kubelet 并未使用客户端证书轮换,则在所有节点上更新 `kubelet.conf`
186186
`client-certificate-data``client-key-data` 以及 kubelet
187187
客户端证书文件(通常位于 `/var/lib/kubelet/pki` 目录下)
188188

@@ -274,7 +274,7 @@ If any Pods are started before new CA is used by API servers, the new Pods get t
274274
1. Verify the cluster functionality.
275275

276276
1. Check the logs from control plane components, along with the kubelet and the kube-proxy.
277-
Ensure those components are not reporting any TLS errors, see
277+
Ensure those components are not reporting any TLS errors; see
278278
[looking at the logs](/docs/tasks/debug/debug-cluster/#looking-at-logs) for more details.
279279

280280
1. Validate logs from any aggregated api servers and pods using in-cluster config.
@@ -291,7 +291,7 @@ If any Pods are started before new CA is used by API servers, the new Pods get t
291291

292292
1. Update all service account tokens to include new CA certificate only.
293293

294-
* All pods using an in-cluster kubeconfig will eventually need to be restarted to pick up the new secret,
294+
* All pods using an in-cluster kubeconfig will eventually need to be restarted to pick up the new Secret,
295295
so that no Pods are relying on the old cluster CA.
296296

297297
1. Restart the control plane components by removing the old CA from the kubeconfig files and the files against `--client-ca-file`, `--root-ca-file` flags resp.

0 commit comments

Comments
 (0)