# kubeadm certs

kubeadm certskubeadm certs provides utilities for managing certificates. For more details on how these commands can be used, see Certificate Management with kubeadm.kubeadm certsA collection of operations for operating Kubernetes certificates.SynopsisCommands related to handling Kubernetes certificateskubeadm certs [flags] Options-h, --helphelp for certsOptions inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.kubeadm certs renewYou can renew all Kubernetes certificates using the all subcommand or renew them selectively. For more details see Manual certificate renewal.SynopsisRenew certificates for a Kubernetes clusterkubeadm certs renew [flags] Options-h, --helphelp for renewOptions inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.Renew all available certificatesSynopsisRenew all known certificates necessary to run the control plane. Renewals are run unconditionally, regardless of expiration date. Renewals can also be run individually for more control.kubeadm certs renew all [flags] Options--cert-dir string Default: "/etc/kubernetes/pki"The path where to save the certificates--config stringPath to a kubeadm configuration file.-h, --helphelp for all--kubeconfig string Default: "/etc/kubernetes/admin.conf"The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.Options inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.SynopsisRenew the certificate embedded in the kubeconfig file for the admin to use and for kubeadm itself.Renewals run unconditionally, regardless of certificate expiration date; extra attributes such as SANs will be based on the existing file/certificates, there is no need to resupply them.Renewal by default tries to use the certificate authority in the local PKI managed by kubeadm; as alternative it is possible to use K8s certificate API for certificate renewal, or as a last option, to generate a CSR request.After renewal, in order to make changes effective, is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.kubeadm certs renew admin.conf [flags] Options--cert-dir string Default: "/etc/kubernetes/pki"The path where to save the certificates--config stringPath to a kubeadm configuration file.-h, --helphelp for admin.conf--kubeconfig string Default: "/etc/kubernetes/admin.conf"The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.Options inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.SynopsisRenew the certificate the apiserver uses to access etcd.Renewals run unconditionally, regardless of certificate expiration date; extra attributes such as SANs will be based on the existing file/certificates, there is no need to resupply them.Renewal by default tries to use the certificate authority in the local PKI managed by kubeadm; as alternative it is possible to use K8s certificate API for certificate renewal, or as a last option, to generate a CSR request.After renewal, in order to make changes effective, is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.kubeadm certs renew apiserver-etcd-client [flags] Options--cert-dir string Default: "/etc/kubernetes/pki"The path where to save the certificates--config stringPath to a kubeadm configuration file.-h, --helphelp for apiserver-etcd-client--kubeconfig string Default: "/etc/kubernetes/admin.conf"The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.Options inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.SynopsisRenew the certificate for the API server to connect to kubelet.Renewals run unconditionally, regardless of certificate expiration date; extra attributes such as SANs will be based on the existing file/certificates, there is no need to resupply them.Renewal by default tries to use the certificate authority in the local PKI managed by kubeadm; as alternative it is possible to use K8s certificate API for certificate renewal, or as a last option, to generate a CSR request.After renewal, in order to make changes effective, is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.kubeadm certs renew apiserver-kubelet-client [flags] Options--cert-dir string Default: "/etc/kubernetes/pki"The path where to save the certificates--config stringPath to a kubeadm configuration file.-h, --helphelp for apiserver-kubelet-client--kubeconfig string Default: "/etc/kubernetes/admin.conf"The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.Options inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.SynopsisRenew the certificate for serving the Kubernetes API.Renewals run unconditionally, regardless of certificate expiration date; extra attributes such as SANs will be based on the existing file/certificates, there is no need to resupply them.Renewal by default tries to use the certificate authority in the local PKI managed by kubeadm; as alternative it is possible to use K8s certificate API for certificate renewal, or as a last option, to generate a CSR request.After renewal, in order to make changes effective, is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.kubeadm certs renew apiserver [flags] Options--cert-dir string Default: "/etc/kubernetes/pki"The path where to save the certificates--config stringPath to a kubeadm configuration file.-h, --helphelp for apiserver--kubeconfig string Default: "/etc/kubernetes/admin.conf"The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.Options inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.SynopsisRenew the certificate embedded in the kubeconfig file for the controller manager to use.Renewals run unconditionally, regardless of certificate expiration date; extra attributes such as SANs will be based on the existing file/certificates, there is no need to resupply them.Renewal by default tries to use the certificate authority in the local PKI managed by kubeadm; as alternative it is possible to use K8s certificate API for certificate renewal, or as a last option, to generate a CSR request.After renewal, in order to make changes effective, is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.kubeadm certs renew controller-manager.conf [flags] Options--cert-dir string Default: "/etc/kubernetes/pki"The path where to save the certificates--config stringPath to a kubeadm configuration file.-h, --helphelp for controller-manager.conf--kubeconfig string Default: "/etc/kubernetes/admin.conf"The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.Options inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.SynopsisRenew the certificate for liveness probes to healthcheck etcd.Renewals run unconditionally, regardless of certificate expiration date; extra attributes such as SANs will be based on the existing file/certificates, there is no need to resupply them.Renewal by default tries to use the certificate authority in the local PKI managed by kubeadm; as alternative it is possible to use K8s certificate API for certificate renewal, or as a last option, to generate a CSR request.After renewal, in order to make changes effective, is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.kubeadm certs renew etcd-healthcheck-client [flags] Options--cert-dir string Default: "/etc/kubernetes/pki"The path where to save the certificates--config stringPath to a kubeadm configuration file.-h, --helphelp for etcd-healthcheck-client--kubeconfig string Default: "/etc/kubernetes/admin.conf"The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.Options inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.SynopsisRenew the certificate for etcd nodes to communicate with each other.Renewals run unconditionally, regardless of certificate expiration date; extra attributes such as SANs will be based on the existing file/certificates, there is no need to resupply them.Renewal by default tries to use the certificate authority in the local PKI managed by kubeadm; as alternative it is possible to use K8s certificate API for certificate renewal, or as a last option, to generate a CSR request.After renewal, in order to make changes effective, is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.kubeadm certs renew etcd-peer [flags] Options--cert-dir string Default: "/etc/kubernetes/pki"The path where to save the certificates--config stringPath to a kubeadm configuration file.-h, --helphelp for etcd-peer--kubeconfig string Default: "/etc/kubernetes/admin.conf"The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.Options inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.SynopsisRenew the certificate for serving etcd.Renewals run unconditionally, regardless of certificate expiration date; extra attributes such as SANs will be based on the existing file/certificates, there is no need to resupply them.Renewal by default tries to use the certificate authority in the local PKI managed by kubeadm; as alternative it is possible to use K8s certificate API for certificate renewal, or as a last option, to generate a CSR request.After renewal, in order to make changes effective, is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.kubeadm certs renew etcd-server [flags] Options--cert-dir string Default: "/etc/kubernetes/pki"The path where to save the certificates--config stringPath to a kubeadm configuration file.-h, --helphelp for etcd-server--kubeconfig string Default: "/etc/kubernetes/admin.conf"The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.Options inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.SynopsisRenew the certificate for the front proxy client.Renewals run unconditionally, regardless of certificate expiration date; extra attributes such as SANs will be based on the existing file/certificates, there is no need to resupply them.Renewal by default tries to use the certificate authority in the local PKI managed by kubeadm; as alternative it is possible to use K8s certificate API for certificate renewal, or as a last option, to generate a CSR request.After renewal, in order to make changes effective, is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.kubeadm certs renew front-proxy-client [flags] Options--cert-dir string Default: "/etc/kubernetes/pki"The path where to save the certificates--config stringPath to a kubeadm configuration file.-h, --helphelp for front-proxy-client--kubeconfig string Default: "/etc/kubernetes/admin.conf"The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.Options inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.SynopsisRenew the certificate embedded in the kubeconfig file for the scheduler manager to use.Renewals run unconditionally, regardless of certificate expiration date; extra attributes such as SANs will be based on the existing file/certificates, there is no need to resupply them.Renewal by default tries to use the certificate authority in the local PKI managed by kubeadm; as alternative it is possible to use K8s certificate API for certificate renewal, or as a last option, to generate a CSR request.After renewal, in order to make changes effective, is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.kubeadm certs renew scheduler.conf [flags] Options--cert-dir string Default: "/etc/kubernetes/pki"The path where to save the certificates--config stringPath to a kubeadm configuration file.-h, --helphelp for scheduler.conf--kubeconfig string Default: "/etc/kubernetes/admin.conf"The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.Options inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.SynopsisRenew the certificate embedded in the kubeconfig file for the super-admin.Renewals run unconditionally, regardless of certificate expiration date; extra attributes such as SANs will be based on the existing file/certificates, there is no need to resupply them.Renewal by default tries to use the certificate authority in the local PKI managed by kubeadm; as alternative it is possible to use K8s certificate API for certificate renewal, or as a last option, to generate a CSR request.After renewal, in order to make changes effective, is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.kubeadm certs renew super-admin.conf [flags] Options--cert-dir string Default: "/etc/kubernetes/pki"The path where to save the certificates--config stringPath to a kubeadm configuration file.-h, --helphelp for super-admin.conf--kubeconfig string Default: "/etc/kubernetes/admin.conf"The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.Options inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.kubeadm certs certificate-keyThis command can be used to generate a new control-plane certificate key. The key can be passed as --certificate-key to kubeadm init and kubeadm join to enable the automatic copy of certificates when joining additional control-plane nodes.Generate certificate keysSynopsisThis command will print out a secure randomly-generated certificate key that can be used with the "init" command.You can also use "kubeadm init --upload-certs" without specifying a certificate key and it will generate and print one for you.kubeadm certs certificate-key [flags] Options-h, --helphelp for certificate-keyOptions inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.kubeadm certs check-expirationThis command checks expiration for the certificates in the local PKI managed by kubeadm. For more details see Check certificate expiration.Check certificates expiration for a Kubernetes clusterSynopsisChecks expiration for the certificates in the local PKI managed by kubeadm.kubeadm certs check-expiration [flags] Options--allow-missing-template-keys Default: trueIf true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.--cert-dir string Default: "/etc/kubernetes/pki"The path where to save the certificates--config stringPath to a kubeadm configuration file.-h, --helphelp for check-expiration--kubeconfig string Default: "/etc/kubernetes/admin.conf"The kubeconfig file to use when talking to the cluster. If the flag is not set, a set of standard locations can be searched for an existing kubeconfig file.-o, --output string Default: "text"Output format. One of: text|json|yaml|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.--show-managed-fieldsIf true, keep the managedFields when printing objects in JSON or YAML format.Options inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.kubeadm certs generate-csrThis command can be used to generate keys and CSRs for all control-plane certificates and kubeconfig files. The user can then sign the CSRs with a CA of their choice. To read more information on how to use the command see Signing certificate signing requests (CSR) generated by kubeadm.Generate keys and certificate signing requestsSynopsisGenerates keys and certificate signing requests (CSRs) for all the certificates required to run the control plane. This command also generates partial kubeconfig files with private key data in the "users > user > client-key-data" field, and for each kubeconfig file an accompanying ".csr" file is created.This command is designed for use in Kubeadm External CA Mode. It generates CSRs which you can then submit to your external certificate authority for signing.The PEM encoded signed certificates should then be saved alongside the key files, using ".crt" as the file extension, or in the case of kubeconfig files, the PEM encoded signed certificate should be base64 encoded and added to the kubeconfig file in the "users > user > client-certificate-data" field.kubeadm certs generate-csr [flags] Examples # The following command will generate keys and CSRs for all control-plane certificates and kubeconfig files: kubeadm certs generate-csr --kubeconfig-dir /tmp/etc-k8s --cert-dir /tmp/etc-k8s/pki Options--cert-dir stringThe path where to save the certificates--config stringPath to a kubeadm configuration file.-h, --helphelp for generate-csr--kubeconfig-dir string Default: "/etc/kubernetes"The path where to save the kubeconfig file.Options inherited from parent commands--rootfs stringThe path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.What's nextkubeadm init to bootstrap a Kubernetes control-plane nodekubeadm join to connect a node to the clusterkubeadm reset to revert any changes made to this host by kubeadm init or kubeadm join