Merge pull request #47726 from windsonsea/admyhr

[zh] Sync kubeadm_completion, _kubeconfig, and _version
This commit is contained in:
Kubernetes Prow Robot 2024-09-02 07:44:58 +01:00 committed by GitHub
commit 4edf27975b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 66 additions and 49 deletions

View File

@ -16,7 +16,6 @@ kubeadm轻松创建一个安全的 Kubernetes 集群
│ https://github.com/kubernetes/kubeadm/issues │
└──────────────────────────────────────────────────────────┘
-->
```
┌──────────────────────────────────────────────────────────┐
│ KUBEADM │
@ -37,7 +36,8 @@ Example usage:
(which controls the cluster), and one worker node
(where your workloads, like Pods and Deployments run).
-->
创建一个有两台机器的集群,包含一个主节点(用来控制集群)和一个工作节点(运行你的 Pod 和 Deployment 等工作负载)。
创建一个有两台机器的集群,包含一个控制平面节点(用来控制集群)
和一个工作节点(运行你的 Pod 和 Deployment 等工作负载)。
<!--
┌──────────────────────────────────────────────────────────┐
@ -54,7 +54,6 @@ Example usage:
You can then repeat the second step on as many other machines as you like.
-->
```
┌──────────────────────────────────────────────────────────┐
│ 在第一台机器上: │
@ -76,7 +75,7 @@ Example usage:
-->
### 选项
<table style="width: 100%; table-layout: fixed;">
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
@ -100,10 +99,12 @@ Example usage:
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
<p>[EXPERIMENTAL] The path to the 'real' host root filesystem.</p>
The path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.
-->
<p>[实验] 指向 '真实' 宿主机根文件系统的路径。<p>
到“真实”主机根文件系统的路径。设置此参数将导致 kubeadm 切换到所提供的路径。
<p>
</td>
</tr>

View File

