Skip to content

Commit 65bc0c7

Browse files
committed
[zh-cn] sync install-kubectl-linux pull-image-private-registry configure-pod-configmap
Signed-off-by: xin.li <xin.li@daocloud.io>
1 parent 2df0642 commit 65bc0c7

File tree

3 files changed

+64
-44
lines changed

3 files changed

+64
-44
lines changed

content/zh-cn/docs/tasks/configure-pod-container/configure-pod-configmap.md

Lines changed: 32 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ The name of a ConfigMap object must be a valid
9999
-->
100100
其中,`<映射名称>` 是为 ConfigMap 指定的名称,`<数据源>` 是要从中提取数据的目录、
101101
文件或者字面值。ConfigMap 对象的名称必须是合法的
102-
[DNS 子域名](/zh-cn/docs/concepts/overview/working-with-objects/names#dns-subdomain-names).
102+
[DNS 子域名](/zh-cn/docs/concepts/overview/working-with-objects/names#dns-subdomain-names)
103103

104104
<!--
105105
When you are creating a ConfigMap based on a file, the key in the \<data-source> defaults to
@@ -140,7 +140,7 @@ If you use `kubectl create configmap` with a directory where any of the file nam
140140
an unacceptable character, the `kubectl` command may fail.
141141
-->
142142
用于创建 ConfigMap 的每个文件名必须由可接受的字符组成,即:字母(`A``Z`
143-
`a``z`)、数字(`0``9`)、'-'、'_''.'。
143+
`a``z`)、数字(`0``9`)、'-'、'_''.'。
144144
如果在一个目录中使用 `kubectl create configmap`,而其中任一文件名包含不可接受的字符,
145145
`kubectl` 命令可能会失败。
146146

@@ -241,7 +241,7 @@ kubectl get configmaps game-config -o yaml
241241
<!--
242242
The output is similar to this:
243243
-->
244-
输出类似以下内容:
244+
输出类似以下内容
245245

246246
```yaml
247247
apiVersion: v1
@@ -289,7 +289,7 @@ kubectl create configmap game-config-2 --from-file=configure-pod-container/confi
289289
<!--
290290
would produce the following ConfigMap:
291291
-->
292-
将产生以下 ConfigMap:
292+
将产生以下 ConfigMap
293293

294294
```shell
295295
kubectl describe configmaps game-config-2
@@ -298,7 +298,7 @@ kubectl describe configmaps game-config-2
298298
<!--
299299
where the output is similar to this:
300300
-->
301-
输出类似以下内容:
301+
输出类似以下内容
302302

303303
```
304304
Name: game-config-2
@@ -341,7 +341,7 @@ kubectl describe configmaps game-config-2
341341
<!--
342342
The output is similar to this:
343343
-->
344-
输出类似以下内容:
344+
输出类似以下内容
345345

346346
```
347347
Name: game-config-2
@@ -466,7 +466,7 @@ kubectl create configmap config-multi-env-files \
466466
<!--
467467
would produce the following ConfigMap:
468468
-->
469-
将产生以下 ConfigMap:
469+
将产生以下 ConfigMap
470470

471471
```shell
472472
kubectl get configmap config-multi-env-files -o yaml
@@ -475,7 +475,7 @@ kubectl get configmap config-multi-env-files -o yaml
475475
<!--
476476
where the output is similar to this:
477477
-->
478-
输出类似以下内容:
478+
输出类似以下内容
479479

480480
```yaml
481481
apiVersion: v1
@@ -524,7 +524,7 @@ location of the data source file you want the key to represent.
524524
<!--
525525
For example:
526526
-->
527-
例如:
527+
例如
528528

529529
```shell
530530
kubectl create configmap game-config-3 --from-file=game-special-key=configure-pod-container/configmap/game.properties
@@ -533,7 +533,7 @@ kubectl create configmap game-config-3 --from-file=game-special-key=configure-po
533533
<!--
534534
would produce the following ConfigMap:
535535
-->
536-
将产生以下 ConfigMap:
536+
将产生以下 ConfigMap
537537

538538
```shell
539539
kubectl get configmaps game-config-3 -o yaml
@@ -592,7 +592,7 @@ kubectl get configmaps special-config -o yaml
592592
<!--
593593
The output is similar to this:
594594
-->
595-
输出类似以下内容:
595+
输出类似以下内容
596596

597597
```yaml
598598
apiVersion: v1
@@ -834,7 +834,7 @@ section, and learn how to use these objects with Pods.
834834
<!--
835835
1. Define an environment variable as a key-value pair in a ConfigMap:
836836
-->
837-
1. 在 ConfigMap 中将环境变量定义为键值对:
837+
1. 在 ConfigMap 中将环境变量定义为键值对
838838

839839
```shell
840840
kubectl create configmap special-config --from-literal=special.how=very
@@ -879,7 +879,7 @@ Here is the manifest you will use:
879879
<!--
880880
* Create the ConfigMap:
881881
-->
882-
* 创建 ConfigMap:
882+
* 创建 ConfigMap
883883

884884
```shell
885885
kubectl create -f http://kubernetes.io/examples/configmap/configmaps.yaml
@@ -1000,7 +1000,8 @@ kubectl create -f http://kubernetes.io/examples/pods/pod-configmap-env-var-valu
10001000
<!--
10011001
That pod produces the following output from the `test-container` container:
10021002
-->
1003-
此 Pod 在 `test-container` 容器中产生以下输出:
1003+
此 Pod 在 `test-container` 容器中产生以下输出:
1004+
10041005
```shell
10051006
kubectl logs dapi-test-pod
10061007
```
@@ -1161,11 +1162,21 @@ kubectl delete pod dapi-test-pod --now
11611162
<!--
11621163
### Project keys to specific paths and file permissions
11631164
1164-
You can project keys to specific paths and specific permissions on a per-file
1165-
basis. The
1166-
[Secrets](/docs/concepts/configuration/secret/#using-secrets-as-files-from-a-pod)
1167-
guide explains the syntax.
1168-
-->
1165+
You can project keys to specific paths.
1166+
Refer to the corresponding section in the
1167+
[Secrets](/docs/tasks/inject-data-application/distribute-credentials-secure/#project-secret-keys-to-specific-file-paths)
1168+
guide for the syntax.
1169+
You can set POSIX permissions for keys.
1170+
Refer to the corresponding section in the
1171+
[Secrets](/docs/tasks/inject-data-application/distribute-credentials-secure/#set-posix-permissions-for-secret-keys)
1172+
guide for the syntax.
1173+
-->
1174+
你可以将密钥投射到特定路径,语法请参阅
1175+
[Secret](/zh-cn/docs/tasks/inject-data-application/distribute-credentials-secure/#project-secret-keys-to-specific-file-paths)
1176+
指南中的相应部分。
1177+
你可以设置密钥的 POSIX 权限,语法请参阅
1178+
[Secret](/docs/tasks/inject-data-application/distribute-credentials-secure/#set-posix-permissions-for-secret-keys)
1179+
指南中的相应部分。
11691180

11701181
### 映射键到指定路径并设置文件访问权限 {#project-keys-to-specific-paths-and-file-permissions}
11711182

@@ -1211,7 +1222,7 @@ can trigger an immediate refresh by updating one of the pod's annotations.
12111222
Kubelet 在每次定期同步时都会检查所挂载的 ConfigMap 是否是最新的。
12121223
然而,它使用其基于 TTL 机制的本地缓存来获取 ConfigMap 的当前值。
12131224
因此,从 ConfigMap 更新到新键映射到 Pod 的总延迟可能与 kubelet
1214-
同步周期(默认为1分钟)+ kubelet 中 ConfigMap 缓存的 TTL(默认为1分钟)一样长。
1225+
同步周期(默认为 1 分钟)+ kubelet 中 ConfigMap 缓存的 TTL(默认为 1 分钟)一样长。
12151226
你可以通过更新 Pod 的一个注解来触发立即刷新。
12161227

12171228
{{< note >}}
@@ -1437,7 +1448,7 @@ spec:
14371448
-->
14381449
- 如果你使用 `envFrom` 来基于 ConfigMap 定义环境变量,那么无效的键将被忽略。
14391450
Pod 可以被启动,但无效名称将被记录在事件日志中(`InvalidVariableNames`)。
1440-
日志消息列出了每个被跳过的键。例如:
1451+
日志消息列出了每个被跳过的键。例如
14411452

14421453
```shell
14431454
kubectl get events

content/zh-cn/docs/tasks/configure-pod-container/pull-image-private-registry.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ weight: 130
1313

1414
<!--
1515
This page shows how to create a Pod that uses a
16-
{{< glossary_tooltip text="Secret" term_id="secret" >}} to pull an image
17-
from a private container image registry or repository. There are many private
16+
{{< glossary_tooltip text="Secret" term_id="secret" >}} to pull an image
17+
from a private container image registry or repository. There are many private
1818
registries in use. This task uses [Docker Hub](http://www.docker.com/products/docker-hub)
1919
as an example registry.
2020
-->
@@ -32,8 +32,8 @@ as an example registry.
3232
<!--
3333
* To do this exercise, you need the `docker` command line tool, and a
3434
[Docker ID](http://docs.docker.com/docker-id/) for which you know the password.
35-
* If you are using a different private container registry, you need the command
36-
line tool for that registry and any login information for the registry.
35+
* If you are using a different private container registry, you need the command
36+
line tool for that registry and any login information for the registry.
3737
-->
3838
* 要进行此练习,你需要 `docker` 命令行工具和一个知道密码的
3939
[Docker ID](http://docs.docker.com/docker-id/)

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

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -217,10 +217,24 @@ Or use this for detailed view of version:
217217
2. 下载 Kubernetes 软件包仓库的公共签名密钥。
218218
同一个签名密钥适用于所有仓库,因此你可以忽略 URL 中的版本信息:
219219

220+
<!--
221+
# If the folder `/etc/apt/keyrings` does not exist, it should be created before the curl command, read the note below.
222+
# sudo mkdir -p -m 755 /etc/apt/keyrings
223+
-->
220224
```shell
225+
# 如果 `/etc/apt/keyrings` 目录不存在,则应在 curl 命令之前创建它,请阅读下面的注释。
226+
# sudo mkdir -p -m 755 /etc/apt/keyrings
221227
curl -fsSL http://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg
222228
```
223229

230+
{{< note >}}
231+
<!--
232+
In releases older than Debian 12 and Ubuntu 22.04, folder `/etc/apt/keyrings` does not exist by default, and it should be created before the curl command.
233+
-->
234+
在低于 Debian 12 和 Ubuntu 22.04 的发行版本中,`/etc/apt/keyrings` 默认不存在。
235+
应在 curl 命令之前创建它。
236+
{{< /note >}}
237+
224238
<!--
225239
3. Add the appropriate Kubernetes `apt` repository. If you want to use Kubernetes version different than {{< param "version" >}},
226240
replace {{< param "version" >}} with the desired minor version in the command below:
@@ -262,14 +276,6 @@ Or use this for detailed view of version:
262276
sudo apt-get install -y kubectl
263277
```
264278

265-
{{< note >}}
266-
<!--
267-
In releases older than Debian 12 and Ubuntu 22.04, `/etc/apt/keyrings` does not exist by default, and can be created using `sudo mkdir -m 755 /etc/apt/keyrings`
268-
-->
269-
在低于 Debian 12 和 Ubuntu 22.04 的发行版本中,`/etc/apt/keyrings` 默认不存在。
270-
可以使用 `sudo mkdir -m 755 /etc/apt/keyrings` 来创建。
271-
{{< /note >}}
272-
273279
{{% /tab %}}
274280

275281
{{% tab name="基于 Red Hat 的发行版" %}}
@@ -334,7 +340,8 @@ different than {{< param "version" >}}, replace {{< param "version" >}} with
334340
the desired minor version in the command below.
335341
-->
336342
337-
1. 添加 Kubernetes `zypper` 软件源。如果您想使用不同于 {{< param "version" >}} 的 Kubernetes 版本,请在下面的命令中将 {{< param "version" >}} 替换为所需的次要版本。
343+
1. 添加 Kubernetes `zypper` 软件源。如果你想使用不同于 {{< param "version" >}}
344+
的 Kubernetes 版本,请在下面的命令中将 {{< param "version" >}} 替换为所需的次要版本。
338345
339346
<!--
340347
```bash
@@ -348,7 +355,7 @@ gpgcheck=1
348355
gpgkey=http://pkgs.k8s.io/core:/stable:/{{< param "version" >}}/rpm/repodata/repomd.xml.key
349356
EOF
350357
```
351-
-->
358+
-->
352359
```bash
353360
# 这将覆盖 /etc/zypp/repos.d/kubernetes.repo 中的任何现有配置。
354361
cat <<EOF | sudo tee /etc/zypp/repos.d/kubernetes.repo
@@ -362,20 +369,22 @@ EOF
362369
```
363370
{{< note >}}
364371
<!--
365-
To upgrade kubectl to another minor release, you'll need to bump the version in `/etc/zypp/repos.d/kubernetes.repo` before running `zypper update`. This procedure is described in more detail in
366-
[Changing The Kubernetes Package Repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/).
372+
To upgrade kubectl to another minor release, you'll need to bump the version in `/etc/zypp/repos.d/kubernetes.repo` before running `zypper update`. This procedure is described in more detail in
373+
[Changing The Kubernetes Package Repository](/docs/tasks/administer-cluster/kubeadm/change-package-repository/).
367374
-->
368375
要升级 kubectl 到另一个小版本,你需要先更新 `/etc/zypp/repos.d/kubernetes.repo` 的版本,
369-
再运行 `zypper update`。此过程在[更改 Kubernetes 软件包仓库](/zh-cn/docs/tasks/administer-cluster/kubeadm/change-package-repository/) 中有更详细的描述。
376+
再运行 `zypper update`
377+
此过程在[更改 Kubernetes 软件包仓库](/zh-cn/docs/tasks/administer-cluster/kubeadm/change-package-repository/)中有更详细的描述。
370378
{{< /note >}}
371379
372-
<!--
380+
<!--
373381
2. Install kubectl using `zypper`:
374-
-->
375-
2. 使用 `zypper` 安装 kubectl:
376-
```bash
377-
sudo zypper install -y kubectl
378-
```
382+
-->
383+
2. 使用 `zypper` 安装 kubectl:
384+
385+
```bash
386+
sudo zypper install -y kubectl
387+
```
379388
380389
{{% /tab %}}
381390

0 commit comments

Comments
 (0)