# kubeadm certs

LLMS index: [llms.txt](/llms.txt)

---

<!--
`kubeadm certs` provides utilities for managing certificates.
For more details on how these commands can be used, see
[Certificate Management with kubeadm](/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/).
-->
`kubeadm certs` 提供管理证书的工具。关于如何使用这些命令的细节，
可参见[使用 kubeadm 管理证书](/zh-cn/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/)。

## kubeadm certs {#cmd-certs}

<!--
A collection of operations for operating Kubernetes certificates.
-->
用来操作 Kubernetes 证书的一组命令。

<ul class="nav nav-tabs" id="tabs-tab-certs" role="tablist"><li class="nav-item"><a data-bs-toggle="tab" class="nav-link active" href="#tabs-tab-certs-0" role="tab" aria-controls="tabs-tab-certs-0" aria-selected="true">概览</a></li>
	  </ul>

<div class="tab-content" id="tabs-tab-certs-content"><div class="tab-body tab-pane fadeshow active"
        id="tabs-tab-certs-0" role="tabpanel" aria-labelledby="tabs-tab-certs-0-tab" tabindex="tab-certs"><!--
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!--
Commands related to handling Kubernetes certificates
-->
<p>处理 Kubernetes 证书相关的命令。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubeadm certs <span class="o">[</span>flags<span class="o">]</span>
</span></span></code></pre></div><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for certs
-->
certs 操作的帮助命令。
</p>
</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
[实验] 到'真实'主机根文件系统的路径。
</p></td>
</tr>
</tbody>
</table>
</div></div>

## kubeadm certs renew {#cmd-certs-renew}

