From 9638aa09f455ba594070477a5343cee5d37ee64a Mon Sep 17 00:00:00 2001 From: windsonsea Date: Tue, 7 May 2024 14:32:51 +0800 Subject: [PATCH] [zh] Sync setup-tools/kubeadm files --- .../kubeadm_certs_check-expiration.md | 53 +++++++++++++++ ..._init_phase_certs_apiserver-etcd-client.md | 5 -- .../kubeadm_init_phase_certs_apiserver.md | 5 -- .../kubeadm_init_phase_certs_etcd-peer.md | 5 -- .../kubeadm_init_phase_certs_etcd-server.md | 5 -- ...kubeadm_init_phase_certs_front-proxy-ca.md | 5 -- ...adm_init_phase_certs_front-proxy-client.md | 4 -- .../generated/kubeadm_init_phase_preflight.md | 19 ++++++ .../setup-tools/kubeadm/kubeadm-reset.md | 64 ++++++++++++++----- 9 files changed, 120 insertions(+), 45 deletions(-) diff --git a/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_check-expiration.md b/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_check-expiration.md index 60c289a30c..8c0cfc3df9 100644 --- a/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_check-expiration.md +++ b/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_certs_check-expiration.md @@ -29,6 +29,25 @@ kubeadm certs check-expiration [flags] + + + +--allow-missing-template-keys     默认值:true + + + + +

+ +如果为 true,忽略模板中缺少某字段或映射键的错误。仅适用于 golang 和 jsonpath 输出格式。 +

+ + + +-o, --experimental-output string     默认值:"text" + + + + +

+ +输出格式。可选值为: +text|json|yaml|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file。 +

+ + + -h, --help @@ -86,6 +125,20 @@ kubeadm certs check-expiration [flags] + +--show-managed-fields + + + +

+ +如果为 true,在以 JSON 或 YAML 格式打印对象时保留 managedFields。 +

+ + + diff --git a/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver-etcd-client.md b/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver-etcd-client.md index 98598d7e80..ee440d2e6d 100644 --- a/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver-etcd-client.md +++ b/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver-etcd-client.md @@ -18,11 +18,6 @@ If both files already exist, kubeadm skips the generation step and existing file --> 如果两个文件都已存在,则 kubeadm 将跳过生成步骤,使用现有文件。 - -Alpha 免责声明:此命令目前处于 Alpha 阶段。 - ``` kubeadm init phase certs apiserver-etcd-client [flags] ``` diff --git a/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver.md b/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver.md index 03e3909656..35aa5f5897 100644 --- a/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver.md +++ b/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver.md @@ -18,11 +18,6 @@ If both files already exist, kubeadm skips the generation step and existing file --> 如果两个文件都已存在,则 kubeadm 将跳过生成步骤,使用现有文件。 - -Alpha 免责声明:此命令目前处于 Alpha 阶段。 - ``` kubeadm init phase certs apiserver [flags] ``` diff --git a/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_etcd-peer.md b/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_etcd-peer.md index 4840c952be..d44aaf0f3f 100644 --- a/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_etcd-peer.md +++ b/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_etcd-peer.md @@ -23,11 +23,6 @@ If both files already exist, kubeadm skips the generation step and existing file --> 如果两个文件都已存在,则 kubeadm 将跳过生成步骤,使用现有文件。 - -Alpha 免责声明:此命令当前为 Alpha 功能。 - ``` kubeadm init phase certs etcd-peer [flags] ``` diff --git a/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_etcd-server.md b/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_etcd-server.md index 92ee010303..4e81bba018 100644 --- a/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_etcd-server.md +++ b/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_etcd-server.md @@ -23,11 +23,6 @@ If both files already exist, kubeadm skips the generation step and existing file --> 如果两个文件都已存在,则 kubeadm 将跳过生成步骤,使用现有文件。 - -Alpha 免责声明:此命令当前为 Alpha 功能。 - ``` kubeadm init phase certs etcd-server [flags] ``` diff --git a/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-ca.md b/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-ca.md index 916bf001f2..1246416eaf 100644 --- a/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-ca.md +++ b/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-ca.md @@ -18,11 +18,6 @@ If both files already exist, kubeadm skips the generation step and existing file --> 如果两个文件都已存在,kubeadm 将跳过生成步骤并将使用现有文件。 - -Alpha 免责声明:此命令目前是 Alpha 阶段。 - ``` kubeadm init phase certs front-proxy-ca [flags] ``` diff --git a/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-client.md b/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-client.md index 7b313f46bf..169114222b 100644 --- a/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-client.md +++ b/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-client.md @@ -12,15 +12,11 @@ Generate the certificate for the front proxy client Generate the certificate for the front proxy client, and save them into front-proxy-client.crt and front-proxy-client.key files. If both files already exist, kubeadm skips the generation step and existing files will be used. - -Alpha Disclaimer: this command is currently alpha. --> 为前端代理客户端生成证书,并将其保存到 front-proxy-client.crt 和 front-proxy-client.key 文件中。 如果两个文件都已存在,kubeadm 将跳过生成步骤并将使用现有文件。 -Alpha 免责声明:此命令目前是 Alpha 阶段。 - ``` kubeadm init phase certs front-proxy-client [flags] ``` diff --git a/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_preflight.md b/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_preflight.md index 4782f82b9c..f053439bf4 100644 --- a/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_preflight.md +++ b/content/zh-cn/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_preflight.md @@ -116,6 +116,25 @@ A list of checks whose errors will be shown as warnings. Example: 'IsPrivilegedU + + + +--image-repository string     默认值:"registry.k8s.io" + + + + +