@ -1,7 +1,7 @@
<!--
Output shell completion code for the specified shell (bash or zsh)
-->
为指定的 shellbash 或 zsh输出 shell 补全代码。
为指定的 ShellBash 或 Zsh输出 Shell 补全代码。
<!--
### Synopsis
@ -14,8 +14,9 @@ The shell code must be evaluated to provide interactive
completion of kubeadm commands. This can be done by sourcing it from
the .bash_profile.
-->
为指定的 shellbash 或 zsh输出 shell 补全代码。
必须激活 shell 代码以提供交互式 kubeadm 命令补全。这可以通过加载 .bash_profile 文件完成。
为指定的 ShellBash 或 Zsh输出 Shell 补全代码。
必须激活 Shell 代码以提供交互式 kubeadm 命令补全。
这可以通过加载 .bash_profile 文件完成。
<!--
Note: this requires the bash-completion framework.
@ -29,15 +30,16 @@ Once installed, bash_completion must be evaluated. This can be done by adding th
following line to the .bash_profile
$ source $(brew --prefix)/etc/bash_completion
-->
在 Mac 上使用 homebrew 安装:
在 Mac 上使用 Homebrew 安装:
```
```bash
brew install bash-completion
```
安装后,必须激活 bash_completion。这可以通过在 .bash_profile 文件中添加下面的命令行来完成:
安装后,必须激活 bash_completion。
这可以通过在 .bash_profile 文件中添加下面的命令行来完成:
```
```bash
source $(brew --prefix)/etc/bash_completion
```
@ -45,12 +47,12 @@ source $(brew --prefix)/etc/bash_completion
If bash-completion is not installed on Linux, please install the 'bash-completion' package
via your distribution's package manager.
-->
如果在 Linux 上没有安装 bash-completion请通过你的发行版的包管理器安装 `bash-completion` 软件包。
如果在 Linux 上没有安装 `bash-completion`,请通过你的发行版的包管理器安装 `bash-completion` 软件包。
<!--
Note for zsh users: [1] zsh completions are only supported in versions of zsh &gt;= 5.2
-->
zsh 用户注意事项:[1] zsh 自动补全仅在 v5.2 及以上版本中支持。
Zsh 用户注意事项:[1] Zsh 自动补全仅在 v5.2 及以上版本中支持。
```
kubeadm completion SHELL [flags]
@ -70,7 +72,7 @@ source $HOME/.bash_profile
# Load the kubeadm completion code for bash into the current shell
source <(kubeadm completion bash)
# Write bash completion code to a file and source if from .bash_profile
# Write bash completion code to a file and source it from .bash_profile
kubeadm completion bash > ~/.kube/kubeadm_completion.bash.inc
printf "\n# Kubeadm shell completion\nsource '$HOME/.kube/kubeadm_completion.bash.inc'\n" >> $HOME/.bash_profile
source $HOME/.bash_profile
@ -78,20 +80,20 @@ source $HOME/.bash_profile
# Load the kubeadm completion code for zsh[1] into the current shell
source <(kubeadm completion zsh)
-->
```
# 在 Mac 上使用 homebrew 安装 bash completion
```bash
# 在 Mac 上使用 Homebrew 安装 bash completion
brew install bash-completion
printf "\n# Bash completion support\nsource $(brew --prefix)/etc/bash_completion\n" >> $HOME/.bash_profile
source $HOME/.bash_profile
# 将 bash 版本的 kubeadm 自动补全代码加载到当前 shell 中
# 将 bash 版本的 kubeadm 自动补全代码加载到当前 Shell 中
source <(kubeadm completion bash)
# 将 bash 自动补全完成代码写入文件并且从 .bash_profile 文件加载它
# 将 Bash 自动补全完成代码写入文件并且从 .bash_profile 文件加载它
printf "\n# Kubeadm shell completion\nsource '$HOME/.kube/kubeadm_completion.bash.inc'\n" >> $HOME/.bash_profile
source $HOME/.bash_profile
# 将 zsh 版本的 kubeadm 自动补全代码加载到当前 shell 中
# 将 Zsh 版本的 kubeadm 自动补全代码加载到当前 Shell 中
source <(kubeadm completion zsh)
```
@ -112,10 +114,10 @@ source <(kubeadm completion zsh)
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for completion
-->
<p>
completion 操作的帮助命令。
</p>
</td>
@ -129,7 +131,7 @@ completion 操作的帮助命令。
-->
### 从父命令继承的选项
<table style="width: 100%; table-layout: fixed;">
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
@ -141,11 +143,11 @@ completion 操作的帮助命令。
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
<p>
[实验] 到 '真实' 主机根文件系统的路径。
<!--
The path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.
-->
到“真实”主机根文件系统的路径。设置此标志将导致 kubeadm 切换到所提供的路径。
</p>
</td>
</tr>

View File

@ -27,10 +27,12 @@ kubeconfig 文件工具。
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for kubeconfig
-->
kubeconfig 操作的帮助命令。
<p>
</td>
</tr>
@ -54,11 +56,12 @@ kubeconfig 操作的帮助命令。
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
The path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.
-->
[实验] 到 '真实' 主机根文件系统的路径。
</td>
到“真实”主机根文件系统的路径。设置此标志将导致 kubeadm 切换到所提供的路径。
</p>
</td>
</tr>

View File

@ -41,7 +41,7 @@ kubeadm alpha kubeconfig user --client-name=foo --config=bar
-->
### 选项
<table style="width: 100%; table-layout: fixed;">
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
@ -53,10 +53,12 @@ kubeadm alpha kubeconfig user --client-name=foo --config=bar
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The name of user. It will be used as the CN if client certificates are created
-->
用户名。如果生成客户端证书,则用作其 CN。
</p>
</td>
</tr>
@ -65,10 +67,12 @@ The name of user. It will be used as the CN if client certificates are created
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Path to a kubeadm configuration file.
-->
指向 kubeadm 配置文件的路径。
</p>
</td>
</tr>
@ -77,10 +81,12 @@ Path to a kubeadm configuration file.
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for user
-->
user 操作的帮助命令。
</p>
</td>
</tr>
@ -89,10 +95,12 @@ user 操作的帮助命令。
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The organizations of the client certificate. It will be used as the O if client certificates are created
-->
客户端证书的组织。如果创建客户端证书,此值将用作其 O 字段值。
</p>
</td>
</tr>
@ -102,10 +110,12 @@ The organizations of the client certificate. It will be used as the O if client
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The token that should be used as the authentication mechanism for this kubeconfig, instead of client certificates
-->
应该用此令牌做为 kubeconfig 的身份验证机制,而不是客户端证书。
</p>
</td>
</tr>
@ -114,10 +124,10 @@ The token that should be used as the authentication mechanism for this kubeconfi
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
The validity period of the client certificate. It is an offset from the current time.
-->
<p>
客户证书的合法期限。所设置值为相对当前时间的偏移。
</p></td>
</tr>
@ -130,7 +140,7 @@ The validity period of the client certificate. It is an offset from the current
-->
### 从父命令继承的选项
<table style="width: 100%; table-layout: fixed;">
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
@ -142,10 +152,12 @@ The validity period of the client certificate. It is an offset from the current
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
The path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.
-->
[实验] 指向 '真实' 宿主机的根目录。
到“真实”主机根文件系统的路径。设置此标志将导致 kubeadm 切换到所提供的路径。
</p>
</td>
</tr>

