translation for section admin4

This commit is contained in:
Steven Yan
2021-11-05 12:15:02 +08:00
parent 0c04e2c54c
commit f4962730fa
5 changed files with 143 additions and 45 deletions
@@ -40,11 +40,11 @@ explains how to use `kubeadm` to migrate from `kube-dns`.
DNS is a built-in Kubernetes service launched automatically DNS is a built-in Kubernetes service launched automatically
using the addon manager using the addon manager
[cluster add-on](https://releases.k8s.io/{{< param "githubbranch" >}}/cluster/addons/README.md). [cluster add-on](http://releases.k8s.io/master/cluster/addons/README.md).
--> -->
## 介绍 ## 介绍
DNS 是使用[集群插件](https://releases.k8s.io/{{< param "githubbranch" >}}/cluster/addons/README.md) DNS 是使用[集群插件](http://releases.k8s.io/master/cluster/addons/README.md)
管理器自动启动的内置的 Kubernetes 服务。 管理器自动启动的内置的 Kubernetes 服务。
<!-- <!--
@@ -55,11 +55,11 @@ originally used kube-dns, you may still have `kube-dns` deployed rather than Cor
你的集群原来使用 kube-dns,你可能部署的仍然是 `kube-dns` 而不是 CoreDNS。 你的集群原来使用 kube-dns,你可能部署的仍然是 `kube-dns` 而不是 CoreDNS。
<!-- <!--
Both the CoreDNS and kube-dns Service are named `kube-dns` in the `metadata.name` field. The CoreDNS Service is named `kube-dns` in the `metadata.name` field.
This is so that there is greater interoperability with workloads that relied on the legacy `kube-dns` Service name to resolve addresses internal to the cluster. Using a Service named `kube-dns` abstracts away the implementation detail of which DNS provider is running behind that common name. This is so that there is greater interoperability with workloads that relied on the legacy `kube-dns` Service name to resolve addresses internal to the cluster. Using a Service named `kube-dns` abstracts away the implementation detail of which DNS provider is running behind that common name.
--> -->
{{< note >}} {{< note >}}
CoreDNS 和 kube-dns 的 Service 都在其 `metadata.name` 字段使用名字 `kube-dns` CoreDNS 服务在其 `metadata.name` 字段被命名为 `kube-dns`
这是为了能够与依靠传统 `kube-dns` 服务名称来解析集群内部地址的工作负载具有更好的互操作性。 这是为了能够与依靠传统 `kube-dns` 服务名称来解析集群内部地址的工作负载具有更好的互操作性。
使用 `kube-dns` 作为服务名称可以抽离共有名称之后运行的是哪个 DNS 提供程序这一实现细节。 使用 `kube-dns` 作为服务名称可以抽离共有名称之后运行的是哪个 DNS 提供程序这一实现细节。
{{< /note >}} {{< /note >}}
@@ -304,27 +304,23 @@ During translation, all FQDN nameservers will be omitted from the CoreDNS config
CoreDNS supports the features of kube-dns and more. CoreDNS supports the features of kube-dns and more.
A ConfigMap created for kube-dns to support `StubDomains`and `upstreamNameservers` translates to the `proxy` plugin in CoreDNS. A ConfigMap created for kube-dns to support `StubDomains`and `upstreamNameservers` translates to the `proxy` plugin in CoreDNS.
Similarly, the `Federations` plugin in kube-dns translates to the `federation` plugin in CoreDNS.
### Example ### Example
This example ConfigMap for kubedns specifies federations, stubdomains and upstreamnameservers: This example ConfigMap for kube-dns specifies stubdomains and upstreamnameservers:
--> -->
## CoreDNS 配置等同于 kube-dns ## CoreDNS 配置等同于 kube-dns
CoreDNS 不仅仅提供 kube-dns 的功能。 CoreDNS 不仅仅提供 kube-dns 的功能。
为 kube-dns 创建的 ConfigMap 支持 `StubDomains` 和 `upstreamNameservers` 转换为 CoreDNS 中的 `forward` 插件。 为 kube-dns 创建的 ConfigMap 支持 `StubDomains` 和 `upstreamNameservers` 转换为 CoreDNS 中的 `forward` 插件。
同样,kube-dns 中的 `Federations` 插件会转换为 CoreDNS 中的 `federation` 插件。
### 示例 ### 示例
用于 kubedns 的此示例 ConfigMap 描述了 federations、stubdomains and upstreamnameservers 用于 kubedns 的此示例 ConfigMap 描述了 stubdomains upstreamnameservers
```yaml ```yaml
apiVersion: v1 apiVersion: v1
data: data:
federations: |
{"foo" : "foo.feddomain.com"}
stubDomains: | stubDomains: |
{"abc.com" : ["1.2.3.4"], "my.cluster.local" : ["2.3.4.5"]} {"abc.com" : ["1.2.3.4"], "my.cluster.local" : ["2.3.4.5"]}
upstreamNameservers: | upstreamNameservers: |
@@ -337,14 +333,6 @@ The equivalent configuration in CoreDNS creates a Corefile:
--> -->
CoreDNS 中的等效配置将创建一个 Corefile: CoreDNS 中的等效配置将创建一个 Corefile:
* 针对 federations:
```yaml
federation cluster.local {
foo foo.feddomain.com
}
```
* 针对 stubDomains: * 针对 stubDomains:
```yaml ```yaml
@@ -109,13 +109,13 @@ If the `nslookup` command fails, check the following:
### Check the local DNS configuration first ### Check the local DNS configuration first
Take a look inside the resolv.conf file. Take a look inside the resolv.conf file.
(See [Inheriting DNS from the node](/docs/tasks/administer-cluster/dns-custom-nameservers/#inheriting-dns-from-the-node) and (See [Customizing DNS Service](/docs/tasks/administer-cluster/dns-custom-nameservers) and
[Known issues](#known-issues) below for more information) [Known issues](#known-issues) below for more information)
--> -->
### 先检查本地的 DNS 配置 ### 先检查本地的 DNS 配置
查看 resolv.conf 文件的内容 查看 resolv.conf 文件的内容
(阅读[从节点继承 DNS 配置](/zh/docs/tasks/administer-cluster/dns-custom-nameservers/) 和 (阅读[定制 DNS 服务](/zh/docs/tasks/administer-cluster/dns-custom-nameservers/) 和
后文的[已知问题](#known-issues) ,获取更多信息) 后文的[已知问题](#known-issues) ,获取更多信息)
```shell ```shell
@@ -471,6 +471,14 @@ Kubernetes 需要占用一个 `nameserver` 记录和三个`search`记录。
要想修复 DNS `search` 记录个数限制问题,可以考虑升级你的 Linux 发行版本,或者 要想修复 DNS `search` 记录个数限制问题,可以考虑升级你的 Linux 发行版本,或者
升级 glibc 到一个不再受此困扰的版本。 升级 glibc 到一个不再受此困扰的版本。
{{< note >}}
<!--
With [Expanded DNS Configuration](/docs/concepts/services-networking/dns-pod-service/#expanded-dns-configuration),
Kubernetes allows more DNS `search` records.
-->
使用[扩展 DNS 设置](/zh/docs/concepts/services-networking/dns-pod-service/#expanded-dns-configuration)
Kubernetes 允许更多的 `search` 记录。
{{< /note >}}
<!-- <!--
If you are using Alpine version 3.3 or earlier as your base image, DNS may not If you are using Alpine version 3.3 or earlier as your base image, DNS may not
work properly owing to a known issue with Alpine. work properly owing to a known issue with Alpine.
@@ -262,45 +262,131 @@ curl -L https://github.com/kubernetes-sigs/sig-windows-tools/releases/latest/dow
<!-- <!--
### Joining a Windows worker node ### Joining a Windows worker node
You must install the `Containers` feature and install Docker. Instructions
to do so are available at [Install Docker Engine - Enterprise on Windows Servers](https://docs.mirantis.com/docker-enterprise/v3.1/dockeree-products/docker-engine-enterprise/dee-windows.html).
All code snippets in Windows sections are to be run in a PowerShell environment
with elevated permissions (Administrator) on the Windows worker node.
--> -->
### 加入 Windows 工作节点 {#joining-a-windows-worker-node} ### 加入 Windows 工作节点 {#joining-a-windows-worker-node}
你必须安装 `Containers` 功能特性并安装 Docker 工具。相关的指令可以在 {{< note >}}
[Install Docker Engine - Enterprise on Windows Servers](https://hub.docker.com/editions/enterprise/docker-ee-server-windows) <!--
处找到。 All code snippets in Windows sections are to be run in a PowerShell environment
with elevated permissions (Administrator) on the Windows worker node.
-->
Windows 节的所有代码片段都需要在 PowerShell 环境中执行,并且要求在 Windows 节的所有代码片段都需要在 PowerShell 环境中执行,并且要求在
Windows 工作节点上具有提升的权限(Administrator)。 Windows 工作节点上具有提升的权限(Administrator)。
{{< /note >}}
{{< tabs name="tab-windows-kubeadm-runtime-installation" >}}
{{% tab name="Docker EE" %}}
<!-- <!--
1. Install wins, kubelet, and kubeadm. #### Install Docker EE
Install the `Containers` feature
--> -->
1. 安装 wins、kubelet 和 kubeadm #### 安装 Docker EE
```powershell
Install-WindowsFeature -Name containers
```
<!--
Install Docker
Instructions to do so are available at [Install Docker Engine - Enterprise on Windows Servers](https://hub.docker.com/editions/enterprise/docker-ee-server-windows).
-->
安装 Docker
操作指南在 [Install Docker Engine - Enterprise on Windows Servers](https://hub.docker.com/editions/enterprise/docker-ee-server-windows)。
<!--
#### Install wins, kubelet, and kubeadm.
-->
#### 安装 wins、kubelet 和 kubeadm
```PowerShell ```PowerShell
curl.exe -LO https://github.com/kubernetes-sigs/sig-windows-tools/releases/latest/download/PrepareNode.ps1 curl.exe -LO https://raw.githubusercontent.com/kubernetes-sigs/sig-windows-tools/master/kubeadm/scripts/PrepareNode.ps1
.\PrepareNode.ps1 -KubernetesVersion {{< param "fullversion" >}} .\PrepareNode.ps1 -KubernetesVersion {{< param "fullversion" >}}
``` ```
<!-- <!--
1. Run `kubeadm` to join the node #### Run `kubeadm` to join the node
Use the command that was given to you when you ran `kubeadm init` on a control plane host. Use the command that was given to you when you ran `kubeadm init` on a control plane host.
If you no longer have this command, or the token has expired, you can run `kubeadm token create -print-join-command` If you no longer have this command, or the token has expired, you can run `kubeadm token create -print-join-command`
(on a control plane host) to generate a new token and join command. (on a control plane host) to generate a new token and join command.
--> -->
2. 运行 `kubeadm` 添加节点 #### 运行 `kubeadm` 添加节点
当你在控制面主机上运行 `kubeadm init` 时,输出了一个命令。现在运行这个命令。 当你在控制面主机上运行 `kubeadm init` 时,输出了一个命令。现在运行这个命令。
如果你找不到这个命令,或者命令中对应的令牌已经过期,你可以(在一个控制面主机上)运行 如果你找不到这个命令,或者命令中对应的令牌已经过期,你可以(在一个控制面主机上)运行
`kubeadm token create --print-join-command` 来生成新的令牌和 join 命令。 `kubeadm token create --print-join-command` 来生成新的令牌和 join 命令。
{{% /tab %}}
{{% tab name="CRI-containerD" %}}
<!--
#### Install containerD
-->
#### 安装 containerD
```powershell
curl.exe -LO https://github.com/kubernetes-sigs/sig-windows-tools/releases/latest/download/Install-Containerd.ps1
.\Install-Containerd.ps1
```
{{< note >}}
<!--
To install a specific version of containerD specify the version with -ContainerDVersion.
-->
要安装特定版本的 containerD,使用参数 -ContainerDVersion指定版本。
```powershell
# Example
.\Install-Containerd.ps1 -ContainerDVersion 1.4.1
```
{{< /note >}}
{{< note >}}
<!--
If you're using a different interface rather than Ethernet (i.e. "Ethernet0 2") on the Windows nodes, specify the name with `-netAdapterName`.
-->
如果你在 Windows 节点上使用了与 Ethernet 不同的接口(例如 "Ethernet0 2"),使用参数 `-netAdapterName` 指定名称。
```powershell
# Example
.\Install-Containerd.ps1 -netAdapterName "Ethernet0 2"
```
{{< /note >}}
<!--
#### Install wins, kubelet, and kubeadm
-->
#### 安装 winskubelet 和 kubeadm
```PowerShell
curl.exe -LO https://raw.githubusercontent.com/kubernetes-sigs/sig-windows-tools/master/kubeadm/scripts/PrepareNode.ps1
.\PrepareNode.ps1 -KubernetesVersion {{< param "fullversion" >}} -ContainerRuntime containerD
```
<!--
#### Run `kubeadm` to join the node
Use the command that was given to you when you ran `kubeadm init` on a control plane host.
If you no longer have this command, or the token has expired, you can run `kubeadm token create --print-join-command`
(on a control plane host) to generate a new token and join command.
-->
#### 运行 `kubeadm` 添加节点
使用当你在控制面主机上运行 `kubeadm init` 时得到的命令。
如果你找不到这个命令,或者命令中对应的令牌已经过期,你可以(在一个控制面主机上)运行
`kubeadm token create --print-join-command` 来生成新的令牌和 join 命令。
{{< note >}}
If using **CRI-containerD** add `--cri-socket "npipe:////./pipe/containerd-containerd"` to the kubeadm call
{{< /note >}}
{{% /tab %}}
{{< /tabs >}}
<!-- <!--
#### Verifying your installation #### Verifying your installation
@@ -62,14 +62,12 @@ kubeadm 支持在执行 `kubeadm init` 时,传递一个 `KubeletConfiguration`
`KubeletConfiguration` 包含 `cgroupDriver` 字段,可用于控制 kubelet 的 cgroup 驱动。 `KubeletConfiguration` 包含 `cgroupDriver` 字段,可用于控制 kubelet 的 cgroup 驱动。
<!-- <!--
If the user is not setting the `cgroupDriver` field under `KubeletConfiguration`, In v1.22, if the user is not setting the `cgroupDriver` field under `KubeletConfiguration`,
`kubeadm init` will default it to `systemd`. `kubeadm init` will default it to `systemd`.
--> -->
{{< feature-state for_k8s_version="v1.21" state="stable" >}}
{{< note >}} {{< note >}}
如果用户没有在 `KubeletConfiguration` 中设置 `cgroupDriver` 字段, 在版本 1.22 中,如果用户没有在 `KubeletConfiguration` 中设置 `cgroupDriver` 字段,
`kubeadm init` 会将它设置为默认值 `systemd` `kubeadm init` 会将它设置为默认值 `systemd`
{{< /note >}} {{< /note >}}
@@ -81,7 +79,7 @@ A minimal example of configuring the field explicitly:
```yaml ```yaml
# kubeadm-config.yaml # kubeadm-config.yaml
kind: ClusterConfiguration kind: ClusterConfiguration
apiVersion: kubeadm.k8s.io/v1beta2 apiVersion: kubeadm.k8s.io/v1beta3
kubernetesVersion: v1.21.0 kubernetesVersion: v1.21.0
--- ---
kind: KubeletConfiguration kind: KubeletConfiguration
@@ -235,9 +235,27 @@ You can renew your certificates manually at any time with the `kubeadm certs ren
<!-- <!--
This command performs the renewal using CA (or front-proxy-CA) certificate and key stored in `/etc/kubernetes/pki`. This command performs the renewal using CA (or front-proxy-CA) certificate and key stored in `/etc/kubernetes/pki`.
After running the command you should restart the control plane Pods. This is required since
dynamic certificate reload is currently not supported for all components and certificates.
[Static Pods](/docs/tasks/configure-pod-container/static-pod/) are managed by the local kubelet
and not by the API Server, thus kubectl cannot be used to delete and restart them.
To restart a static Pod you can temporarily remove its manifest file from `/etc/kubernetes/manifests/`
and wait for 20 seconds (see the `fileCheckFrequency` value in [KubeletConfiguration struct](/docs/reference/config-api/kubelet-config.v1beta1/).
The kubelet will terminate the Pod if it's no longer in the manifest directory.
You can then move the file back and after another `fileCheckFrequency` period, the kubelet will recreate
the Pod and the certificate renewal for the component can complete.
--> -->
此命令用 CA (或者 front-proxy-CA )证书和存储在 `/etc/kubernetes/pki` 中的密钥执行更新。 此命令用 CA (或者 front-proxy-CA )证书和存储在 `/etc/kubernetes/pki` 中的密钥执行更新。
执行完此命令之后你需要重启控制面 Pods。因为动态证书重载目前还不被所有组件和证书支持,所有这项操作是必须的。
[静态 Pods](/zh/docs/tasks/configure-pod-container/static-pod/) 是被本地 kubelet 而不是 API Server 管理,
所以 kubectl 不能用来删除或重启他们。
要重启静态 Pod 你可以临时将清单文件从 `/etc/kubernetes/manifests/` 移除并等待 20 秒
(参考 [KubeletConfiguration 结构](/docs/reference/config-api/kubelet-config.v1beta1/) 中的`fileCheckFrequency` 值)。
如果 Pod 不在清单目录里,kubelet将会终止它。
在另一个 `fileCheckFrequency` 周期之后你可以将文件移回去,为了组件可以完成 kubelet 将重新创建 Pod 和证书更新。
<!-- <!--
If you are running an HA cluster, this command needs to be executed on all the control-plane nodes. If you are running an HA cluster, this command needs to be executed on all the control-plane nodes.
--> -->
@@ -311,13 +329,13 @@ Kubernetes 证书颁发机构不是开箱即用。
要激活内置签名者,请传递 `--cluster-signing-cert-file``--cluster-signing-key-file` 参数。 要激活内置签名者,请传递 `--cluster-signing-cert-file``--cluster-signing-key-file` 参数。
<!-- <!--
If you're creating a new cluster, you can use a kubeadm [configuration file](/docs/reference/config-api/kubeadm-config.v1beta2/): If you're creating a new cluster, you can use a kubeadm [configuration file](https://godoc.org/k8s.io/kubernetes/cmd/kubeadm/app/apis/kubeadm/v1beta3):
--> -->
如果你正在创建一个新的集群,你可以使用 kubeadm 的 如果你正在创建一个新的集群,你可以使用 kubeadm 的
[配置文件](/docs/reference/config-api/kubeadm-config.v1beta2/)。 [配置文件](/docs/reference/config-api/kubeadm-config.v1beta3/)。
```yaml ```yaml
apiVersion: kubeadm.k8s.io/v1beta2 apiVersion: kubeadm.k8s.io/v1beta3
kind: ClusterConfiguration kind: ClusterConfiguration
controllerManager: controllerManager:
extraArgs: extraArgs:
@@ -441,7 +459,7 @@ certificates you must pass the following minimal configuration to `kubeadm init`
你必须向 `kubeadm init` 传递如下最小配置数据: 你必须向 `kubeadm init` 传递如下最小配置数据:
```yaml ```yaml
apiVersion: kubeadm.k8s.io/v1beta2 apiVersion: kubeadm.k8s.io/v1beta3
kind: ClusterConfiguration kind: ClusterConfiguration
--- ---
apiVersion: kubelet.config.k8s.io/v1beta1 apiVersion: kubelet.config.k8s.io/v1beta1