Merge pull request #41939 from JayBeale/patch-3

Replace outdated instructions and add a tip in kubeadm-certs.md
pull/42130/head
Kubernetes Prow Robot 2023-07-21 10:44:08 -07:00 committed by GitHub
commit ad6205d494
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 7 deletions

View File

@ -136,7 +136,7 @@ command. In that case, you should explicitly set `--certificate-renewal=true`.
## Manual certificate renewal
You can renew your certificates manually at any time with the `kubeadm certs renew` command.
You can renew your certificates manually at any time with the `kubeadm certs renew` command, with the appropriate command line options.
This command performs the renewal using CA (or front-proxy-CA) certificate and key stored in `/etc/kubernetes/pki`.
@ -160,15 +160,20 @@ Name, Organization, SAN, etc.) instead of the `kubeadm-config` ConfigMap. It is
to keep them both in sync.
{{< /note >}}
`kubeadm certs renew` provides the following options:
`kubeadm certs renew` can renew any specific certificate or, with the subcommand `all`, it can renew all of them, as shown below:
- The Kubernetes certificates normally reach their expiration date after one year.
```shell
kubeadm certs renew all
```
- `--csr-only` can be used to renew certificates with an external CA by generating certificate
signing requests (without actually renewing certificates in place); see next paragraph for more
information.
{{< note >}}
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:
- It's also possible to renew a single certificate instead of all.
```shell
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
```
{{< /note >}}
## Renew certificates with the Kubernetes certificates API