+ +选择拉取控制平面镜像的容器仓库。 +

+ + + diff --git a/content/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-reset.md b/content/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-reset.md index 5143c8f111..fb4657abaa 100644 --- a/content/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-reset.md +++ b/content/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-reset.md @@ -3,61 +3,93 @@ title: kubeadm reset content_type: concept weight: 60 --- - +--> - + 该命令尽力还原由 `kubeadm init` 或 `kubeadm join` 所做的更改。 {{< include "generated/kubeadm_reset.md" >}} - + ### Reset 工作流程 {#reset-workflow} - `kubeadm reset` 负责从使用 `kubeadm init` 或 `kubeadm join` 命令创建的文件中清除节点本地文件系统。 对于控制平面节点,`reset` 还从 etcd 集群中删除该节点的本地 etcd Stacked 部署的成员。 - +the `kubeadm join` and `kubeadm init` phase runners. +--> `kubeadm reset phase` 可用于执行上述工作流程的各个阶段。 要跳过阶段列表,你可以使用 `--skip-phases` 参数,该参数的工作方式类似于 `kubeadm join` 和 `kubeadm init` 阶段运行器。 - + ### 外部 etcd 清理 - -如果使用了外部 etcd,`kubeadm reset` 将不会删除任何 etcd 中的数据。这意味着,如果再次使用相同的 etcd 端点运行 `kubeadm init`,你将看到先前集群的状态。 + +如果使用了外部 etcd,`kubeadm reset` 将不会删除任何 etcd 中的数据。 +这意味着,如果再次使用相同的 etcd 端点运行 `kubeadm init`,你将看到先前集群的状态。 - + 要清理 etcd 中的数据,建议你使用 etcdctl 这样的客户端,例如: ```bash etcdctl del "" --prefix ``` - + 更多详情请参考 [etcd 文档](https://github.com/coreos/etcd/tree/master/etcdctl)。 + +### 体面关闭 kube-apiserver + +如果你为 `kube-apiserver` 配置了 `--shutdown-delay-duration` 标志, +你可以在运行 `kubeadm reset` 之前,运行以下命令尝试体面关闭正在运行的 API 服务器 Pod: + +```bash +yq eval -i '.spec.containers[0].command = []' /etc/kubernetes/manifests/kube-apiserver.yaml +timeout 60 sh -c 'while pgrep kube-apiserver >/dev/null; do sleep 1; done' || true +``` ## {{% heading "whatsnext" %}} - + * 参考 [kubeadm init](/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-init/) 来初始化 Kubernetes 主节点。 * 参考 [kubeadm join](/zh-cn/docs/reference/setup-tools/kubeadm/kubeadm-join/) 来初始化 Kubernetes 工作节点并加入集群。 -