<!--
You can renew all Kubernetes certificates using the `all` subcommand or renew them selectively.
For more details see [Manual certificate renewal](/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/#manual-certificate-renewal).
-->
你可以使用 `all` 子命令来续订所有 Kubernetes 证书，也可以选择性地续订部分证书。更多的相关细节，
可参见[手动续订证书](/zh-cn/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/#manual-certificate-renewal)。

<ul class="nav nav-tabs" id="tabs-tab-certs-renew" role="tablist"><li class="nav-item"><a data-bs-toggle="tab" class="nav-link active" href="#tabs-tab-certs-renew-0" role="tab" aria-controls="tabs-tab-certs-renew-0" aria-selected="true">renew</a></li>
	  
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-tab-certs-renew-1" role="tab" aria-controls="tabs-tab-certs-renew-1">all</a></li>
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-tab-certs-renew-2" role="tab" aria-controls="tabs-tab-certs-renew-2">admin.conf</a></li>
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-tab-certs-renew-3" role="tab" aria-controls="tabs-tab-certs-renew-3">apiserver-etcd-client</a></li>
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-tab-certs-renew-4" role="tab" aria-controls="tabs-tab-certs-renew-4">apiserver-kubelet-client</a></li>
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-tab-certs-renew-5" role="tab" aria-controls="tabs-tab-certs-renew-5">apiserver</a></li>
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-tab-certs-renew-6" role="tab" aria-controls="tabs-tab-certs-renew-6">controller-manager.conf</a></li>
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-tab-certs-renew-7" role="tab" aria-controls="tabs-tab-certs-renew-7">etcd-healthcheck-client</a></li>
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-tab-certs-renew-8" role="tab" aria-controls="tabs-tab-certs-renew-8">etcd-peer</a></li>
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-tab-certs-renew-9" role="tab" aria-controls="tabs-tab-certs-renew-9">etcd-server</a></li>
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-tab-certs-renew-10" role="tab" aria-controls="tabs-tab-certs-renew-10">front-proxy-client</a></li>
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-tab-certs-renew-11" role="tab" aria-controls="tabs-tab-certs-renew-11">scheduler.conf</a></li>
		<li class="nav-item"><a data-bs-toggle="tab" class="nav-link" href="#tabs-tab-certs-renew-12" role="tab" aria-controls="tabs-tab-certs-renew-12">super-admin.conf</a></li></ul>

<div class="tab-content" id="tabs-tab-certs-renew-content"><div class="tab-body tab-pane fadeshow active"
        id="tabs-tab-certs-renew-0" role="tabpanel" aria-labelledby="tabs-tab-certs-renew-0-tab" tabindex="tab-certs-renew"><!--
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!--
Renew certificates for a Kubernetes cluster
-->
<p>为 Kubernetes 集群更新证书</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubeadm certs renew <span class="o">[</span>flags<span class="o">]</span>
</span></span></code></pre></div><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
   <table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for renew
-->
renew 操作的帮助命令
</p>
</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
   <table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
[实验] 到 '真实' 主机根文件系统的路径。
</p>
</td>
</tr>
</tbody>
</table>
</div><div class="tab-body tab-pane fade"
        id="tabs-tab-certs-renew-1" role="tabpanel" aria-labelledby="tabs-tab-certs-renew-1-tab" tabindex="tab-certs-renew"><!-- 
Renew all available certificates 
-->
<p>续订所有可用证书。</p>
<!--
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!--
Renew 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.
-->
<p>续订运行控制平面所需的所有已知证书。续订是无条件进行的，与到期日期无关。续订也可以单独运行以进行更多控制。</p>
<pre tabindex="0"><code>kubeadm certs renew all [flags]
</code></pre><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
   <table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">
<!--
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/pki"
-->
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/pki"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<!--
<p>The path where to save and store the certificates.</p>
-->
<p>存储证书的路径。</p>
</td>
</tr>
<tr>
<td colspan="2">--config string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<!--
<p>Path to a kubeadm configuration file.</p>
-->
<p>kubeadm 配置文件的路径。</p>
</td>
</tr>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<!--
<p>help for all</p>
-->
<p>all 操作的帮助命令。</p>
</td>
</tr>
<tr>
<td colspan="2">
<!--
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/admin.conf"
-->
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/admin.conf"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<!--
<p>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.</p>
-->
<p>与集群通信时使用的 kubeconfig 文件。
如果未设置该参数，则可以在一组标准位置中搜索现有的 kubeconfig 文件。</p>
</td>
</tr>
<tr>
<td colspan="2">--use-api</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<!--
Use the Kubernetes certificate API to renew certificates
-->
使用 Kubernetes 证书 API 续订证书。
</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
   <table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<!--
<p>[EXPERIMENTAL] The path to the 'real' host root filesystem.</p>
-->
<p>[实验] 到 '真实' 主机根文件系统的路径。</p>
</td>
</tr>
</tbody>
</table>
</div><div class="tab-body tab-pane fade"
        id="tabs-tab-certs-renew-2" role="tabpanel" aria-labelledby="tabs-tab-certs-renew-2-tab" tabindex="tab-certs-renew"><!--
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!--
Renew the certificate embedded in the kubeconfig file for the admin to use and for kubeadm itself.
-->
<p>续订 kubeconfig 文件中嵌入的证书，供管理员和 kubeadm 自身使用。</p>
<!--
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.
-->
<p>无论证书的到期日期如何，续订都是无条件进行的；SAN
等额外属性将基于现有文件/证书，因此无需重新提供它们。</p>
<!--
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.
-->
<p>默认情况下，续订会尝试使用由 kubeadm 管理的本地 PKI 中的证书机构；
作为替代方案，也可以使用 K8s 证书 API 进行证书续订，
或者（作为最后一种选择）生成 CSR 请求。</p>
<!--
After renewal, in order to make changes effective, is is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.
-->
<p>续订后，为了使更改生效，需要重新启动控制平面组件，并最终重新分发更新的证书，
以防证书文件在其他地方使用。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubeadm certs renew admin.conf <span class="o">[</span>flags<span class="o">]</span>
</span></span></code></pre></div><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">
<!--
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/pki"
-->
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/pki"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The path where to save the certificates
-->
保存证书的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">--config string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Path to a kubeadm configuration file.
-->
到 kubeadm 配置文件的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for admin.conf
-->
admin.conf 操作的帮助命令。
</p>
</td>
</tr>
<tr>
<td colspan="2">--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/admin.conf"</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
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.
-->
与集群通信时使用的 kubeconfig 文件。
如果未设置该参数，则可以在一组标准位置中搜索现有的 kubeconfig 文件。
</p>
</td>
</tr>
<tr>
<td colspan="2">--use-api</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Use the Kubernetes certificate API to renew certificates
-->
使用 Kubernetes 证书 API 续订证书。
</p>
</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
[实验] 到 '真实' 主机根文件系统的路径。
</p>
</td>
</tr>
</tbody>
</table>
</div><div class="tab-body tab-pane fade"
        id="tabs-tab-certs-renew-3" role="tabpanel" aria-labelledby="tabs-tab-certs-renew-3-tab" tabindex="tab-certs-renew"><!-- 
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!--
Renew the certificate the apiserver uses to access etcd.
-->
<p>续订 apiserver 用于访问 etcd 的证书。</p>
<!--
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.
-->
<p>无论证书的到期日期如何，续订都会无条件地进行；SAN 等额外属性将基于现有文件/证书，
因此无需重新提供它们。</p>
<!--
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.
-->
<p>默认情况下，续订尝试使用在 kubeadm 所管理的本地 PKI 中的证书颁发机构；
作为替代方案，可以使用 K8s 证书 API 进行证书更新，或者（作为最后一个选项）生成
CSR 请求。</p>
<!--
After renewal, in order to make changes effective, is is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.
-->
<p>续订后，为了使更改生效，需要重新启动控制平面组件，并最终重新分发更新的证书，
以防文件在其他地方使用。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubeadm certs renew apiserver-etcd-client <span class="o">[</span>flags<span class="o">]</span>
</span></span></code></pre></div><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">
<!--
cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/pki"
-->
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/pki"
</td>
</tr>
<tr>
<td></td>
<td style="line-height: 130%; word-wrap: break-word;">
<p>
<!-- 
The path where to save and store the certificates.
-->
存储证书的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">--config string</td>
</tr>
<tr>
<td></td>
<td style="line-height: 130%; word-wrap: break-word;">
<p>
<!-- 
Path to a kubeadm configuration file. 
-->
kubeadm 配置文件的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td></td>
<td style="line-height: 130%; word-wrap: break-word;">
<p>
<!-- 
help for apiserver-etcd-client
-->
apiserver-etcd-client 操作的帮助命令。
</p>
</td>
</tr>
<tr>
<td colspan="2">
<!--
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/admin.conf"
-->
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/admin.conf"
</td>
</tr>
<tr>
<td></td>
<td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
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.
-->
与集群通信时使用的 kubeconfig 文件。
如果未设置该参数，则可以在一组标准位置中搜索现有的 kubeconfig 文件。
</p>
</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td></td>
<td style="line-height: 130%; word-wrap: break-word;">
<p>
<!-- 
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
[实验] 到 '真实' 主机根文件系统的路径。
</p>
</td>
</tr>
</tbody>
</table>
</div><div class="tab-body tab-pane fade"
        id="tabs-tab-certs-renew-4" role="tabpanel" aria-labelledby="tabs-tab-certs-renew-4-tab" tabindex="tab-certs-renew"><!-- 
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!--
Renew the certificate for the API server to connect to kubelet.
-->
<p>续订 apiserver 用于连接 kubelet 的证书。</p>
<!--
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.
-->
<p>无论证书的到期日期如何，续订都会无条件地进行；SAN 等额外属性将基于现有文件/证书，
因此无需重新提供它们。</p>
<!--
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.
-->
<p>默认情况下，续订尝试使用位于 kubeadm 所管理的本地 PKI 中的证书颁发机构；作为替代方案，
也可能调用 K8s 证书 API 进行证书更新；亦或者，作为最后一个选择，生成 CSR 请求。</p>
<!--
After renewal, in order to make changes effective, is is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.
-->
<p>续订后，为了使更改生效，需要重新启动控制平面组件，并最终重新分发更新的证书，
以防文件在其他地方使用。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubeadm certs renew apiserver-kubelet-client <span class="o">[</span>flags<span class="o">]</span>
</span></span></code></pre></div><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">
<!--
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/pki"
-->
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/pki"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The path where to save and store the certificates.
-->
存储证书的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">--config string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Path to a kubeadm configuration file.
-->
kubeadm 配置文件的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for apiserver-kubelet-client
-->
apiserver-kubelet-client 操作的帮助命令。
</p>
</td>
</tr>
<tr>
<td colspan="2">
<!--
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/admin.conf"
-->
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/admin.conf"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
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.
-->
与集群通信时使用的 kubeconfig 文件。
如果未设置该参数，则可以在一组标准位置中搜索现有的 kubeconfig 文件。
</p>
</td>
</tr>
<tr>
<td colspan="2">--use-api</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Use the Kubernetes certificate API to renew certificates
-->
使用 Kubernetes 证书 API 续订证书。
</p>
</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
[实验] 到 '真实' 主机根文件系统的路径。
</p>
</td>
</tr>
</tbody>
</table>
</div><div class="tab-body tab-pane fade"
        id="tabs-tab-certs-renew-5" role="tabpanel" aria-labelledby="tabs-tab-certs-renew-5-tab" tabindex="tab-certs-renew"><!--
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!--
Renew the certificate for serving the Kubernetes API.
-->
<p>续订用于提供 Kubernetes API 的证书。</p>
<!--
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.
-->
<p>无论证书的到期日期如何，续订都会无条件地进行；SAN
等额外属性将基于现有文件/证书，因此无需重新提供它们。</p>
<!--
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.
-->
<p>默认情况下，续订尝试在 kubeadm 管理的本地 PKI 中使用证书颁发机构；
作为替代方案，可以使用 K8s 证书 API 进行证书更新，
或者作为最后一个选择来生成 CSR 请求。</p>
<!--
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.
-->
<p>续订后，为了使更改生效，需要重新启动控制平面组件，并最终重新分发更新的证书，
以防文件在其他地方使用。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubeadm certs renew apiserver <span class="o">[</span>flags<span class="o">]</span>
</span></span></code></pre></div><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">
<!--
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/pki"
-->
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/pki"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The path where to save the certificates.
-->
保存证书的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">--config string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Path to a kubeadm configuration file.
-->
kubeadm 配置文件的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for apiserver
-->
apiserver 子操作的帮助命令。
</p>
</td>
</tr>
<tr>
<td colspan="2">
<!--
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/admin.conf"
-->
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/admin.conf"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
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.
-->
与集群通信时使用的 kubeconfig 文件。
如果未设置该参数，则可以在一组标准位置中搜索现有的 kubeconfig 文件。
</p>
</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
[实验] 到 '真实' 主机根文件系统的路径。
</p>
</td>
</tr>
</tbody>
</table>
</div><div class="tab-body tab-pane fade"
        id="tabs-tab-certs-renew-6" role="tabpanel" aria-labelledby="tabs-tab-certs-renew-6-tab" tabindex="tab-certs-renew"><!--
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!--
Renew the certificate embedded in the kubeconfig file for the controller manager to use.
-->
<p>续订 kubeconfig 文件中嵌入的证书，以供控制器管理器（Controller Manager）使用。</p>
<!--
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.
-->
<p>续订无条件地进行，与证书的到期日期无关；SAN 等额外属性将基于现有的文件/证书，
因此无需重新提供它们。</p>
<!--
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.
-->
<p>默认情况下，续订会尝试使用 kubeadm 管理的本地 PKI 中的证书颁发机构；作为替代方案，
可以使用 K8s 证书 API 进行证书续订；亦或者，作为最后一种选择，生成 CSR 请求。</p>
<!--
After renewal, in order to make changes effective, is is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.
-->
<p>续订后，为了使更改生效，需要重新启动控制平面组件，并最终重新分发更新的证书，
以防文件在其他地方使用。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubeadm certs renew controller-manager.conf <span class="o">[</span>flags<span class="o">]</span>
</span></span></code></pre></div><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">
<!--
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/pki"
-->
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/pki"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The path where to save the certificates.
-->
保存证书的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">--config string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Path to a kubeadm configuration file.
-->
kubeadm 配置文件的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for controller-manager.conf
-->
controller-manager.conf 操作的帮助命令。
</p>
</td>
</tr>
<tr>
<td colspan="2">
<!--
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/admin.conf"
-->
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/admin.conf"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
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.
-->
与集群通信时使用的 kubeconfig 文件。
如果未设置该参数，则可以在一组标准位置中搜索现有的 kubeconfig 文件。
</p>
</td>
</tr>
<tr>
<td colspan="2">--use-api</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Use the Kubernetes certificate API to renew certificates
-->
使用 Kubernetes 证书 API 续订证书。
<p>
</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
[实验] 到 '真实' 主机根文件系统的路径。
</p>
</td>
</tr>
</tbody>
</table>
</div><div class="tab-body tab-pane fade"
        id="tabs-tab-certs-renew-7" role="tabpanel" aria-labelledby="tabs-tab-certs-renew-7-tab" tabindex="tab-certs-renew"><!--
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!--
Renew the certificate for liveness probes to healthcheck etcd.
-->
<p>续订存活态探针的证书，用于对 etcd 执行健康检查。</p>
<!--
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.
-->
<p>无论证书的到期日期如何，续订都是无条件进行的；SAN
等额外属性将基于现有文件/证书，因此无需重新提供它们。</p>
<!--
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.
-->
<p>默认情况下，续订会尝试使用由 kubeadm 管理的本地 PKI 中的证书机构；
作为替代方案，也可以使用 K8s certificate API 进行证书续订，
或者（作为最后一种选择）生成 CSR 请求。</p>
<!--
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.
-->
<p>续订后，为了使更改生效，需要重新启动控制平面组件，并最终重新分发更新的证书，
以防证书文件在其他地方使用。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubeadm certs renew etcd-healthcheck-client <span class="o">[</span>flags<span class="o">]</span>
</span></span></code></pre></div><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">
<!--
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/pki"
-->
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/pki"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The path where to save the certificates.
-->
保存证书的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">--config string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Path to a kubeadm configuration file.
-->
kubeadm 配置文件的路径。
</p>
</td>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for etcd-healthcheck-client
-->
etcd-healthcheck-client 操作的帮助命令。
</p>
</td>
</tr>
<tr>
<td colspan="2">
<!--
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/admin.conf"
-->
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/admin.conf"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
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.
-->
与集群通信时使用的 kubeconfig 文件。
如果未设置该参数，则可以在一组标准位置中搜索现有的 kubeconfig 文件。
</p>
</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
[实验] 到 '真实' 主机根文件系统的路径。
</p>
</td>
</tr>
</tbody>
</table>
</div><div class="tab-body tab-pane fade"
        id="tabs-tab-certs-renew-8" role="tabpanel" aria-labelledby="tabs-tab-certs-renew-8-tab" tabindex="tab-certs-renew"><!--
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!--
Renew the certificate for etcd nodes to communicate with each other.
-->
<p>续订 etcd 节点间用来相互通信的证书。</p>
<!--
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.
-->
<p>无论证书的到期日期如何，续订都是无条件进行的；SAN
等额外属性将基于现有文件/证书，因此无需重新提供它们。</p>
<!--
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.
-->
<p>默认情况下，续订会尝试使用由 kubeadm 管理的本地 PKI 中的证书机构；
作为替代方案，也可以使用 K8s certificate API 进行证书续订，
或者（作为最后一种选择）生成 CSR 请求。</p>
<!--
After renewal, in order to make changes effective, is is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.
-->
<p>续订后，为了使更改生效，需要重新启动控制平面组件，并最终重新分发续订的证书，
以防证书文件在其他地方使用。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubeadm certs renew etcd-peer <span class="o">[</span>flags<span class="o">]</span>
</span></span></code></pre></div><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">
<!--
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/pki"
-->
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/pki"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The path where to save the certificates.
-->
保存证书的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">--config string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Path to a kubeadm configuration file.
-->
kubeadm 配置文件的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for etcd-peer
-->
etcd-peer 操作的帮助命令。
</p>
</td>
</tr>
<tr>
<td colspan="2">
<!--
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/admin.conf"
-->
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/admin.conf"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
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.
-->
与集群通信时使用的 kubeconfig 文件。
如果未设置该参数，则可以在一组标准位置中搜索现有的 kubeconfig 文件。
</p>
</td>
</tr>
<tr>
<td colspan="2">--use-api</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
[实验] 到 '真实' 主机根文件系统的路径。
</p>
</td>
</tr>
</tbody>
</table>
</div><div class="tab-body tab-pane fade"
        id="tabs-tab-certs-renew-9" role="tabpanel" aria-labelledby="tabs-tab-certs-renew-9-tab" tabindex="tab-certs-renew"><!--
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!--
Renew the certificate for serving etcd.
-->
<p>续订用于提供 etcd 服务的证书。</p>
<!--
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.
-->
<p>续订无条件地进行，与证书的到期日期无关；SAN
等额外属性将基于现有的文件/证书，因此无需重新提供它们。</p>
<!--
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.
-->
<p>默认情况下，续订会尝试在 kubeadm 管理的本地 PKI 中使用证书颁发机构；
作为替代方案，可以使用 K8s 证书 API 进行证书续订，
或者作为最后一种选择来生成 CSR 请求。</p>
<!--
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.
-->
<p>续订后，为了使更改生效，需要重新启动控制平面组件，并最终重新分发续订的证书，
以防文件在其他地方使用。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubeadm certs renew etcd-server <span class="o">[</span>flags<span class="o">]</span>
</span></span></code></pre></div><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">
<!--
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/pki"
-->
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/pki"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The path where to save the certificates.
-->
保存证书的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">--config string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Path to a kubeadm configuration file.
-->
kubeadm 配置文件的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for etcd-server
-->
etcd-server 操作的帮助命令。
</p>
</td>
</tr>
<tr>
<td colspan="2">
<!--
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/admin.conf"
-->
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/admin.conf"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
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.
-->
与集群通信时使用的 kubeconfig 文件。
如果未设置该参数，则可以在一组标准位置中搜索现有的 kubeconfig 文件。
</p>
</td>
</tr>
<tr>
<td colspan="2">--use-api</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
[实验] 到 '真实' 主机根文件系统的路径。
</p>
</td>
</tr>
</tbody>
</table>
</div><div class="tab-body tab-pane fade"
        id="tabs-tab-certs-renew-10" role="tabpanel" aria-labelledby="tabs-tab-certs-renew-10-tab" tabindex="tab-certs-renew"><!--
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!--
Renew the certificate for the front proxy client.
-->
<p>为前端代理客户端续订证书。</p>
<!--
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.
-->
<p>无论证书的到期日期如何，续订都会无条件地进行；SAN 等额外属性将基于现有文件/证书，
因此无需重新提供它们。</p>
<!--
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.
-->
<p>默认情况下，续订尝试使用位于 kubeadm 所管理的本地 PKI 中的证书颁发机构；作为替代方案，
也可以使用 K8s certificate API 进行证书续订；亦或者，作为最后一种方案，生成 CSR 请求。</p>
<!--
After renewal, in order to make changes effective, is is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.
-->
<p>续订后，为了使更改生效，需要重新启动控制平面组件，并最终重新分发更新的证书，
以防文件在其他地方使用。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubeadm certs renew front-proxy-client <span class="o">[</span>flags<span class="o">]</span>
</span></span></code></pre></div><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<!-- td colspan="2">--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/pki"</td -->
<td colspan="2">--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/pki"</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The path where to save the certificates
-->
存储证书的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">--config string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Path to a kubeadm configuration file.
-->
kubeadm 配置文件的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for front-proxy-client
-->
front-proxy-client 操作的帮助命令。
</p>
</td>
</tr>
<tr>
<td colspan="2">
<!--
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/admin.conf"
-->
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/admin.conf"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
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.
-->
与集群通信时使用的 kubeconfig 文件。
如果未设置该参数，则可以在一组标准位置中搜索现有的 kubeconfig 文件。
</p>
</td>
</tr>
<tr>
<td colspan="2">--use-api</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Use the Kubernetes certificate API to renew certificates
-->
使用 Kubernetes certificate API 续订证书。
</p>
</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
[实验] 到 '真实' 主机根文件系统的路径。
</p>
</td>
</tr>
</tbody>
</table>
</div><div class="tab-body tab-pane fade"
        id="tabs-tab-certs-renew-11" role="tabpanel" aria-labelledby="tabs-tab-certs-renew-11-tab" tabindex="tab-certs-renew"><!--
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!--
Renew the certificate embedded in the kubeconfig file for the scheduler manager to use.
-->
<p>续订 kubeconfig 文件中嵌入的证书，以供调度管理器使用。</p>
<!--
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.
-->
<p>续订无条件地进行，与证书的到期日期无关；SAN 等额外属性将基于现有的文件/证书，
因此无需重新提供它们。</p>
<!--
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.
-->
<p>默认情况下，续订会尝试使用在 kubeadm 所管理的本地 PKI 中的证书颁发机构；作为替代方案，
也可以使用 K8s certificate API 进行证书续订；亦或者，作为最后一种选择，生成 CSR 请求。</p>
<!--
After renewal, in order to make changes effective, is is required to restart control-plane components and eventually re-distribute the renewed certificate in case the file is used elsewhere.
-->
<p>续订后，为了使更改生效，需要重新启动控制平面组件，并最终重新分发更新的证书，
以防文件在其他地方使用。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubeadm certs renew scheduler.conf <span class="o">[</span>flags<span class="o">]</span>
</span></span></code></pre></div><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">
<!--
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/pki"
-->
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/pki"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The path where to save the certificates.
-->
保存证书的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">--config string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Path to a kubeadm configuration file.</p>
-->
kubeadm 配置文件的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for scheduler.conf
-->
scheduler.conf 操作的帮助命令。
</p>
</td>
</tr>
<tr>
<td colspan="2">
<!--
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/admin.conf"
-->
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/admin.conf"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
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.
-->
与集群通信时使用的 kubeconfig 文件。
如果未设置该参数，则可以在一组标准位置中搜索现有的 kubeconfig 文件。
</p>
</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
[实验] 到 '真实' 主机根文件系统的路径。
</p>
</td>
</tr>
</tbody>
</table>
</div><div class="tab-body tab-pane fade"
        id="tabs-tab-certs-renew-12" role="tabpanel" aria-labelledby="tabs-tab-certs-renew-12-tab" tabindex="tab-certs-renew"><!--
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!--
Renew the certificate embedded in the kubeconfig file for the super-admin.
-->
<p>为 super-admin 对嵌入于 kubeconfig 文件中的证书续期。</p>
<!--
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.
-->
<p>续期操作将无条件进行，不论证书的到期日期是何时；诸如 SAN
之类的额外属性将基于现有文件/证书，无需重新提供。</p>
<!--
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.
-->
<p>默认情况下，续订会尝试使用由 kubeadm 管理的本地 PKI 中的证书机构；
作为替代方案，也可以使用 K8s certificate API 进行证书续订，
或者（作为最后一种选择）生成 CSR 请求。</p>
<!--
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.
-->
<p>续期后，为了使更改生效，需要重启控制平面组件，并且如果该文件在其他地方使用，
最终需要重新分发续期后的证书。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubeadm certs renew super-admin.conf <span class="o">[</span>flags<span class="o">]</span>
</span></span></code></pre></div><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<!--
--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/pki"
-->
<td colspan="2">--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/pki"</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The path where to save the certificates
-->
保存证书的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">--config string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Path to a kubeadm configuration file.
-->
kubeadm 配置文件的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for super-admin.conf
-->
super-admin.conf 的帮助信息。
</p>
</td>
</tr>
<tr>
<!--
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/admin.conf"
-->
<td colspan="2">--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/admin.conf"</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
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.
-->
与集群通信时使用的 kubeconfig 文件。
如果未设置该参数，则可以在一组标准位置中搜索现有的 kubeconfig 文件。
</p>
</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
[实验性功能] 指向‘真实’宿主根文件系统的路径。
</p>
</td>
</tr>
</tbody>
</table>
</div></div>


## kubeadm certs certificate-key {#cmd-certs-certificate-key}

<!--
This command can be used to generate a new control-plane certificate key.
The key can be passed as `--certificate-key` to [`kubeadm init`](/docs/reference/setup-tools/kubeadm/kubeadm-init)
and [`kubeadm join`](/docs/reference/setup-tools/kubeadm/kubeadm-join)
to enable the automatic copy of certificates when joining additional control-plane nodes.
-->
此命令可用来生成一个新的控制面证书密钥。密钥可以作为 `--certificate-key`
标志的取值传递给 [`kubeadm init`](/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-init)
和 [`kubeadm join`](/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-join)
命令，从而在添加新的控制面节点时能够自动完成证书复制。

<ul class="nav nav-tabs" id="tabs-tab-certs-certificate-key" role="tablist"><li class="nav-item"><a data-bs-toggle="tab" class="nav-link active" href="#tabs-tab-certs-certificate-key-0" role="tab" aria-controls="tabs-tab-certs-certificate-key-0" aria-selected="true">certificate-key</a></li>
	  </ul>

<div class="tab-content" id="tabs-tab-certs-certificate-key-content"><div class="tab-body tab-pane fadeshow active"
        id="tabs-tab-certs-certificate-key-0" role="tabpanel" aria-labelledby="tabs-tab-certs-certificate-key-0-tab" tabindex="tab-certs-certificate-key"><!--
Generate certificate keys
-->
<p>生成证书密钥。</p>
<!--
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!--
This command will print out a secure randomly-generated certificate key that can be used with
the "init" command.
-->
<p>该命令将打印出可以与 &quot;init&quot; 命令一起使用的安全的随机生成的证书密钥。</p>
<!--
You can also use "kubeadm init -upload-certs" without specifying a certificate key and it will generate and print one for you.
-->
<p>你也可以使用 <code>kubeadm init --upload-certs</code> 而无需指定证书密钥；
此命令将为你生成并打印一个证书密钥。</p>
<pre tabindex="0"><code>kubeadm certs certificate-key [flags]
</code></pre><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
   <table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for certificate-key
-->
certificate-key 操作的帮助命令。
</p>
</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
   <table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
[实验] 到 '真实' 主机根文件系统的路径。
</p>
</td>
</tr>
</tbody>
</table>
</div></div>


## kubeadm certs check-expiration {#cmd-certs-check-expiration}

<!--
This command checks expiration for the certificates in the local PKI managed by kubeadm.
For more details see
[Check certificate expiration](/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/#check-certificate-expiration).
-->
此命令检查 kubeadm 所管理的本地 PKI 中的证书是否以及何时过期。更多的相关细节，
可参见[检查证书过期](/zh-cn/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/#check-certificate-expiration)。

<ul class="nav nav-tabs" id="tabs-tab-certs-check-expiration" role="tablist"><li class="nav-item"><a data-bs-toggle="tab" class="nav-link active" href="#tabs-tab-certs-check-expiration-0" role="tab" aria-controls="tabs-tab-certs-check-expiration-0" aria-selected="true">check-expiration</a></li>
	  </ul>

<div class="tab-content" id="tabs-tab-certs-check-expiration-content"><div class="tab-body tab-pane fadeshow active"
        id="tabs-tab-certs-check-expiration-0" role="tabpanel" aria-labelledby="tabs-tab-certs-check-expiration-0-tab" tabindex="tab-certs-check-expiration"><!--
Check certificates expiration for a Kubernetes cluster 
-->
<p>为一个 Kubernetes 集群检查证书的到期时间。</p>
<!--
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!--
Checks expiration for the certificates in the local PKI managed by kubeadm.
-->
<p>检查 kubeadm 管理的本地 PKI 中证书的到期时间。</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl">kubeadm certs check-expiration <span class="o">[</span>flags<span class="o">]</span>
</span></span></code></pre></div><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">
<!--
--allow-missing-template-keys&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: true
-->
--allow-missing-template-keys&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值：true
</td>
</tr>
<tr>
<td>
</td>
<td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
If 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.
-->
如果为 true，忽略模板中缺少某字段或映射键的错误。仅适用于 golang 和
jsonpath 输出格式。
</p>
</td>
</tr>
<tr>
<!--
<td colspan="2">--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/pki"</td> 
-->
<td colspan="2">--cert-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes/pki"</td>
</tr>
<tr>
<td>
</td>
<td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The path where to save the certificates
-->
保存证书的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">--config string</td>
</tr>
<tr>
<td>
</td>
<td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Path to a kubeadm configuration file.
-->
到 kubeadm 配置文件的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">
<!--
-o, --experimental-output string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "text"
-->
-o, --experimental-output string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："text"
</td>
</tr>
<tr>
<td>
</td>
<td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Output format. One of: text|json|yaml|kyaml|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file.
-->
输出格式。可选值为：
text|json|yaml|kyaml|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file。
</p>
</td>
</tr>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td>
</td>
<td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for check-expiration
-->
check-expiration 操作的帮助命令。
</p>
</td>
</tr>
<tr>
<td colspan="2">
<!--
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes/admin.conf" 
-->
--kubeconfig string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认为："/etc/kubernetes/admin.conf"
</td>
</tr>
<tr>
<td>
</td>
<td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
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. 
-->
在和集群连接时使用该 kubeconfig 文件。
如果此标志未被设置，那么将会在一些标准的位置去搜索存在的 kubeconfig 文件。
</p>
</td>
</tr>
<tr>
<td colspan="2">--show-managed-fields</td>
</tr>
<tr>
<td>
</td>
<td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
If true, keep the managedFields when printing objects in JSON or YAML format.
-->
如果为 true，在以 JSON 或 YAML 格式打印对象时保留 <code>managedFields</code>。
</p>
</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td>
</td>
<td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
[实验] 到'真实'主机根文件系统的路径。
</p>
</td>
</tr>
</tbody>
</table>
</div></div>


## kubeadm certs generate-csr {#cmd-certs-generate-csr}

<!--
This 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](/docs/tasks/administer-cluster/kubeadm/kubeadm-certs#signing-csr).
-->
此命令可用来为所有控制面证书和 kubeconfig 文件生成密钥和 CSR（签名请求）。
用户可以根据自身需要选择 CA 为 CSR 签名。要了解如何使用该命令的更多信息，
请参阅[签署由 kubeadm 生成的证书签名请求（CSR）](/zh-cn/docs/tasks/administer-cluster/kubeadm/kubeadm-certs#signing-csr)。

<ul class="nav nav-tabs" id="tabs-tab-certs-generate-csr" role="tablist"><li class="nav-item"><a data-bs-toggle="tab" class="nav-link active" href="#tabs-tab-certs-generate-csr-0" role="tab" aria-controls="tabs-tab-certs-generate-csr-0" aria-selected="true">generate-csr</a></li>
	  </ul>

<div class="tab-content" id="tabs-tab-certs-generate-csr-content"><div class="tab-body tab-pane fadeshow active"
        id="tabs-tab-certs-generate-csr-0" role="tabpanel" aria-labelledby="tabs-tab-certs-generate-csr-0-tab" tabindex="tab-certs-generate-csr"><!--
Generate keys and certificate signing requests
-->
<p>生成密钥和证书签名请求。</p>
<!--
### Synopsis
-->
<h3 id="概要">概要<a class="td-heading-self-link" href="#%e6%a6%82%e8%a6%81" aria-label="Heading self-link"></a></h3>
<!-- 
Generates 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 &gt; user &gt; client-key-data" field, and for each kubeconfig file an accompanying ".csr" file is created.
-->
<p>为运行控制平面所需的所有证书生成密钥和证书签名请求（CSR）。该命令会生成部分 kubeconfig 文件，
其中 &quot;users &gt; user &gt; client-key-data&quot; 字段包含私钥数据，并为每个 kubeconfig
文件创建一个随附的 &quot;.csr&quot; 文件。</p>
<!--  
This command is designed for use in [Kubeadm External CA Mode](https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/#external-ca-mode). It generates CSRs which you can then submit to your external certificate authority for signing.
-->
<p>此命令设计用于 <a href="/zh-cn/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/#external-ca-mode">Kubeadm 外部 CA 模式</a>。
它生成你可以提交给外部证书颁发机构进行签名的 CSR。</p>
<!--  
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 &gt; user &gt; client-certificate-data" field.
-->
<p>你需要使用 &quot;.crt&quot; 作为文件扩展名将 PEM 编码的签名证书与密钥文件一起保存。
或者，对于 kubeconfig 文件，PEM 编码的签名证书应使用 base64 编码，
并添加到 &quot;users &gt; user &gt; client-certificate-data&quot; 字段。</p>
<pre tabindex="0"><code>kubeadm certs generate-csr [flags]
</code></pre><!--
### Examples
-->
<h3 id="示例">示例<a class="td-heading-self-link" href="#%e7%a4%ba%e4%be%8b" aria-label="Heading self-link"></a></h3>
<!-- 
```
  # 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
```
-->
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-shell" data-lang="shell"><span class="line"><span class="cl"><span class="c1"># 以下命令将为所有控制平面证书和 kubeconfig 文件生成密钥和 CSR：</span>
</span></span><span class="line"><span class="cl">kubeadm certs generate-csr --kubeconfig-dir /tmp/etc-k8s --cert-dir /tmp/etc-k8s/pki
</span></span></code></pre></div><!--
### Options
-->
<h3 id="选项">选项<a class="td-heading-self-link" href="#%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--cert-dir string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The path where to save the certificates
-->
保存证书的路径。
</p>
</td>
</tr>
<tr>
<td colspan="2">--config string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Path to a kubeadm configuration file.
-->
到 kubeadm 配置文件的路径。
</p></td>
</tr>
<tr>
<td colspan="2">-h, --help</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for generate-csr
-->
generate-csr 操作的帮助命令。
</p>
</td>
</tr>
<tr>
<td colspan="2">
<!--
-kubeconfig-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default: "/etc/kubernetes"
-->
--kubeconfig-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;默认值："/etc/kubernetes"
</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The path where to save the kubeconfig file.
-->
保存 kubeconfig 文件的路径。
</p>
</td>
</tr>
</tbody>
</table>
<!--
### Options inherited from parent commands
-->
<h3 id="从父命令继承的选项">从父命令继承的选项<a class="td-heading-self-link" href="#%e4%bb%8e%e7%88%b6%e5%91%bd%e4%bb%a4%e7%bb%a7%e6%89%bf%e7%9a%84%e9%80%89%e9%a1%b9" aria-label="Heading self-link"></a></h3>
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td colspan="2">--rootfs string</td>
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
[实验] 到'真实'主机根文件系统的路径。
</p>
</td>
</tr>
</tbody>
</table>
</div></div>


## 接下来

<!--
* [kubeadm init](/docs/reference/setup-tools/kubeadm/kubeadm-init/) to bootstrap a Kubernetes control-plane node
* [kubeadm join](/docs/reference/setup-tools/kubeadm/kubeadm-join/) to connect a node to the cluster
* [kubeadm reset](/docs/reference/setup-tools/kubeadm/kubeadm-reset/) to revert any changes made to this host by `kubeadm init` or `kubeadm join`
-->
* 用来启动引导 Kubernetes 控制面节点的
  [kubeadm init](/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-init/)
  命令
* 用来将节点连接到集群的
  [kubeadm join](/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-join/)
  命令
* 用来回滚 `kubeadm init` 或 `kubeadm join` 对当前主机所做修改的
  [kubeadm reset](/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-reset/)
  命令
