Skip to content

Commit e75494c

Browse files
committed
update content for GA without major refactor
1 parent 1154ea2 commit e75494c

File tree

1 file changed

+54
-71
lines changed

1 file changed

+54
-71
lines changed

content/en/docs/reference/command-line-tools-reference/kubelet-tls-bootstrapping.md

+54-71
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
22
reviewers:
3-
- ericchiang
43
- mikedanese
5-
- jcbsmpsn
4+
- liggitt
5+
- smarterclayton
6+
- awly
67
title: TLS bootstrapping
78
content_template: templates/concept
89
---
910

1011
{{% capture overview %}}
1112

1213
This document describes how to set up TLS client certificate bootstrapping for
13-
kubelets. Kubernetes 1.4 introduced an API for requesting certificates from a
14+
kubelets. Kubernetes 1.4 introduced an API for requesting certificates from a
1415
cluster-level Certificate Authority (CA). The original intent of this API is to
1516
enable provisioning of TLS client certificates for kubelets. The proposal can be
16-
found [here](https://github.com/kubernetes/kubernetes/pull/20439) and progress
17-
on the feature is being tracked as [feature#43](https://github.com/kubernetes/features/issues/43).
17+
found [here](https://github.com/kubernetes/kubernetes/pull/20439).
1818

1919
{{% /capture %}}
2020

@@ -98,38 +98,24 @@ The kube-controller-manager flags are:
9898
--cluster-signing-cert-file="/etc/path/to/kubernetes/ca/ca.crt" --cluster-signing-key-file="/etc/path/to/kubernetes/ca/ca.key"
9999
```
100100

101-
### Approval controller
101+
### SubjectAccessReview Approval Controller
102102

103-
In 1.7 the experimental "group auto approver" controller is dropped in favor of
104-
the new `csrapproving` controller that ships as part of
103+
The `csrapproving` controller that ships as part of
105104
[kube-controller-manager](/docs/admin/kube-controller-manager/) and is enabled
106-
by default. The controller uses the [`SubjectAccessReview`
105+
by default. The controller uses the [`SubjectAccessReview`
107106
API](/docs/reference/access-authn-authz/authorization/#checking-api-access) to
108107
determine if a given user is authorized to request a CSR, then approves based on
109108
the authorization outcome. To prevent conflicts with other approvers, the
110-
builtin approver doesn't explicitly deny CSRs, only ignoring unauthorized
109+
builtin approver doesn't explicitly deny CSRs. It only ignores unauthorized
111110
requests.
112111

113112
The controller categorizes CSRs into three subresources:
114113

115114
1. `nodeclient` - a request by a user for a client certificate with `O=system:nodes` and `CN=system:node:(node name)`.
116115
2. `selfnodeclient` - a node renewing a client certificate with the same `O` and `CN`.
117-
3. `selfnodeserver` - a node renewing a serving certificate. (ALPHA, requires feature gate)
118116

119-
The checks to determine if a CSR is a `selfnodeserver` request is currently tied
120-
to the kubelet's credential rotation implementation, an __alpha__ feature. As
121-
such, the definition of `selfnodeserver` will likely change in a future and
122-
requires the `RotateKubeletServerCertificate` feature gate on the controller
123-
manager. The feature progress can be tracked at
124-
[kubernetes/features#267](https://github.com/kubernetes/features/issues/267).
125-
126-
```
127-
--feature-gates=RotateKubeletServerCertificate=true
128-
```
129-
130-
The following RBAC `ClusterRoles` represent the `nodeclient`, `selfnodeclient`,
131-
and `selfnodeserver` capabilities. Similar roles may be automatically created in
132-
future releases.
117+
The following RBAC `ClusterRoles` represent the `nodeclient` and
118+
`selfnodeclient`, capabilities.
133119

134120
```yml
135121
# A ClusterRole which instructs the CSR approver to approve a user requesting
@@ -153,38 +139,21 @@ rules:
153139
- apiGroups: ["certificates.k8s.io"]
154140
resources: ["certificatesigningrequests/selfnodeclient"]
155141
verbs: ["create"]
156-
---
157-
# A ClusterRole which instructs the CSR approver to approve a node requesting a
158-
# serving cert matching its client cert.
159-
kind: ClusterRole
160-
apiVersion: rbac.authorization.k8s.io/v1
161-
metadata:
162-
name: approve-node-server-renewal-csr
163-
rules:
164-
- apiGroups: ["certificates.k8s.io"]
165-
resources: ["certificatesigningrequests/selfnodeserver"]
166-
verbs: ["create"]
167142
```
168143
169144
As of 1.8, equivalent roles to the ones listed above are automatically created
170-
as part of the default RBAC roles. For 1.8 clusters admins are recommended to
171-
bind tokens to the following roles instead of creating their own:
145+
as part of the default RBAC roles. For 1.8 clusters admins are recommended to
146+
bind node bootstrap identities to the following roles instead of creating their
147+
own:
172148
173149
* `system:certificates.k8s.io:certificatesigningrequests:nodeclient`
174150
- Automatically approve CSRs for client certs bound to this role.
175151
* `system:certificates.k8s.io:certificatesigningrequests:selfnodeclient`
176152
- Automatically approve CSRs when a client bound to its role renews its own certificate.
177153

178-
These powers can be granted to credentials, such as bootstrapping tokens. For
179-
example, to replicate the behavior provided by the removed auto-approval flag,
180-
of approving all CSRs by a single group:
181-
182-
```
183-
# REMOVED: This flag no longer works as of 1.7.
184-
--insecure-experimental-approve-all-kubelet-csrs-for-group="system:bootstrappers"
185-
```
186-
187-
An admin would create a `ClusterRoleBinding` targeting that group.
154+
For example, to grant these permissions to identities attached to bootstrap
155+
tokens, an admin would create a `ClusterRoleBinding` targeting the
156+
`system:bootstrappers` group:
188157

189158
```yml
190159
# Approve all CSRs for the group "system:bootstrappers"
@@ -203,7 +172,7 @@ roleRef:
203172
```
204173

205174
To let a node renew its own credentials, an admin can construct a
206-
`ClusterRoleBinding` targeting that node's credentials:
175+
`ClusterRoleBinding` targeting that node's identity:
207176

208177
```yml
209178
kind: ClusterRoleBinding
@@ -226,10 +195,13 @@ effectively removing it from the cluster once its certificate expires.
226195
## kubelet configuration
227196

228197
To request a client certificate from kube-apiserver, the kubelet first needs a
229-
path to a kubeconfig file that contains the bootstrap authentication token. You
230-
can use `kubectl config set-cluster`, `set-credentials`, and `set-context` to
231-
build this kubeconfig. Provide the name `kubelet-bootstrap` to `kubectl config
232-
set-credentials` and include `--token=<token-value>` as follows:
198+
path to a kubeconfig file that contains the credentials for the identity that it
199+
will use to bootstrap its individual node identity.
200+
201+
If you are using a bootstrap token, you can use `kubectl config set-cluster`,
202+
`set-credentials`, and `set-context` to build this kubeconfig. Provide the name
203+
`kubelet-bootstrap` to `kubectl config set-credentials` and include
204+
`--token=<token-value>` as follows:
233205

234206
```
235207
kubectl config set-credentials kubelet-bootstrap --token=${BOOTSTRAP_TOKEN} --kubeconfig=bootstrap.kubeconfig
@@ -250,35 +222,46 @@ and key file will be placed in the directory specified by `--cert-dir`.
250222
```
251223
{{< /note >}}
252224
253-
Additionally, in 1.7 the kubelet implements __alpha__ features for enabling
225+
Additionally, in 1.7 the kubelet implements __beta__ features for enabling
254226
rotation of both its client and/or serving certs. These can be enabled through
255227
the respective `RotateKubeletClientCertificate` and
256-
`RotateKubeletServerCertificate` feature flags on the kubelet, but may change in
257-
backward incompatible ways in future releases.
228+
`RotateKubeletServerCertificate` feature flags on the kubelet and are enabled by
229+
default.
230+
231+
`RotateKubeletClientCertificate` causes the kubelet to rotate its client
232+
certificates by creating new CSRs as its existing credentials expire. To enable
233+
this feature pass the following flag to the kubelet:
258234
259235
```
260-
--feature-gates=RotateKubeletClientCertificate=true,RotateKubeletServerCertificate=true
236+
--rotate-certificates
261237
```
262238
263-
`RotateKubeletClientCertificate` causes the kubelet to rotate its client
264-
certificates by creating new CSRs as its existing credentials expire.
265239
`RotateKubeletServerCertificate` causes the kubelet to both request a serving
266-
certificate after bootstrapping its client credentials and rotate the
267-
certificate. The serving cert currently does not request DNS or IP SANs.
240+
certificate after bootstrapping its client credentials and to rotate that
241+
certificate. To enable this feature pass the following flag to the kubelet:
242+
243+
```
244+
--rotate-server-certificates
245+
```
246+
247+
{{< note >}}
248+
**Note:** The CSR approving controllers implemented in core Kubernetes do not
249+
approve node serving certificates for [security
250+
reasons](https://github.com/kubernetes/community/pull/1982). To use
251+
`RotateKubeletServerCertificate` operators need to run a custom approving
252+
controller, or manually approve the serving certificate requests.
253+
{{< /note >}}
268254
269255
## kubectl approval
270256
271257
The signing controller does not immediately sign all certificate requests.
272258
Instead, it waits until they have been flagged with an "Approved" status by an
273-
appropriately-privileged user. This is intended to eventually be an automated
274-
process handled by an external approval controller, but for the alpha version of
275-
the API it can be done manually by a cluster administrator using kubectl. An
276-
administrator can list CSRs with `kubectl get csr` and describe one in detail
277-
with `kubectl describe csr <name>`. Before the 1.6 release there were [no direct
278-
approve/deny commands](https://github.com/kubernetes/kubernetes/issues/30163) so
279-
an approver had to update the Status field directly ([rough
280-
how-to](https://github.com/gtank/csrctl)). Later versions of Kubernetes offer
281-
`kubectl certificate approve <name>` and `kubectl certificate deny <name>`
282-
commands.
259+
appropriately-privileged user. This flow is intended to allow for automated
260+
approval handled by an external approval controller or the approval controller
261+
implemented in the core controller-manager. However cluster administrators can
262+
also manually approve certificate requests using kubectl. An administrator can
263+
list CSRs with `kubectl get csr` and describe one in detail with `kubectl
264+
describe csr <name>`. An administrator can approve or deny a CSR with `kubectl
265+
certificate approve <name>` and `kubectl certificate deny <name>`.
283266
284267
{{% /capture %}}

0 commit comments

Comments
 (0)