From de138d9377587d978738e18235301caa17f043b0 Mon Sep 17 00:00:00 2001 From: "xin.li" Date: Sat, 17 Jun 2023 17:39:51 +0800 Subject: [PATCH] [zh-cn] sync setup-ha-etcd-with-kubeadm configure-upgrade-etcd configure-aggregation-layer Signed-off-by: xin.li --- .../kubeadm/setup-ha-etcd-with-kubeadm.md | 18 +- .../configure-upgrade-etcd.md | 2 +- .../configure-aggregation-layer.md | 176 +++++++++++++----- 3 files changed, 147 insertions(+), 49 deletions(-) diff --git a/content/zh-cn/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm.md b/content/zh-cn/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm.md index 8dd63dd187..8f8b4657f8 100644 --- a/content/zh-cn/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm.md +++ b/content/zh-cn/docs/setup/production-environment/tools/kubeadm/setup-ha-etcd-with-kubeadm.md @@ -119,13 +119,23 @@ on Kubernetes dual-stack support see [Dual-stack support with kubeadm](/docs/set kubeadm 提供的 kubelet 单元文件。 ```sh + cat << EOF > /etc/systemd/system/kubelet.service.d/kubelet.conf + # 将下面的 "systemd" 替换为你的容器运行时所使用的 cgroup 驱动。 + # kubelet 的默认值为 "cgroupfs"。 + # 如果需要的话,将 "containerRuntimeEndpoint" 的值替换为一个不同的容器运行时。 + # + apiVersion: kubelet.config.k8s.io/v1beta1 + kind: KubeletConfiguration + cgroupDriver: systemd + address: 127.0.0.1 + containerRuntimeEndpoint: unix:///var/run/containerd/containerd.sock + staticPodPath: /etc/kubernetes/manifests + EOF + cat << EOF > /etc/systemd/system/kubelet.service.d/20-etcd-service-manager.conf [Service] ExecStart= - # 将下面的 "systemd" 替换为你的容器运行时所使用的 cgroup 驱动。 - # kubelet 的默认值为 "cgroupfs"。 - # 如果需要的话,将 "--container-runtime-endpoint " 的值替换为一个不同的容器运行时。 - ExecStart=/usr/bin/kubelet --address=127.0.0.1 --pod-manifest-path=/etc/kubernetes/manifests --cgroup-driver=systemd --container-runtime-endpoint=unix:///var/run/containerd/containerd.sock + ExecStart=/usr/bin/kubelet --config=/etc/systemd/system/kubelet.service.d/kubelet.conf Restart=always EOF diff --git a/content/zh-cn/docs/tasks/administer-cluster/configure-upgrade-etcd.md b/content/zh-cn/docs/tasks/administer-cluster/configure-upgrade-etcd.md index 81cebf6630..9545872007 100644 --- a/content/zh-cn/docs/tasks/administer-cluster/configure-upgrade-etcd.md +++ b/content/zh-cn/docs/tasks/administer-cluster/configure-upgrade-etcd.md @@ -705,7 +705,7 @@ Before you start an upgrade, please back up your etcd cluster first. ## 维护 etcd 集群 {#maintaining-etcd-clusters} diff --git a/content/zh-cn/docs/tasks/extend-kubernetes/configure-aggregation-layer.md b/content/zh-cn/docs/tasks/extend-kubernetes/configure-aggregation-layer.md index 35602cd065..8564da5758 100644 --- a/content/zh-cn/docs/tasks/extend-kubernetes/configure-aggregation-layer.md +++ b/content/zh-cn/docs/tasks/extend-kubernetes/configure-aggregation-layer.md @@ -16,7 +16,9 @@ weight: 10 配置[聚合层](/zh-cn/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation/)可以允许 Kubernetes apiserver 使用其它 API 扩展,这些 API 不是核心 Kubernetes API 的一部分。 @@ -27,7 +29,10 @@ Kubernetes apiserver 使用其它 API 扩展,这些 API 不是核心 Kubernete {{< note >}} 要使聚合层在你的环境中正常工作以支持代理服务器和扩展 apiserver 之间的相互 TLS 身份验证, 需要满足一些设置要求。Kubernetes 和 kube-apiserver 具有多个 CA, @@ -36,7 +41,8 @@ There are a few setup requirements for getting the aggregation layer working in {{< caution >}} 对不同的客户端类型重复使用相同的 CA 会对集群的功能产生负面影响。 有关更多信息,请参见 [CA 重用和冲突](#ca-reusage-and-conflicts)。 @@ -47,9 +53,15 @@ Reusing the same CA for different client types can negatively impact the cluster ## 身份认证流程 {#authentication-flow} @@ -64,7 +76,8 @@ Kubernetes apiserver 将需要与你的扩展 apiserver 通信,并且你的扩 @@ -267,7 +301,9 @@ Kubernetes apiserver 现在将请求发送或代理到注册以处理该请求 Kubernetes apiserver 将使用由 `--proxy-client-*-file` 指示的文件来向扩展 apiserver认证。 为了使合规的扩展 apiserver 能够将该请求视为有效,必须满足以下条件: @@ -298,7 +338,8 @@ Kubernetes apiserver 将使用由 `--proxy-client-*-file` 指示的文件来向 {{< note >}} 你可以将此选项设置为空白,即为`--requestheader-allowed-names=""`。 这将向扩展 apiserver 指示**任何** CN 都是可接受的。 @@ -308,9 +349,14 @@ You can set this option to blank as `--requestheader-allowed-names=""`. This wil When started with these options, the Kubernetes apiserver will: 1. Use them to authenticate to the extension apiserver. -2. Create a configmap in the `kube-system` namespace called `extension-apiserver-authentication`, in which it will place the CA certificate and the allowed CNs. These in turn can be retrieved by extension apiservers to validate requests. +2. Create a configmap in the `kube-system` namespace called `extension-apiserver-authentication`, + in which it will place the CA certificate and the allowed CNs. These in turn can be retrieved + by extension apiservers to validate requests. -Note that the same client certificate is used by the Kubernetes apiserver to authenticate against _all_ extension apiservers. It does not create a client certificate per extension apiserver, but rather a single one to authenticate as the Kubernetes apiserver. This same one is reused for all extension apiserver requests. +Note that the same client certificate is used by the Kubernetes apiserver to authenticate +against _all_ extension apiservers. It does not create a client certificate per extension +apiserver, but rather a single one to authenticate as the Kubernetes apiserver. +This same one is reused for all extension apiserver requests. --> 使用这些选项启动时,Kubernetes apiserver 将: @@ -327,13 +373,16 @@ Kubernetes apiserver 认证。所有扩展 apiserver 请求都重复使用相同 #### 原始请求用户名和组 @@ -352,7 +401,9 @@ Kubernetes apiserver。 如果以上均通过,则该请求是来自合法认证代理(在本例中为 Kubernetes apiserver) 的有效代理请求。 @@ -403,9 +459,15 @@ In order to have permission to retrieve the configmap, an extension apiserver re ### 扩展 Apiserver 对请求鉴权 {#extensions-apiserver-authorizes-the-request} @@ -425,7 +487,8 @@ If the `SubjectAccessReview` passes, the extension apiserver executes the reques ## Enable Kubernetes Apiserver flags -Enable the aggregation layer via the following `kube-apiserver` flags. They may have already been taken care of by your provider. +Enable the aggregation layer via the following `kube-apiserver` flags. +They may have already been taken care of by your provider. --> ### 扩展 Apiserver 执行 {#enable-kubernetes-apiserver-flags} @@ -459,10 +522,21 @@ Kubernetes apiserver 有两个客户端 CA 选项: * `--requestheader-client-ca-file` 这些功能中的每个功能都是独立的;如果使用不正确,可能彼此冲突。 @@ -481,9 +555,19 @@ Each of these functions independently and can conflict with each other, if not u 如果名称允许,则请求被批准;如果不是,则请求被拒绝。 如果同时提供了 `--client-ca-file` 和 `--requestheader-client-ca-file`, 则首先检查 `--requestheader-client-ca-file` CA,然后再检查 `--client-ca-file`。 @@ -503,13 +587,15 @@ apiserver 认证。 {{< warning >}} 除非你了解风险和保护 CA 用法的机制,否则 **不要** 重用在不同上下文中使用的 CA。 {{< /warning >}} 如果你未在运行 API 服务器的主机上运行 kube-proxy,则必须确保使用以下 `kube-apiserver` 标志启用系统: @@ -594,8 +680,10 @@ spec: ## {{% heading "whatsnext" %}}