Skip to content

Commit 1d7b6a1

Browse files
authored
Merge pull request #34725 from bishal7679/patch-2
Fixed [zh] Wrong list numbering in tasks/administer-cluster/certificates page
2 parents 0cdada9 + 345664a commit 1d7b6a1

File tree

1 file changed

+91
-88
lines changed

1 file changed

+91
-88
lines changed

content/zh-cn/docs/tasks/administer-cluster/certificates.md

Lines changed: 91 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -38,26 +38,26 @@ manually through `easyrsa`, `openssl` or `cfssl`.
3838
cd easy-rsa-master/easyrsa3
3939
./easyrsa init-pki
4040

41-
<!--
42-
1. Generate a new certificate authority (CA). `--batch` sets automatic mode;
43-
`--req-cn` specifies the Common Name (CN) for the CA's new root certificate.
44-
-->
45-
1. 生成新的证书颁发机构(CA)。参数 `--batch` 用于设置自动模式;
41+
<!--
42+
2. Generate a new certificate authority (CA). `--batch` sets automatic mode;
43+
`--req-cn` specifies the Common Name (CN) for the CA's new root certificate.
44+
-->
45+
2. 生成新的证书颁发机构(CA)。参数 `--batch` 用于设置自动模式;
4646
参数 `--req-cn` 用于设置新的根证书的通用名称(CN)。
4747

4848
./easyrsa --batch "--req-cn=${MASTER_IP}@`date +%s`" build-ca nopass
4949

50-
<!--
51-
1. Generate server certificate and key.
52-
The argument `--subject-alt-name` sets the possible IPs and DNS names the API server will
53-
be accessed with. The `MASTER_CLUSTER_IP` is usually the first IP from the service CIDR
54-
that is specified as the `--service-cluster-ip-range` argument for both the API server and
55-
the controller manager component. The argument `--days` is used to set the number of days
56-
after which the certificate expires.
57-
The sample below also assumes that you are using `cluster.local` as the default
58-
DNS domain name.
59-
-->
60-
1. 生成服务器证书和秘钥。
50+
<!--
51+
3. Generate server certificate and key.
52+
The argument `--subject-alt-name` sets the possible IPs and DNS names the API server will
53+
be accessed with. The `MASTER_CLUSTER_IP` is usually the first IP from the service CIDR
54+
that is specified as the `--service-cluster-ip-range` argument for both the API server and
55+
the controller manager component. The argument `--days` is used to set the number of days
56+
after which the certificate expires.
57+
The sample below also assumes that you are using `cluster.local` as the default
58+
DNS domain name.
59+
-->
60+
3. 生成服务器证书和秘钥。
6161
参数 `--subject-alt-name` 设置 API 服务器的 IP 和 DNS 名称。
6262
`MASTER_CLUSTER_IP` 用于 API 服务器和控制管理器,通常取 CIDR 的第一个 IP,由 `--service-cluster-ip-range` 的参数提供。
6363
参数 `--days` 用于设置证书的过期时间。
@@ -73,12 +73,15 @@ manually through `easyrsa`, `openssl` or `cfssl`.
7373
--days=10000 \
7474
build-server-full server nopass
7575

76-
<!--
77-
1. Copy `pki/ca.crt`, `pki/issued/server.crt`, and `pki/private/server.key` to your directory.
78-
1. Fill in and add the following parameters into the API server start parameters:
79-
-->
80-
1. 拷贝文件 `pki/ca.crt``pki/issued/server.crt``pki/private/server.key` 到你的目录中。
81-
1. 在 API 服务器的启动参数中添加以下参数:
76+
<!--
77+
4. Copy `pki/ca.crt`, `pki/issued/server.crt`, and `pki/private/server.key` to your directory.
78+
-->
79+
4. 拷贝文件 `pki/ca.crt``pki/issued/server.crt``pki/private/server.key` 到你的目录中。
80+
81+
<!--
82+
5. Fill in and add the following parameters into the API server start parameters:
83+
-->
84+
5. 在 API 服务器的启动参数中添加以下参数:
8285

8386
--client-ca-file=/yourdirectory/ca.crt
8487
--tls-cert-file=/yourdirectory/server.crt
@@ -98,30 +101,30 @@ manually through `easyrsa`, `openssl` or `cfssl`.
98101

99102
openssl genrsa -out ca.key 2048
100103

101-
<!--
102-
1. According to the ca.key generate a ca.crt (use -days to set the certificate effective time):
103-
-->
104-
1. 在 ca.key 文件的基础上,生成 ca.crt 文件(用参数 -days 设置证书有效期)
104+
<!--
105+
2. According to the ca.key generate a ca.crt (use -days to set the certificate effective time):
106+
-->
107+
2. 在 ca.key 文件的基础上,生成 ca.crt 文件(用参数 -days 设置证书有效期)
105108

