Skip to content

Commit 815fe80

Browse files
committed
Add documentation for certificate rotation.
1 parent bf2deb3 commit 815fe80

File tree

3 files changed

+82
-0
lines changed

3 files changed

+82
-0
lines changed

_data/tasks.yml

+1
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ toc:
128128
- docs/tasks/administer-cluster/access-cluster-services.md
129129
- docs/tasks/administer-cluster/securing-a-cluster.md
130130
- docs/tasks/administer-cluster/encrypt-data.md
131+
- docs/tasks/administer-cluster/certificate-rotation.md
131132
- docs/tasks/administer-cluster/configure-upgrade-etcd.md
132133
- docs/tasks/administer-cluster/static-pod.md
133134
- docs/tasks/administer-cluster/cluster-management.md
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
approvers:
3+
- smarterclayton
4+
title: Certificate rotation
5+
---
6+
7+
{% capture overview %}
8+
This page shows how to enable and configure certificate rotation for the kubelet.
9+
{% endcapture %}
10+
11+
{% capture prerequisites %}
12+
13+
* {% include task-tutorial-prereqs.md %}
14+
15+
* Kubernetes version 1.8.0 or later is required
16+
17+
* Encryption at rest is beta in 1.8.0 which means it may change without notice.
18+
19+
{% endcapture %}
20+
21+
{% capture steps %}
22+
23+
## Configuration and determining whether certificate rotation is already enabled
24+
25+
The `kubelet` process accepts an argument `--rotate-certificates` that controls
26+
if the kubelet will automatically request a new certificate as the expiration of
27+
the certificate currently in use approaches. Since certificate rotation is a
28+
beta feature, the feature flag must also be enabled, with
29+
`--feature-gates=RotateKubeletClientCertificate=true` for the feature to be
30+
enabled.
31+
32+
The `kube-controller-manager` process accepts an argument
33+
`--experimental-cluster-signing-duration` that controls how long certificates
34+
will be issued for.
35+
36+
## Understanding the certificate rotation configuration
37+
38+
When a kubelet starts up, if it is configured to bootstrap (using the
39+
`--bootstrap-kubeconfig` flag) it will use it's initial certificate to connect
40+
to the Kubernetes API and issue a certificate signing request. You can view the
41+
status of certificate signing requests using:
42+
43+
```sh
44+
kubectl get csr
45+
```
46+
47+
Initially a certificate signing request from the kubelet on a node will have a
48+
status of `Pending`. If the certificate signing requests meets specific
49+
criteria, it will be auto approved by the controller manager, then it will have
50+
a status of `Approved`. Next, the controller manager will sign a certificate,
51+
issued for the duration specified by the
52+
`--experimental-cluster-signing-duration` parameter, and the signed certificate
53+
will be attached to the certificate signing requests.
54+
55+
The kubelet will retrieve the signed certificate from the Kubernetes API and
56+
write that to disk, in the location specified by `--cert-dir`. Then the kubelet
57+
will restart itself and use the new certificate to connect to the Kubernetes
58+
API.
59+
60+
As the expiration of the signed certificate approaches, the kubelet will
61+
automatically issue a new certificate signing request, using the Kubernetes
62+
API. Again, the controller manager will automatically approve the certificate
63+
request and attach a signed certificate to the certificate signing request. The
64+
kubelet will retrieve the new signed certificate from the Kubernetes API and
65+
write that to disk. Then it will update the connections it has to the
66+
Kubernetes API to reconnect using the new certificate.
67+
68+
{% endcapture %}
69+
70+
{% include templates/task.md %}

docs/tasks/administer-cluster/securing-a-cluster.md

+11
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,17 @@ parties that gain access to your etcd backups from viewing the content of those
195195
this feature is currently experimental, it may offer an additional level of defense when backups
196196
are not encrypted or an attacker gains read access to etcd.
197197

198+
### Kubelet Certificate Rotation
199+
200+
The kubelet uses certificates for authenticating to the Kubernetes API.
201+
Normally, these certificates are issued with a long expiry date, such that
202+
normally they do not need to be renewed.
203+
204+
Kubernetes 1.8 contains [kubelet certificate
205+
rotation](/docs/tasks/administer-cluster/certificate-rotation/), a beta feature
206+
that will automatically generate a new key and request a new certificate from
207+
the Kubernetes API to use for authenticating connections.
208+
198209
### Receiving alerts for security updates and reporting vulnerabilities
199210

200211
Join the [kubernetes-announce](https://groups.google.com/forum/#!forum/kubernetes-announce)

0 commit comments

Comments
 (0)