Skip to content

Commit ad6205d

Browse files
authored
Merge pull request #41939 from JayBeale/patch-3
Replace outdated instructions and add a tip in kubeadm-certs.md
2 parents 0cbd189 + e70acf5 commit ad6205d

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

content/en/docs/tasks/administer-cluster/kubeadm/kubeadm-certs.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ command. In that case, you should explicitly set `--certificate-renewal=true`.
136136

137137
## Manual certificate renewal
138138

139-
You can renew your certificates manually at any time with the `kubeadm certs renew` command.
139+
You can renew your certificates manually at any time with the `kubeadm certs renew` command, with the appropriate command line options.
140140

141141
This command performs the renewal using CA (or front-proxy-CA) certificate and key stored in `/etc/kubernetes/pki`.
142142

@@ -160,15 +160,20 @@ Name, Organization, SAN, etc.) instead of the `kubeadm-config` ConfigMap. It is
160160
to keep them both in sync.
161161
{{< /note >}}
162162

163-
`kubeadm certs renew` provides the following options:
163+
`kubeadm certs renew` can renew any specific certificate or, with the subcommand `all`, it can renew all of them, as shown below:
164164

165-
- The Kubernetes certificates normally reach their expiration date after one year.
165+
```shell
166+
kubeadm certs renew all
167+
```
166168

167-
- `--csr-only` can be used to renew certificates with an external CA by generating certificate
168-
signing requests (without actually renewing certificates in place); see next paragraph for more
169-
information.
169+
{{< note >}}
170+
Clusters built with kubeadm often copy the `admin.conf` certificate into `$HOME/.kube/config`, as instructed in [Creating a cluster with kubeadm](https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/). On such a system, to update the contents of `$HOME/.kube/config` after renewing the `admin.conf` you must run the following commands:
170171

171-
- It's also possible to renew a single certificate instead of all.
172+
```shell
173+
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
174+
sudo chown $(id -u):$(id -g) $HOME/.kube/config
175+
```
176+
{{< /note >}}
172177

173178
## Renew certificates with the Kubernetes certificates API
174179

0 commit comments

Comments
 (0)