Skip to content

Commit 497acd7

Browse files
authored
Merge pull request #47334 from my-git9/pp-23100
[zh-cn] sync bootstrap-tokens certificate-signing-requests
2 parents 70b8c41 + 572533a commit 497acd7

File tree

2 files changed

+54
-49
lines changed

2 files changed

+54
-49
lines changed

content/zh-cn/docs/reference/access-authn-authz/bootstrap-tokens.md

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,18 @@ weight: 20
1717

1818
<!--
1919
Bootstrap tokens are a simple bearer token that is meant to be used when
20-
creating new clusters or joining new nodes to an existing cluster. It was built
21-
to support [kubeadm](/docs/reference/setup-tools/kubeadm/), but can be used in other contexts
20+
creating new clusters or joining new nodes to an existing cluster.
21+
It was built to support [kubeadm](/docs/reference/setup-tools/kubeadm/), but can be used in other contexts
2222
for users that wish to start clusters without `kubeadm`. It is also built to
2323
work, via RBAC policy, with the
24-
[Kubelet TLS Bootstrapping](/docs/reference/access-authn-authz/kubelet-tls-bootstrapping/) system.
24+
[kubelet TLS Bootstrapping](/docs/reference/access-authn-authz/kubelet-tls-bootstrapping/) system.
2525
-->
2626
启动引导令牌是一种简单的持有者令牌(Bearer Token),这种令牌是在新建集群
2727
或者在现有集群中添加新节点时使用的。
2828
它被设计成能够支持 [`kubeadm`](/zh-cn/docs/reference/setup-tools/kubeadm/)
2929
但是也可以被用在其他的案例中以便用户在不使用 `kubeadm` 的情况下启动集群。
3030
它也被设计成可以通过 RBAC 策略,结合
31-
[Kubelet TLS 启动引导](/zh-cn/docs/reference/access-authn-authz/kubelet-tls-bootstrapping/)
31+
[kubelet TLS 启动引导](/zh-cn/docs/reference/access-authn-authz/kubelet-tls-bootstrapping/)
3232
系统进行工作。
3333

