Merge pull request #43286 from my-git9/path-20283

[zh-cn] sync tasks/tools/* and manage-kubernetes-objects/*
pull/43299/head
Kubernetes Prow Robot 2023-10-03 13:04:52 +02:00 committed by GitHub
commit 7ebd141178
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 45 deletions

View File

@ -135,7 +135,7 @@ Here's an example of an object configuration file:
-->
下面是一个对象配置文件示例:
{{% code file="application/simple_deployment.yaml" %}}
{{% code_sample file="application/simple_deployment.yaml" %}}
<!--
Run `kubectl diff` to print the object that will be created:
@ -277,7 +277,7 @@ Here's an example configuration file:
-->
下面是一个配置文件示例:
{{% code file="application/simple_deployment.yaml" %}}
{{% code_sample file="application/simple_deployment.yaml" %}}
<!--
Create the object using `kubectl apply`:
@ -444,7 +444,7 @@ Update the `simple_deployment.yaml` configuration file to change the image from
现在更新 `simple_deployment.yaml` 配置文件,将镜像文件从
`nginx:1.14.2` 更改为 `nginx:1.16.1`,同时删除`minReadySeconds` 字段:
{{% code file="application/update_deployment.yaml" %}}
{{% code_sample file="application/update_deployment.yaml" %}}
<!--
Apply the changes made to the configuration file:
@ -872,7 +872,7 @@ Here's an example. Suppose this is the configuration file for a Deployment objec
下面是一个例子。假定此文件是某 Deployment 对象的配置文件:
{{% code file="application/update_deployment.yaml" %}}
{{% code_sample file="application/update_deployment.yaml" %}}
<!--
Also, suppose this is the live configuration for the same Deployment object:
@ -1426,7 +1426,7 @@ API 服务器会在对象创建时其中某些字段未设置的情况下在现
下面是一个 Deployment 的配置文件。文件未设置 `strategy`
{{% code file="application/simple_deployment.yaml" %}}
{{% code_sample file="application/simple_deployment.yaml" %}}
<!--
Create the object using `kubectl apply`:

View File

@ -37,7 +37,7 @@ is a Pod that has one container:
下面是具有两个副本的 Deployment 的配置文件。每个副本是一个 Pod有一个容器
{{% code file="application/deployment-patch.yaml" %}}
{{% code_sample file="application/deployment-patch.yaml" %}}
<!--
Create the Deployment:
@ -418,7 +418,7 @@ Here's the configuration file for a Deployment that uses the `RollingUpdate` str
-->
## 使用带 retainKeys 策略的策略合并 patch 更新 Deployment {#use-strategic-merge-patch-to-update-a-deployment-using-the-retainkeys-strategy}
{{% code file="application/deployment-retainkeys.yaml" %}}
{{% code_sample file="application/deployment-retainkeys.yaml" %}}
<!--
Create the deployment:
@ -651,7 +651,7 @@ Deployment 是支持这些子资源的其中一个例子。
下面是有两个副本的 Deployment 的清单。
{{% code file="application/deployment.yaml" %}}
{{% code_sample file="application/deployment.yaml" %}}
<!--
Create the Deployment:
@ -794,4 +794,3 @@ Strategic merge patch is not supported for custom resources.
* [使用指令式命令管理 Kubernetes 对象](/zh-cn/docs/tasks/manage-kubernetes-objects/imperative-command/)
* [使用配置文件对 Kubernetes 对象进行命令式管理](/zh-cn/docs/tasks/manage-kubernetes-objects/imperative-config/)
* [使用配置文件对 Kubernetes 对象进行声明式管理](/zh-cn/docs/tasks/manage-kubernetes-objects/declarative-config/)

View File

@ -56,10 +56,10 @@ The following methods exist for installing kubectl on Linux:
{{< tabs name="download_binary_linux" >}}
{{< tab name="x86-64" codelang="bash" >}}
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
{{< /tab >}}
{{< tab name="ARM64" codelang="bash" >}}
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl.sha256"
{{< /tab >}}
{{< /tabs >}}
@ -241,7 +241,10 @@ Or use this for detailed view of version:
{{< note >}}
<!--
To upgrade kubectl to another minor release, you'll need to bump the version in `/etc/apt/sources.list.d/kubernetes.list` before running `apt-get update` and `apt-get upgrade`. This procedure is described in more detail in [Changing The Kubernetes Package Repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/).
To upgrade kubectl to another minor release, you'll need to bump the version in
`/etc/apt/sources.list.d/kubernetes.list` before running `apt-get update` and
`apt-get upgrade`. This procedure is described in more detail in
[Changing The Kubernetes Package Repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/).
-->
要升级 kubectl 到别的次要版本,你需要先升级 `/etc/apt/sources.list.d/kubernetes.list` 中的版本,
再运行 `apt-get update``apt-get upgrade`
@ -279,30 +282,30 @@ In releases older than Debian 12 and Ubuntu 22.04, `/etc/apt/keyrings` does not
1. 添加 Kubernetes 的 `yum` 仓库。如果你想使用 {{< param "version" >}} 之外的 Kubernetes 版本,
将下面命令中的 {{< param "version" >}} 替换为所需的次要版本。
<!--
```bash
# This overwrites any existing configuration in /etc/yum.repos.d/kubernetes.repo
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
EOF
```
-->
```bash
# 这会覆盖 /etc/yum.repos.d/kubernetes.repo 中现存的所有配置
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
EOF
```
<!--
```bash
# This overwrites any existing configuration in /etc/yum.repos.d/kubernetes.repo
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
EOF
```
-->
```bash
# 这会覆盖 /etc/yum.repos.d/kubernetes.repo 中现存的所有配置
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
enabled=1
gpgcheck=1
gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
EOF
```
{{< note >}}
<!--
@ -314,13 +317,13 @@ To upgrade kubectl to another minor release, you'll need to bump the version in
{{< /note >}}
<!--
1. Install kubectl using `yum`:
2. Install kubectl using `yum`:
-->
1. 使用 `yum` 安装 kubectl
2. 使用 `yum` 安装 kubectl
```bash
sudo yum install -y kubectl
```
```bash
sudo yum install -y kubectl
```
{{% /tab %}}
{{< /tabs >}}
@ -430,10 +433,10 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
{{< tabs name="download_convert_checksum_linux" >}}
{{< tab name="x86-64" codelang="bash" >}}
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl-convert.sha256"
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl-convert.sha256"
{{< /tab >}}
{{< tab name="ARM64" codelang="bash" >}}
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl-convert.sha256"
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl-convert.sha256"
{{< /tab >}}
{{< /tabs >}}

View File

@ -398,7 +398,7 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
<!--
Make sure `/usr/local/bin` is in your PATH environment variable.
-->
确保你的 PATH 环境变量中存在 `/usr/local/bin`
确保你的 PATH 环境变量中存在 `/usr/local/bin`
{{< /note >}}
<!--
@ -443,7 +443,7 @@ Depending on how you installed `kubectl`, use one of the following methods.
1. 找到你系统上的 `kubectl` 可执行文件:
```bash
where kubectl
which kubectl
```
<!--