From 4079daa397c5584bcf087cc9487d06f8f22e8d67 Mon Sep 17 00:00:00 2001 From: jzhupup Date: Thu, 18 Aug 2022 22:48:02 +0800 Subject: [PATCH] [zh-cn] resync /tls/manual-rotation-of-ca-certificates.md --- .../tls/manual-rotation-of-ca-certificates.md | 32 ++----------------- 1 file changed, 3 insertions(+), 29 deletions(-) diff --git a/content/zh-cn/docs/tasks/tls/manual-rotation-of-ca-certificates.md b/content/zh-cn/docs/tasks/tls/manual-rotation-of-ca-certificates.md index f0b950d3db..af3ce32ac0 100644 --- a/content/zh-cn/docs/tasks/tls/manual-rotation-of-ca-certificates.md +++ b/content/zh-cn/docs/tasks/tls/manual-rotation-of-ca-certificates.md @@ -99,41 +99,15 @@ Configurations with a single API server will experience unavailability while the {{< /note >}} -3. 更新所有的保存服务账号令牌的 Secret,使之同时包含老的和新的 CA 证书。 +3. 等待该控制器管理器更新服务账号 Secret 中的 `ca.crt`,使之同时包含老的和新的 CA 证书。 如果在 API 服务器使用新的 CA 之前启动了新的 Pod,这些新的 Pod 也会获得此更新并且同时信任老的和新的 CA 证书。 - - ```shell - base64_encoded_ca="$(base64 -w0 <同时包含老的和新的 CA 的文件路径>)" - - for namespace in $(kubectl get ns --no-headers | awk '{print $1}'); do - for token in $(kubectl get secrets --namespace "$namespace" --field-selector type=kubernetes.io/service-account-token -o name); do - kubectl get $token --namespace "$namespace" -o yaml | \ - /bin/sed "s/\(ca.crt:\).*/\1 ${base64_encoded_ca}/" | \ - kubectl apply -f - - done - done - ``` -