3434
<!-- body -->
@@ -37,9 +37,9 @@ work, via RBAC policy, with the
3737
3838
Bootstrap Tokens are defined with a specific type
3939
(`bootstrap.kubernetes.io/token`) of secrets that lives in the `kube-system`
40-
namespace. These Secrets are then read by the Bootstrap Authenticator in the
41-
API Server. Expired tokens are removed with the TokenCleaner controller in the
42-
Controller Manager. The tokens are also used to create a signature for a
40+
namespace. These Secrets are then read by the Bootstrap Authenticator in the
41+
API Server. Expired tokens are removed with the TokenCleaner controller in the
42+
Controller Manager. The tokens are also used to create a signature for a
4343
specific ConfigMap used in a "discovery" process through a BootstrapSigner
4444
controller.
4545
-->
@@ -53,11 +53,11 @@ BootstrapSigner 控制器也会使用这一 ConfigMap。
5353
<!--
5454
## Token Format
5555
56-
Bootstrap Tokens take the form of `abcdef.0123456789abcdef`. More formally,
57-
they must match the regular expression `[a-z0-9]{6}\.[a-z0-9]{16}`.
56+
Bootstrap Tokens take the form of `abcdef.0123456789abcdef`.
57+
More formally, they must match the regular expression `[a-z0-9]{6}\.[a-z0-9]{16}`.
5858
5959
The first part of the token is the "Token ID" and is considered public
60-
information. It is used when referring to a token without leaking the secret
60+
information. It is used when referring to a token without leaking the secret
6161
part used for authentication. The second part is the "Token Secret" and should
6262
only be shared with trusted parties.
6363
-->
@@ -97,8 +97,8 @@ Authorization: Bearer 07401b.f395accd246ae52d
9797
```
9898
<!--
9999
Tokens authenticate as the username `system:bootstrap:<token id>` and are members
100-
of the group `system:bootstrappers`. Additional groups may be specified in the
101-
token's Secret.
100+
of the group `system:bootstrappers`.
101+
Additional groups may be specified in the token's Secret.
102102
103103
Expired tokens can be deleted automatically by enabling the `tokencleaner`
104104
controller on the controller manager.
@@ -115,7 +115,7 @@ controller on the controller manager.
115115
<!--
116116
## Bootstrap Token Secret Format
117117
118-
Each valid token is backed by a secret in the `kube-system` namespace. You can
118+
Each valid token is backed by a secret in the `kube-system` namespace. You can
119119
find the full design doc
120120
[here](https://github.com/kubernetes/design-proposals-archive/blob/main/cluster-lifecycle/bootstrap-discovery.md).
121121
@@ -161,11 +161,10 @@ stringData:
161161
162162
<!--
163163
The type of the secret must be `bootstrap.kubernetes.io/token` and the name must
164-
be `bootstrap-token-<token id>`. It must also exist in the `kube-system`
165-
namespace.
164+
be `bootstrap-token-<token id>`. It must also exist in the `kube-system` namespace.
166165

167-
The `usage-bootstrap-*` members indicate what this secret is intended to be used
168-
for. A value must be set to `true` to be enabled.
166+
The `usage-bootstrap-*` members indicate what this secret is intended to be used for.
167+
A value must be set to `true` to be enabled.
169168
-->
170169
Secret 的类型必须是 `bootstrap.kubernetes.io/token`,而且名字必须是 `bootstrap-token-<token id>`。
171170
令牌必须存在于 `kube-system` 名字空间中。
@@ -183,9 +182,9 @@ authenticate to the API server as a bearer token.
183182
就像下面描述的那样。
184183

185184
<!--
186-
The `expiration` field controls the expiry of the token. Expired tokens are
185+
The `expiration` field controls the expiry of the token. Expired tokens are
187186
rejected when used for authentication and ignored during ConfigMap signing.
188-
The expiry value is encoded as an absolute UTC time using RFC3339. Enable the
187+
The expiry value is encoded as an absolute UTC time using RFC3339. Enable the
189188
`tokencleaner` controller to automatically delete expired tokens.
190189
-->
191190
`expiration` 字段控制令牌的失效期。过期的令牌在用于身份认证时会被拒绝,在用于
@@ -208,9 +207,9 @@ You can use the `kubeadm` tool to manage tokens on a running cluster. See the
208207
<!--
209208
## ConfigMap Signing
210209

211-
In addition to authentication, the tokens can be used to sign a ConfigMap. This
212-
is used early in a cluster bootstrap process before the client trusts the API
213-
server. The signed ConfigMap can be authenticated by the shared token.
210+
In addition to authentication, the tokens can be used to sign a ConfigMap.
211+
This is used early in a cluster bootstrap process before the client trusts the API
212+
server. The signed ConfigMap can be authenticated by the shared token.
214213

215214
Enable ConfigMap signing by enabling the `bootstrapsigner` controller on the
216215
Controller Manager.
@@ -230,7 +229,7 @@ Controller Manager.
230229
<!--
231230
The ConfigMap that is signed is `cluster-info` in the `kube-public` namespace.
232231
The typical flow is that a client reads this ConfigMap while unauthenticated and
233-
ignoring TLS errors. It then validates the payload of the ConfigMap by looking
232+
ignoring TLS errors. It then validates the payload of the ConfigMap by looking
234233
at a signature embedded in the ConfigMap.
235234
236235
The ConfigMap may look like this:
@@ -265,19 +264,19 @@ data:
265264

266265
<!--
267266
The `kubeconfig` member of the ConfigMap is a config file with only the cluster
268-
information filled out. The key thing being communicated here is the
269-
`certificate-authority-data`. This may be expanded in the future.
267+
information filled out. The key thing being communicated here is the
268+
`certificate-authority-data`. This may be expanded in the future.
270269
-->
271270
ConfigMap 的 `kubeconfig` 成员是一个填好了集群信息的配置文件。
272271
这里主要交换的信息是 `certificate-authority-data`。在将来可能会有扩展。
273272

274273
<!--
275-
The signature is a JWS signature using the "detached" mode. To validate the
274+
The signature is a JWS signature using the "detached" mode. To validate the
276275
signature, the user should encode the `kubeconfig` payload according to JWS
277-
rules (base64 encoded while discarding any trailing `=`). That encoded payload
278-
is then used to form a whole JWS by inserting it between the 2 dots. You can
276+
rules (base64 encoded while discarding any trailing `=`). That encoded payload
277+
is then used to form a whole JWS by inserting it between the 2 dots. You can
279278
verify the JWS using the `HS256` scheme (HMAC-SHA256) with the full token (e.g.
280-
`07401b.f395accd246ae52d`) as the shared secret. Users _must_ verify that HS256
279+
`07401b.f395accd246ae52d`) as the shared secret. Users _must_ verify that HS256
281280
is used.
282281
-->
283282
签名是一个使用 “detached” 模式生成的 JWS 签名。

content/zh-cn/docs/reference/access-authn-authz/certificate-signing-requests.md

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ the `spec.request` field. The CertificateSigningRequest denotes the signer (the
7373
recipient that the request is being made to) using the `spec.signerName` field.
7474
Note that `spec.signerName` is a required key after API version `certificates.k8s.io/v1`.
7575
In Kubernetes v1.22 and later, clients may optionally set the `spec.expirationSeconds`
76-
field to request a particular lifetime for the issued certificate. The minimum valid
76+
field to request a particular lifetime for the issued certificate. The minimum valid
7777
value for this field is `600`, i.e. ten minutes.
7878
-->
7979
### 请求签名流程 {#request-signing-process}
@@ -223,7 +223,7 @@ signed, a security certificate.
223223
224224
Any signer that is made available for outside a particular cluster should provide information
225225
about how the signer works, so that consumers can understand what that means for CertifcateSigningRequests
226-
and (if enabled) [ClusterTrustBundles](#cluster-trust-bundles).
226+
and (if enabled) [ClusterTrustBundles](#cluster-trust-bundles).
227227
This includes:
228228
-->
229229
## 签名者 {#signers}
@@ -237,8 +237,10 @@ This includes:
237237
<!--
238238
1. **Trust distribution**: how trust anchors (CA certificates or certificate bundles) are distributed.
239239
1. **Permitted subjects**: any restrictions on and behavior when a disallowed subject is requested.
240-
1. **Permitted x509 extensions**: including IP subjectAltNames, DNS subjectAltNames, Email subjectAltNames, URI subjectAltNames etc, and behavior when a disallowed extension is requested.
241-
1. **Permitted key usages / extended key usages**: any restrictions on and behavior when usages different than the signer-determined usages are specified in the CSR.
240+
1. **Permitted x509 extensions**: including IP subjectAltNames, DNS subjectAltNames,
241+
Email subjectAltNames, URI subjectAltNames etc, and behavior when a disallowed extension is requested.
242+
1. **Permitted key usages / extended key usages**: any restrictions on and behavior
243+
when usages different than the signer-determined usages are specified in the CSR.
242244
1. **Expiration/certificate lifetime**: whether it is fixed by the signer, configurable by the admin, determined by the CSR `spec.expirationSeconds` field, etc
243245
and the behavior when the signer-determined expiration is different from the CSR `spec.expirationSeconds` field.
244246
1. **CA bit allowed/disallowed**: and behavior if a CSR contains a request a for a CA certificate when the signer does not permit it.
@@ -281,7 +283,7 @@ certificate expiration or lifetime. The expiration or lifetime therefore has to
281283
through the `spec.expirationSeconds` field of the CSR object. The built-in signers
282284
use the `ClusterSigningDuration` configuration option, which defaults to 1 year,
283285
(the `--cluster-signing-duration` command-line flag of the kube-controller-manager)
284-
as the default when no `spec.expirationSeconds` is specified. When `spec.expirationSeconds`
286+
as the default when no `spec.expirationSeconds` is specified. When `spec.expirationSeconds`
285287
is specified, the minimum of `spec.expirationSeconds` and `ClusterSigningDuration` is
286288
used.
287289
-->
@@ -294,7 +296,7 @@ PKCS#10 签名请求格式并没有一种标准的方法去设置证书的过期
294296

295297
{{< note >}}
296298
<!--
297-
The `spec.expirationSeconds` field was added in Kubernetes v1.22. Earlier versions of Kubernetes do not honor this field.
299+
The `spec.expirationSeconds` field was added in Kubernetes v1.22. Earlier versions of Kubernetes do not honor this field.
298300
Kubernetes API servers prior to v1.22 will silently drop this field when the object is created.
299301
-->
300302
`spec.expirationSeconds` 字段是在 Kubernetes v1.22 中加入的。早期的 Kubernetes 版本并不认识该字段。
@@ -426,18 +428,18 @@ kube-controller-manager 为每个内置签名者实现了[控制平面签名](#s
426428

427429
{{< note >}}
428430
<!--
429-
The `spec.expirationSeconds` field was added in Kubernetes v1.22. Earlier versions of Kubernetes do not honor this field.
431+
The `spec.expirationSeconds` field was added in Kubernetes v1.22. Earlier versions of Kubernetes do not honor this field.
430432
Kubernetes API servers prior to v1.22 will silently drop this field when the object is created.
431433
-->
432434
`spec.expirationSeconds` 字段是在 Kubernetes v1.22 中加入的,早期的 Kubernetes 版本并不认识该字段,
433435
v1.22 版本之前的 Kubernetes API 服务器会在创建对象的时候忽略该字段。
434436
{{< /note >}}
435437

436438
<!--
437-
Distribution of trust happens out of band for these signers. Any trust outside of those described above are strictly
439+
Distribution of trust happens out of band for these signers. Any trust outside of those described above are strictly
438440
coincidental. For instance, some distributions may honor `kubernetes.io/legacy-unknown` as client certificates for the
439441
kube-apiserver, but this is not a standard.
440-
None of these usages are related to ServiceAccount token secrets `.data[ca.crt]` in any way. That CA bundle is only
442+
None of these usages are related to ServiceAccount token secrets `.data[ca.crt]` in any way. That CA bundle is only
441443
guaranteed to verify a connection to the API server using the default service (`kubernetes.default.svc`).
442444
-->
443445
对于这些签名者,信任的分发发生在带外(out of band)。上述信任之外的任何信任都是完全巧合的。
@@ -474,7 +476,8 @@ kube-controller-manager 签名所有标记为 approved 的 CSR。
474476

475477
{{< note >}}
476478
<!--
477-
The `spec.expirationSeconds` field was added in Kubernetes v1.22. Earlier versions of Kubernetes do not honor this field.
479+
The `spec.expirationSeconds` field was added in Kubernetes v1.22.
480+
Earlier versions of Kubernetes do not honor this field.
478481
Kubernetes API servers prior to v1.22 will silently drop this field when the object is created.
479482
-->
480483
`spec.expirationSeconds` 字段是在 Kubernetes v1.22 中加入的,早期的 Kubernetes 版本并不认识该字段,
@@ -703,7 +706,7 @@ this API.
703706

704707
<!--
705708
A ClusterTrustBundles is a cluster-scoped object for distributing X.509 trust
706-
anchors (root certificates) to workloads within the cluster. They're designed
709+
anchors (root certificates) to workloads within the cluster. They're designed
707710
to work well with the [signer](#signers) concept from CertificateSigningRequests.
708711

709712
ClusterTrustBundles can be used in two modes:
@@ -719,8 +722,8 @@ ClusterTrustBundle 可以使用两种模式:
719722
### Common properties and validation {#ctb-common}
720723

721724
All ClusterTrustBundle objects have strong validation on the contents of their
722-
`trustBundle` field. That field must contain one or more X.509 certificates,
723-
DER-serialized, each wrapped in a PEM `CERTIFICATE` block. The certificates
725+
`trustBundle` field. That field must contain one or more X.509 certificates,
726+
DER-serialized, each wrapped in a PEM `CERTIFICATE` block. The certificates
724727
must parse as valid X.509 certificates.
725728

726729
Esoteric PEM features like inter-block data and intra-block headers are either
@@ -796,8 +799,8 @@ controller in the cluster, so they have several security features:
796799
`<signerNameDomain>/<signerNamePath>` or match a pattern such as
797800
`<signerNameDomain>/*`.
798801
* Signer-linked ClusterTrustBundles **must** be named with a prefix derived from
799-
their `spec.signerName` field. Slashes (`/`) are replaced with colons (`:`),
800-
and a final colon is appended. This is followed by an arbitrary name. For
802+
their `spec.signerName` field. Slashes (`/`) are replaced with colons (`:`),
803+
and a final colon is appended. This is followed by an arbitrary name. For
801804
example, the signer `example.com/mysigner` can be linked to a
802805
ClusterTrustBundle `example.com:mysigner:<arbitrary-name>`.
803806
-->
@@ -841,8 +844,8 @@ spec:
841844
```
842845

843846
<!--
844-
They are primarily intended for cluster configuration use cases. Each
845-
signer-unlinked ClusterTrustBundle is an independent object, in contrast to the
847+
They are primarily intended for cluster configuration use cases.
848+
Each signer-unlinked ClusterTrustBundle is an independent object, in contrast to the
846849
customary grouping behavior of signer-linked ClusterTrustBundles.
847850

848851
Signer-unlinked ClusterTrustBundles have no `attest` verb requirement.
@@ -869,7 +872,8 @@ ClusterTrustBundle 的名称**必须不**包含英文冒号(`:`)。
869872
{{<feature-state for_k8s_version="v1.29" state="alpha" >}}
870873

871874
<!--
872-
The contents of ClusterTrustBundles can be injected into the container filesystem, similar to ConfigMaps and Secrets. See the [clusterTrustBundle projected volume source](/docs/concepts/storage/projected-volumes#clustertrustbundle) for more details.
875+
The contents of ClusterTrustBundles can be injected into the container filesystem, similar to ConfigMaps and Secrets.
876+
See the [clusterTrustBundle projected volume source](/docs/concepts/storage/projected-volumes#clustertrustbundle) for more details.
873877
-->
874878
ClusterTrustBundle 的内容可以注入到容器文件系统,这与 ConfigMap 和 Secret 类似。
875879
更多细节参阅 [ClusterTrustBundle 投射卷源](/zh-cn/docs/concepts/storage/projected-volumes#clustertrustbundle)。
@@ -1074,8 +1078,10 @@ kubectl config use-context myuser
10741078

10751079
<!--
10761080
* Read [Manage TLS Certificates in a Cluster](/docs/tasks/tls/managing-tls-in-a-cluster/)
1077-
* View the source code for the kube-controller-manager built in [signer](https://github.com/kubernetes/kubernetes/blob/32ec6c212ec9415f604ffc1f4c1f29b782968ff1/pkg/controller/certificates/signer/cfssl_signer.go)
1078-
* View the source code for the kube-controller-manager built in [approver](https://github.com/kubernetes/kubernetes/blob/32ec6c212ec9415f604ffc1f4c1f29b782968ff1/pkg/controller/certificates/approver/sarapprove.go)
1081+
* View the source code for the kube-controller-manager built in
1082+
[signer](https://github.com/kubernetes/kubernetes/blob/32ec6c212ec9415f604ffc1f4c1f29b782968ff1/pkg/controller/certificates/signer/cfssl_signer.go)
1083+
* View the source code for the kube-controller-manager built in
1084+
[approver](https://github.com/kubernetes/kubernetes/blob/32ec6c212ec9415f604ffc1f4c1f29b782968ff1/pkg/controller/certificates/approver/sarapprove.go)
10791085
* For details of X.509 itself, refer to [RFC 5280](https://tools.ietf.org/html/rfc5280#section-3.1) section 3.1
10801086
* For information on the syntax of PKCS#10 certificate signing requests, refer to [RFC 2986](https://tools.ietf.org/html/rfc2986)
10811087
* Read about the ClusterTrustBundle API:

0 commit comments

Comments
 (0)