Skip to content

Commit 6721290

Browse files
committed
[zh-cn] sync tasks/tools/* and manage-kubernetes-objects/*
Signed-off-by: xin.li <[email protected]>
1 parent 91c23ee commit 6721290

File tree

4 files changed

+47
-45
lines changed

4 files changed

+47
-45
lines changed

content/zh-cn/docs/tasks/manage-kubernetes-objects/declarative-config.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Here's an example of an object configuration file:
135135
-->
136136
下面是一个对象配置文件示例:
137137

138-
{{% code file="application/simple_deployment.yaml" %}}
138+
{{% code_sample file="application/simple_deployment.yaml" %}}
139139

140140
<!--
141141
Run `kubectl diff` to print the object that will be created:
@@ -277,7 +277,7 @@ Here's an example configuration file:
277277
-->
278278
下面是一个配置文件示例:
279279

280-
{{% code file="application/simple_deployment.yaml" %}}
280+
{{% code_sample file="application/simple_deployment.yaml" %}}
281281

282282
<!--
283283
Create the object using `kubectl apply`:
@@ -444,7 +444,7 @@ Update the `simple_deployment.yaml` configuration file to change the image from
444444
现在更新 `simple_deployment.yaml` 配置文件,将镜像文件从
445445
`nginx:1.14.2` 更改为 `nginx:1.16.1`,同时删除`minReadySeconds` 字段:
446446

447-
{{% code file="application/update_deployment.yaml" %}}
447+
{{% code_sample file="application/update_deployment.yaml" %}}
448448

449449
<!--
450450
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
872872

873873
下面是一个例子。假定此文件是某 Deployment 对象的配置文件:
874874

875-
{{% code file="application/update_deployment.yaml" %}}
875+
{{% code_sample file="application/update_deployment.yaml" %}}
876876

877877
<!--
878878
Also, suppose this is the live configuration for the same Deployment object:
@@ -1426,7 +1426,7 @@ API 服务器会在对象创建时其中某些字段未设置的情况下在现
14261426

14271427
下面是一个 Deployment 的配置文件。文件未设置 `strategy`:
14281428

1429-
{{% code file="application/simple_deployment.yaml" %}}
1429+
{{% code_sample file="application/simple_deployment.yaml" %}}
14301430

14311431
<!--
14321432
Create the object using `kubectl apply`:

content/zh-cn/docs/tasks/manage-kubernetes-objects/update-api-object-kubectl-patch.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ is a Pod that has one container:
3737

3838
下面是具有两个副本的 Deployment 的配置文件。每个副本是一个 Pod,有一个容器:
3939

40-
{{% code file="application/deployment-patch.yaml" %}}
40+
{{% code_sample file="application/deployment-patch.yaml" %}}
4141

4242
<!--
4343
Create the Deployment:
@@ -418,7 +418,7 @@ Here's the configuration file for a Deployment that uses the `RollingUpdate` str
418418
-->
419419
## 使用带 retainKeys 策略的策略合并 patch 更新 Deployment {#use-strategic-merge-patch-to-update-a-deployment-using-the-retainkeys-strategy}
420420

421-
{{% code file="application/deployment-retainkeys.yaml" %}}
421+
{{% code_sample file="application/deployment-retainkeys.yaml" %}}
422422

423423
<!--
424424
Create the deployment:
@@ -651,7 +651,7 @@ Deployment 是支持这些子资源的其中一个例子。
651651

652652
下面是有两个副本的 Deployment 的清单。
653653

654-
{{% code file="application/deployment.yaml" %}}
654+
{{% code_sample file="application/deployment.yaml" %}}
655655

656656
<!--
657657
Create the Deployment:
@@ -794,4 +794,3 @@ Strategic merge patch is not supported for custom resources.
794794
* [使用指令式命令管理 Kubernetes 对象](/zh-cn/docs/tasks/manage-kubernetes-objects/imperative-command/)
795795
* [使用配置文件对 Kubernetes 对象进行命令式管理](/zh-cn/docs/tasks/manage-kubernetes-objects/imperative-config/)
796796
* [使用配置文件对 Kubernetes 对象进行声明式管理](/zh-cn/docs/tasks/manage-kubernetes-objects/declarative-config/)
797-

content/zh-cn/docs/tasks/tools/install-kubectl-linux.md

Lines changed: 37 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ The following methods exist for installing kubectl on Linux:
5656

5757
{{< tabs name="download_binary_linux" >}}
5858
{{< tab name="x86-64" codelang="bash" >}}
59-
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
59+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
6060
{{< /tab >}}
6161
{{< tab name="ARM64" codelang="bash" >}}
62-
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"
62+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl.sha256"
6363
{{< /tab >}}
6464
{{< /tabs >}}
6565

@@ -241,7 +241,10 @@ Or use this for detailed view of version:
241241

242242
{{< note >}}
243243
<!--
244-
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/).
244+
To upgrade kubectl to another minor release, you'll need to bump the version in
245+
`/etc/apt/sources.list.d/kubernetes.list` before running `apt-get update` and
246+
`apt-get upgrade`. This procedure is described in more detail in
247+
[Changing The Kubernetes Package Repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/).
245248
-->
246249
要升级 kubectl 到别的次要版本,你需要先升级 `/etc/apt/sources.list.d/kubernetes.list` 中的版本,
247250
再运行 `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
279282
1. 添加 Kubernetes 的 `yum` 仓库。如果你想使用 {{< param "version" >}} 之外的 Kubernetes 版本,
280283
将下面命令中的 {{< param "version" >}} 替换为所需的次要版本。
281284

282-
<!--
283-
```bash
284-
# This overwrites any existing configuration in /etc/yum.repos.d/kubernetes.repo
285-
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
286-
[kubernetes]
287-
name=Kubernetes
288-
baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
289-
enabled=1
290-
gpgcheck=1
291-
gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
292-
EOF
293-
```
294-
-->
295-
```bash
296-
# 这会覆盖 /etc/yum.repos.d/kubernetes.repo 中现存的所有配置
297-
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
298-
[kubernetes]
299-
name=Kubernetes
300-
baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
301-
enabled=1
302-
gpgcheck=1
303-
gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
304-
EOF
305-
```
285+
<!--
286+
```bash
287+
# This overwrites any existing configuration in /etc/yum.repos.d/kubernetes.repo
288+
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
289+
[kubernetes]
290+
name=Kubernetes
291+
baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
292+
enabled=1
293+
gpgcheck=1
294+
gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
295+
EOF
296+
```
297+
-->
298+
```bash
299+
# 这会覆盖 /etc/yum.repos.d/kubernetes.repo 中现存的所有配置
300+
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
301+
[kubernetes]
302+
name=Kubernetes
303+
baseurl=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/
304+
enabled=1
305+
gpgcheck=1
306+
gpgkey=https://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
307+
EOF
308+
```
306309
307310
{{< note >}}
308311
<!--
@@ -314,13 +317,13 @@ To upgrade kubectl to another minor release, you'll need to bump the version in
314317
{{< /note >}}
315318
316319
<!--
317-
1. Install kubectl using `yum`:
320+
2. Install kubectl using `yum`:
318321
-->
319-
1. 使用 `yum` 安装 kubectl:
322+
2. 使用 `yum` 安装 kubectl:
320323
321-
```bash
322-
sudo yum install -y kubectl
323-
```
324+
```bash
325+
sudo yum install -y kubectl
326+
```
324327
325328
{{% /tab %}}
326329
{{< /tabs >}}
@@ -430,10 +433,10 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
430433
431434
{{< tabs name="download_convert_checksum_linux" >}}
432435
{{< tab name="x86-64" codelang="bash" >}}
433-
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl-convert.sha256"
436+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl-convert.sha256"
434437
{{< /tab >}}
435438
{{< tab name="ARM64" codelang="bash" >}}
436-
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl-convert.sha256"
439+
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl-convert.sha256"
437440
{{< /tab >}}
438441
{{< /tabs >}}
439442

content/zh-cn/docs/tasks/tools/install-kubectl-macos.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ kubectl 为 Bash、Zsh、Fish 和 PowerShell 提供自动补全功能,可以
398398
<!--
399399
Make sure `/usr/local/bin` is in your PATH environment variable.
400400
-->
401-
确保你的 PATH 环境变量中存在 `/usr/local/bin`
401+
确保你的 PATH 环境变量中存在 `/usr/local/bin`
402402
{{< /note >}}
403403

404404
<!--
@@ -443,7 +443,7 @@ Depending on how you installed `kubectl`, use one of the following methods.
443443
1. 找到你系统上的 `kubectl` 可执行文件:
444444

445445
```bash
446-
where kubectl
446+
which kubectl
447447
```
448448

449449
<!--

0 commit comments

Comments
 (0)