106109
openssl req -x509 -new -nodes -key ca.key -subj "/CN=${MASTER_IP}" -days 10000 -out ca.crt
107110

108-
<!--
109-
1. Generate a server.key with 2048bit:
110-
-->
111-
1. 生成一个 2048 位的 server.key 文件:
111+
<!--
112+
3. Generate a server.key with 2048bit:
113+
-->
114+
3. 生成一个 2048 位的 server.key 文件:
112115

113116
openssl genrsa -out server.key 2048
114117

115-
<!--
116-
1. Create a config file for generating a Certificate Signing Request (CSR).
117-
Be sure to substitute the values marked with angle brackets (e.g. `<MASTER_IP>`)
118-
with real values before saving this to a file (e.g. `csr.conf`).
119-
Note that the value for `MASTER_CLUSTER_IP` is the service cluster IP for the
120-
API server as described in previous subsection.
121-
The sample below also assumes that you are using `cluster.local` as the default
122-
DNS domain name.
123-
-->
124-
1. 创建一个用于生成证书签名请求(CSR)的配置文件。
118+
<!--
119+
4. Create a config file for generating a Certificate Signing Request (CSR).
120+
Be sure to substitute the values marked with angle brackets (e.g. `<MASTER_IP>`)
121+
with real values before saving this to a file (e.g. `csr.conf`).
122+
Note that the value for `MASTER_CLUSTER_IP` is the service cluster IP for the
123+
API server as described in previous subsection.
124+
The sample below also assumes that you are using `cluster.local` as the default
125+
DNS domain name.
126+
-->
127+
4. 创建一个用于生成证书签名请求(CSR)的配置文件。
125128
保存文件(例如:`csr.conf`)前,记得用真实值替换掉尖括号中的值(例如:`<MASTER_IP>`)。
126129
注意:`MASTER_CLUSTER_IP` 就像前一小节所述,它的值是 API 服务器的服务集群 IP。
127130
下面的例子假定你的默认 DNS 域名为 `cluster.local`
@@ -160,33 +163,33 @@ manually through `easyrsa`, `openssl` or `cfssl`.
160163
extendedKeyUsage=serverAuth,clientAuth
161164
subjectAltName=@alt_names
162165

163-
<!--
164-
1. Generate the certificate signing request based on the config file:
165-
-->
166-
1. 基于上面的配置文件生成证书签名请求:
166+
<!--
167+
5. Generate the certificate signing request based on the config file:
168+
-->
169+
5. 基于上面的配置文件生成证书签名请求:
167170

168171
openssl req -new -key server.key -out server.csr -config csr.conf
169172

170-
<!--
171-
1. Generate the server certificate using the ca.key, ca.crt and server.csr:
172-
-->
173-
1. 基于 ca.key、ca.crt 和 server.csr 等三个文件生成服务端证书:
173+
<!--
174+
6. Generate the server certificate using the ca.key, ca.crt and server.csr:
175+
-->
176+
6. 基于 ca.key、ca.crt 和 server.csr 等三个文件生成服务端证书:
174177

175178
openssl x509 -req -in server.csr -CA ca.crt -CAkey ca.key \
176179
-CAcreateserial -out server.crt -days 10000 \
177180
-extensions v3_ext -extfile csr.conf
178181

179-
<!--
180-
1. View the certificate signing request:
181-
-->
182-
1. 查看证书签名请求:
182+
<!--
183+
7. View the certificate signing request:
184+
-->
185+
7. 查看证书签名请求:
183186

184187
openssl req -noout -text -in ./server.csr
185188

186-
<!--
187-
1. View the certificate:
188-
-->
189-
1. 查看证书:
189+
<!--
190+
8. View the certificate:
191+
-->
192+
8. 查看证书:
190193

191194
openssl x509 -noout -text -in ./server.crt
192195

@@ -217,20 +220,20 @@ Finally, add the same parameters into the API server start parameters.
217220
curl -L https://github.com/cloudflare/cfssl/releases/download/v1.5.0/cfssl-certinfo_1.5.0_linux_amd64 -o cfssl-certinfo
218221
chmod +x cfssl-certinfo
219222

220-
<!--
221-
1. Create a directory to hold the artifacts and initialize cfssl:
222-
-->
223-
1. 创建一个目录,用它保存所生成的构件和初始化 cfssl:
223+
<!--
224+
2. Create a directory to hold the artifacts and initialize cfssl:
225+
-->
226+
2. 创建一个目录,用它保存所生成的构件和初始化 cfssl:
224227

