@@ -98,25 +98,25 @@ Configurations with a single API server will experience unavailability while the
98
98
也会获得此更新并且同时信任老的和新的 CA 证书。
99
99
<!--
100
100
```shell
101
- base64_encoded_ca="$(base64 <path to file containing both old and new CAs>)"
101
+ base64_encoded_ca="$(base64 -w0 <path to file containing both old and new CAs>)"
102
102
103
103
for namespace in $(kubectl get ns --no-headers | awk '{print $1}'); do
104
104
for token in $(kubectl get secrets --namespace "$namespace" --field-selector type=kubernetes.io/service-account-token -o name); do
105
105
kubectl get $token --namespace "$namespace" -o yaml | \
106
- /bin/sed "s/\(ca.crt:\).*/\1 ${base64_encoded_ca}" | \
106
+ /bin/sed "s/\(ca.crt:\).*/\1 ${base64_encoded_ca}/ " | \
107
107
kubectl apply -f -
108
108
done
109
109
done
110
110
```
111
111
-->
112
112
113
113
``` shell
114
- base64_encoded_ca=" $( base64 < path to file containing both old and new CAs> ) "
114
+ base64_encoded_ca=" $( base64 -w0 < path to file containing both old and new CAs> ) "
115
115
116
116
for namespace in $( kubectl get ns --no-headers | awk ' {print $1}' ) ; do
117
117
for token in $( kubectl get secrets --namespace " $namespace " --field-selector type=kubernetes.io/service-account-token -o name) ; do
118
118
kubectl get $token --namespace " $namespace " -o yaml | \
119
- /bin/sed " s/\(ca.crt:\).*/\1 ${base64_encoded_ca} " | \
119
+ /bin/sed " s/\(ca.crt:\).*/\1 ${base64_encoded_ca} / " | \
120
120
kubectl apply -f -
121
121
done
122
122
done
@@ -205,13 +205,13 @@ Configurations with a single API server will experience unavailability while the
205
205
206
206
<!--
207
207
To generate certificates and private keys for your cluster using the `openssl`
208
- command line tool, see [Certificates (`openssl`)](/docs/concepts/cluster-administration /certificates/#openssl).
209
- You can also use [`cfssl`](/docs/concepts/cluster-administration /certificates/#cfssl).
208
+ command line tool, see [Certificates (`openssl`)](/docs/tasks/administer-cluster /certificates/#openssl).
209
+ You can also use [`cfssl`](/docs/tasks/administer-cluster /certificates/#cfssl).
210
210
-->
211
211
{{< note >}}
212
212
要使用 ` openssl ` 命令行为集群生成新的证书和私钥,可参阅
213
- [ 证书(` openssl ` )] ( /zh/docs/concepts/cluster-administration /certificates/#openssl ) 。
214
- 你也可以使用[ ` cfssl ` ] ( /zh/docs/concepts/cluster-administration /certificates/#cfssl ) .
213
+ [ 证书(` openssl ` )] ( /zh/docs/tasks/administer-cluster /certificates/#openssl ) 。
214
+ 你也可以使用[ ` cfssl ` ] ( /zh/docs/tasks/administer-cluster /certificates/#cfssl ) .
215
215
{{< /note >}}
216
216
217
217
<!--
@@ -249,10 +249,10 @@ Configurations with a single API server will experience unavailability while the
249
249
ConfigMap ` cluster-info` ,使之包含新的 CA 证书。
250
250
251
251
` ` ` shell
252
- base64_encoded_ca=" $( base64 /etc/kubernetes/pki/ca.crt) "
252
+ base64_encoded_ca=" $( base64 -w0 /etc/kubernetes/pki/ca.crt) "
253
253
254
254
kubectl get cm/cluster-info --namespace kube-public -o yaml | \
255
- /bin/sed " s/\(certificate-authority-data:\).*/\1 ${base64_encoded_ca} " | \
255
+ /bin/sed " s/\(certificate-authority-data:\).*/\1 ${base64_encoded_ca} / " | \
256
256
kubectl apply -f -
257
257
` ` `
258
258
< ! --
0 commit comments