View File

@ -22,7 +22,7 @@ kubeadm version [flags]
-->
### 选项
<table style="width: 100%; table-layout: fixed;">
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
@ -34,10 +34,10 @@ kubeadm version [flags]
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
help for version
-->
<p>
version 操作的帮助命令。
</p>
</td>
@ -48,10 +48,10 @@ version 操作的帮助命令。
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<p>
<!--
Output format; available options are 'yaml', 'json' and 'short'
-->
<p>
输出格式;可用的选项有 'yaml'、'json' 和 'short'。
</p>
</td>
@ -65,7 +65,7 @@ Output format; available options are 'yaml', 'json' and 'short'
-->
### 从父命令继承的选项
<table style="width: 100%; table-layout: fixed;">
<table style="width: 100%; table-layout: fixed;">
<colgroup>
<col span="1" style="width: 10px;" />
<col span="1" />
@ -77,11 +77,11 @@ Output format; available options are 'yaml', 'json' and 'short'
</tr>
<tr>
<td></td><td style="line-height: 130%; word-wrap: break-word;">
<!--
[EXPERIMENTAL] The path to the 'real' host root filesystem.
-->
<p>
[实验] 指向 '真实' 宿主机根文件系统的路径。
<!--
The path to the 'real' host root filesystem. This will cause kubeadm to chroot into the provided path.
-->
到“真实”主机根文件系统的路径。设置此标志将导致 kubeadm 切换到所提供的路径。
</p>
</td>
</tr>

View File

@ -12,13 +12,13 @@ For examples on how to use `kubeadm kubeconfig user` see
-->
`kubeadm kubeconfig` 提供用来管理 kubeconfig 文件的工具。
如果希望查看如何使用 `kubeadm kubeconfig user` 的示例,请参阅
[为其他用户生成 kubeconfig 文件](/zh-cn/docs/tasks/administer-cluster/kubeadm/kubeadm-certs#kubeconfig-additional-users).
如果希望查看如何使用 `kubeadm kubeconfig user` 的示例,
请参阅[为其他用户生成 kubeconfig 文件](/zh-cn/docs/tasks/administer-cluster/kubeadm/kubeadm-certs#kubeconfig-additional-users)。
## kubeadm kubeconfig {#cmd-kubeconfig}
{{< tabs name="tab-kubeconfig" >}}
{{< tab name="overview" include="generated/kubeadm_kubeconfig.md" />}}
{{< tab name="概述" include="generated/kubeadm_kubeconfig/_index.md" />}}
{{< /tabs >}}
## kubeadm kubeconfig user {#cmd-kubeconfig-user}
@ -29,5 +29,5 @@ This command can be used to output a kubeconfig file for an additional user.
此命令可用来为其他用户生成一个 kubeconfig 文件。
{{< tabs name="tab-kubeconfig-user" >}}
{{< tab name="user" include="generated/kubeadm_kubeconfig_user.md" />}}
{{< tab name="user" include="generated/kubeadm_kubeconfig/kubeadm_kubeconfig_user.md" />}}
{{< /tabs >}}

View File

@ -3,7 +3,6 @@ title: kubeadm version
content_type: concept
weight: 80
---
<!--
reviewers:
- luxas
@ -20,5 +19,5 @@ This command prints the version of kubeadm.
此命令用来输出 kubeadm 的版本。
<!-- body -->
{{< include "generated/kubeadm_version.md" >}}
{{< include "generated/kubeadm_version/_index.md" >}}