225228
mkdir cert
226229
cd cert
227230
../cfssl print-defaults config > config.json
228231
../cfssl print-defaults csr > csr.json
229232

230-
<!--
231-
1. Create a JSON config file for generating the CA file, for example, `ca-config.json`:
232-
-->
233-
1. 创建一个 JSON 配置文件来生成 CA 文件,例如:`ca-config.json`
233+
<!--
234+
3. Create a JSON config file for generating the CA file, for example, `ca-config.json`:
235+
-->
236+
3. 创建一个 JSON 配置文件来生成 CA 文件,例如:`ca-config.json`
234237

235238
{
236239
"signing": {
@@ -251,12 +254,12 @@ Finally, add the same parameters into the API server start parameters.
251254
}
252255
}
253256

254-
<!--
255-
1. Create a JSON config file for CA certificate signing request (CSR), for example,
256-
`ca-csr.json`. Be sure to replace the values marked with angle brackets with
257-
real values you want to use.
258-
-->
259-
1. 创建一个 JSON 配置文件,用于 CA 证书签名请求(CSR),例如:`ca-csr.json`
257+
<!--
258+
4. Create a JSON config file for CA certificate signing request (CSR), for example,
259+
`ca-csr.json`. Be sure to replace the values marked with angle brackets with
260+
real values you want to use.
261+
-->
262+
4. 创建一个 JSON 配置文件,用于 CA 证书签名请求(CSR),例如:`ca-csr.json`
260263
确认用你需要的值替换掉尖括号中的值。
261264

262265
{
@@ -274,22 +277,22 @@ Finally, add the same parameters into the API server start parameters.
274277
}]
275278
}
276279

277-
<!--
278-
1. Generate CA key (`ca-key.pem`) and certificate (`ca.pem`):
279-
-->
280-
1. 生成 CA 秘钥文件(`ca-key.pem`)和证书文件(`ca.pem`):
280+
<!--
281+
5. Generate CA key (`ca-key.pem`) and certificate (`ca.pem`):
282+
-->
283+
5. 生成 CA 秘钥文件(`ca-key.pem`)和证书文件(`ca.pem`):
281284

282285
../cfssl gencert -initca ca-csr.json | ../cfssljson -bare ca
283286

284-
<!--
285-
1. Create a JSON config file for generating keys and certificates for the API
286-
server, for example, `server-csr.json`. Be sure to replace the values in angle brackets with
287-
real values you want to use. The `MASTER_CLUSTER_IP` is the service cluster
288-
IP for the API server as described in previous subsection.
289-
The sample below also assumes that you are using `cluster.local` as the default
290-
DNS domain name.
291-
-->
292-
1. 创建一个 JSON 配置文件,用来为 API 服务器生成秘钥和证书,例如:`server-csr.json`
287+
<!--
288+
6. Create a JSON config file for generating keys and certificates for the API
289+
server, for example, `server-csr.json`. Be sure to replace the values in angle brackets with
290+
real values you want to use. The `MASTER_CLUSTER_IP` is the service cluster
291+
IP for the API server as described in previous subsection.
292+
The sample below also assumes that you are using `cluster.local` as the default
293+
DNS domain name.
294+
-->
295+
6. 创建一个 JSON 配置文件,用来为 API 服务器生成秘钥和证书,例如:`server-csr.json`
293296
确认用你需要的值替换掉尖括号中的值。`MASTER_CLUSTER_IP` 是为 API 服务器 指定的服务集群 IP,就像前面小节描述的那样。
294297
以下示例假定你的默认 DNS 域名为`cluster.local`
295298

@@ -318,11 +321,11 @@ Finally, add the same parameters into the API server start parameters.
318321
}]
319322
}
320323

321-
<!--
322-
1. Generate the key and certificate for the API server, which are by default
323-
saved into file `server-key.pem` and `server.pem` respectively:
324-
-->
325-
1. 为 API 服务器生成秘钥和证书,默认会分别存储为`server-key.pem``server.pem` 两个文件。
324+
<!--
325+
7. Generate the key and certificate for the API server, which are by default
326+
saved into file `server-key.pem` and `server.pem` respectively:
327+
-->
328+
7. 为 API 服务器生成秘钥和证书,默认会分别存储为`server-key.pem``server.pem` 两个文件。
326329

327330
../cfssl gencert -ca=ca.pem -ca-key=ca-key.pem \
328331
--config=ca-config.json -profile=kubernetes \

0 commit comments

Comments
 (0)