Skip to content

Commit 0355f57

Browse files
authored
Merge pull request #23195 from tengqm/zh-links-tasks-4
[zh] Tidy up and fix links in tasks section (4/10)
2 parents aa10585 + a3a7458 commit 0355f57

File tree

13 files changed

+597
-636
lines changed

13 files changed

+597
-636
lines changed

content/zh/docs/concepts/containers/images.md

Lines changed: 33 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -89,34 +89,34 @@ Instead, specify a meaningful tag such as `v1.42.0`.
8989
<!--
9090
## Updating Images
9191
92-
The default pull policy is `IfNotPresent` which causes the Kubelet to skip
92+
The default pull policy is `IfNotPresent` which causes the
93+
{{< glossary_tooltip text="kubelet" term_id="kubelet" >}} to skip
9394
pulling an image if it already exists. If you would like to always force a pull,
9495
you can do one of the following:
95-
-->
96-
## 更新镜像 {#updating-images}
97-
98-
默认的镜像拉取策略是 `IfNotPresent`:在镜像已经存在的情况下,`kubelet` 将不再去拉取镜像。
99-
如果希望强制总是拉取镜像,你可以执行以下操作之一:
10096
101-
<!--
10297
- set the `imagePullPolicy` of the container to `Always`.
10398
- omit the `imagePullPolicy` and use `:latest` as the tag for the image to use.
10499
- omit the `imagePullPolicy` and the tag for the image to use.
105100
- enable the [AlwaysPullImages](/docs/reference/access-authn-authz/admission-controllers/#alwayspullimages) admission controller.
101+
102+
When `imagePullPolicy` is defined without a specific value, it is also set to `Always`.
106103
-->
104+
## 更新镜像 {#updating-images}
105+
106+
默认的镜像拉取策略是 `IfNotPresent`:在镜像已经存在的情况下,
107+
{{< glossary_tooltip text="kubelet" term_id="kubelet" >}} 将不再去拉取镜像。
108+
如果希望强制总是拉取镜像,你可以执行以下操作之一:
109+
107110
- 设置容器的 `imagePullPolicy``Always`
108111
- 省略 `imagePullPolicy`,并使用 `:latest` 作为要使用的镜像的标签。
109112
- 省略 `imagePullPolicy` 和要使用的镜像标签。
110113
- 启用 [AlwaysPullImages](/zh/docs/reference/access-authn-authz/admission-controllers/#alwayspullimages)
111114
准入控制器(Admission Controller)。
112115

113-
<!--
114-
When `imagePullPolicy` is defined without a specific value, it is also set to `Always`.
115-
-->
116116
如果 `imagePullPolicy` 未被定义为特定的值,也会被设置为 `Always`
117117

118118
<!--
119-
## Building Multi-architecture Images with Manifests
119+
## Multi-architecture Images with Manifests
120120
121121
As well as providing binary images, a container registry can also serve a [container image manifest](https://github.com/opencontainers/image-spec/blob/master/manifest.md). A manifest can reference image manifests for architecture-specific versions of an container. The idea is that you can have a name for an image (for example: `pause`, `example/mycontainer`, `kube-apiserver`) and allow different systems to fetch the right binary image for the machine architecture they are using.
122122
@@ -139,27 +139,27 @@ YAML 文件也能兼容。
139139
<!--
140140
## Using a Private Registry
141141
142-
Private registries may require keys to read images from them.
142+
Private registries may require keys to read images from them.
143143
Credentials can be provided in several ways:
144144
-->
145-
## 使用私有仓库 {#using-a-private-registry}
145+
## 使用私有仓库 {#using-a-private-registry}
146146

147147
从私有仓库读取镜像时可能需要密钥。
148-
凭据信息可以用以下方式提供:
149-
150-
<!--
151-
- Configuring Nodes to Authenticate to a Private Registry
152-
- all pods can read any configured private registries
153-
- requires node configuration by cluster administrator
154-
- Pre-pulled Images
155-
- all pods can use any images cached on a node
156-
- requires root access to all nodes to setup
157-
- Specifying ImagePullSecrets on a Pod
158-
- only pods which provide own keys can access the private registry
159-
- Vendor-specific or local extensions
160-
- if you're using a custom node configuration, you (or your cloud
161-
provider) can implement your mechanism for authenticating the node
162-
to the container registry.
148+
凭证可以用以下方式提供:
149+
150+
<!--
151+
- Configuring Nodes to Authenticate to a Private Registry
152+
- all pods can read any configured private registries
153+
- requires node configuration by cluster administrator
154+
- Pre-pulled Images
155+
- all pods can use any images cached on a node
156+
- requires root access to all nodes to setup
157+
- Specifying ImagePullSecrets on a Pod
158+
- only pods which provide own keys can access the private registry
159+
- Vendor-specific or local extensions
160+
- if you're using a custom node configuration, you (or your cloud
161+
provider) can implement your mechanism for authenticating the node
162+
to the container registry.
163163
-->
164164
- 配置节点向私有仓库进行身份验证
165165
- 所有 Pod 均可读取任何已配置的私有仓库
@@ -174,9 +174,9 @@ Credentials can be provided in several ways:
174174
向容器仓库认证的机制
175175

176176
<!--
177-
These options are explained in more detail below.
177+
These options are explaind in more detail below.
178178
-->
179-
下面将详细描述每一种方案
179+
下面将详细描述每一项
180180

181181
<!--
182182
### Configuring Nodes to authenticate to a Private Registry
@@ -299,21 +299,6 @@ EOF
299299
pod/private-image-test-1 created
300300
```
301301

302-
<!--
303-
If everything is working, then, after a few moments, you can run:
304-
-->
305-
如果一切正常,一段时间后,可以运行:
306-
307-
```shell
308-
kubectl logs private-image-test-1
309-
```
310-
311-
并看到命令输出为:
312-
313-
```
314-
SUCCESS
315-
```
316-
317302
<!--
318303
If you suspect that the command failed, you can run:
319304
-->
@@ -388,7 +373,7 @@ All pods will have read access to any pre-pulled images.
388373
<!--
389374
### Specifying ImagePullSecrets on a Pod
390375
-->
391-
### Pod 设置 ImagePullSecrets
376+
### Pod 上指定 ImagePullSecrets {#specifying-imagepullsecrets-on-a-pod}
392377

393378
<!--
394379
This is the recommended approach to run containers based on images
@@ -408,9 +393,9 @@ Kubernetes 支持在 Pod 中设置容器镜像仓库的密钥。
408393
409394
Run the following command, substituting the appropriate uppercase values:
410395
-->
411-
#### 创建包含 Docker 配置的Secret
396+
#### 使用 Docker Config 创建 Secret {#creating-a-secret-with-docker-config}
412397

413-
将大写字母代替为合适的值,运行以下命令:
398+
运行以下命令,将大写字母代替为合适的值
414399

415400
```shell
416401
kubectl create secret docker-registry <名称> \

content/zh/docs/setup/learning-environment/minikube.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,12 +374,10 @@ minikube start --kubernetes-version {{< param "fullversion" >}}
374374
```
375375
<!--
376376
#### Specifying the VM driver
377-
-->
378-
#### 指定 VM 驱动程序
379377

380-
<!--
381378
You can change the VM driver by adding the `--vm-driver=<enter_driver_name>` flag to `minikube start`.
382379
-->
380+
#### 指定 VM 驱动程序 {#specifying-the-vm-driver}
383381

384382
您可以通过将 `--vm-driver=<enter_driver_name>` 参数添加到 `minikube start` 来更改 VM 驱动程序。
385383
<!--

content/zh/docs/tasks/access-application-cluster/access-cluster.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ is associated with a service account, and a credential (token) for that
268268
service account is placed into the filesystem tree of each container in that pod,
269269
at `/var/run/secrets/kubernetes.io/serviceaccount/token`.
270270
-->
271-
### 从 Pod 中访问 API
271+
### 从 Pod 中访问 API {#accessing-the-api-from-a-pod}
272272

273273
当你从 Pod 中访问 API 时,定位和验证 apiserver 会有些许不同。
274274

content/zh/docs/tasks/configure-pod-container/configure-projected-volume-storage.md

Lines changed: 48 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
---
2-
reviewers:
3-
- jpeeler
4-
- pmorie
52
title: 配置 Pod 使用投射卷作存储
63
content_type: task
74
weight: 70
85
---
96

107
<!--
11-
---
128
reviewers:
139
- jpeeler
1410
- pmorie
1511
title: Configure a Pod to Use a Projected Volume for Storage
1612
content_type: task
1713
weight: 70
18-
---
1914
-->
2015

2116
<!-- overview -->
@@ -25,22 +20,20 @@ several existing volume sources into the same directory. Currently, `secret`, `c
2520
and `serviceAccountToken` volumes can be projected.
2621
-->
2722

28-
本文介绍怎样通过[`投射`](/docs/concepts/storage/volumes/#projected) 卷将现有的多个卷资源挂载到相同的目录。
23+
本文介绍怎样通过[`projected`](/zh/docs/concepts/storage/volumes/#projected) 卷将现有的多个卷资源挂载到相同的目录。
2924
当前,`secret``configMap``downwardAPI``serviceAccountToken` 卷可以被投射。
3025

31-
{{< note >}}
3226
<!--
3327
`serviceAccountToken` is not a volume type.
3428
-->
29+
{{< note >}}
3530
`serviceAccountToken` 不是一种卷类型
3631
{{< /note >}}
3732

38-
3933
## {{% heading "prerequisites" %}}
4034

4135
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
4236

43-
4437
<!-- steps -->
4538

4639
<!--
@@ -51,62 +44,74 @@ In this exercise, you create username and password Secrets from local files. You
5144
Here is the configuration file for the Pod:
5245
-->
5346

54-
## 为 Pod 配置投射卷
47+
## 为 Pod 配置 projected 卷
5548

56-
本练习中,您将从本地文件来创建包含有用户名和密码的 Secret。然后创建运行一个容器的 Pod,该 Pod 使用[`投射`](/docs/concepts/storage/volumes/#projected) 卷将 Secret 挂载到相同的路径下。
49+
本练习中,您将从本地文件来创建包含有用户名和密码的 Secret。然后创建运行一个容器的 Pod,
50+
该 Pod 使用[`projected`](/zh/docs/concepts/storage/volumes/#projected) 卷将 Secret 挂载到相同的路径下。
5751

5852
下面是 Pod 的配置文件:
5953

6054
{{< codenew file="pods/storage/projected.yaml" >}}
6155

62-
1. <!--Create the Secrets:-->创建 Secrets:
63-
```shell
64-
<!--# Create files containing the username and password:--># 创建包含用户名和密码的文件:
65-
echo -n "admin" > ./username.txt
66-
echo -n "1f2d1e2e67df" > ./password.txt-->
56+
1. <!--Create the Secrets:-->
57+
创建 Secrets:
6758

68-
<!--# Package these files into secrets:--># 将上述文件引用到 Secret:
69-
kubectl create secret generic user --from-file=./username.txt
70-
kubectl create secret generic pass --from-file=./password.txt
71-
```
59+
```shell
60+
# 创建包含用户名和密码的文件:
61+
echo -n "admin" > ./username.txt
62+
echo -n "1f2d1e2e67df" > ./password.txt-->
7263

73-
1. <!--Create the Pod:-->创建 Pod:
64+
# 将上述文件引用到 Secret:
65+
kubectl create secret generic user --from-file=./username.txt
66+
kubectl create secret generic pass --from-file=./password.txt
67+
```
7468

75-
```shell
76-
kubectl create -f https://k8s.io/examples/pods/storage/projected.yaml
77-
```
69+
2. <!--Create the Pod:-->
70+
创建 Pod:
7871

79-
<!--Verify that the Pod's Container is running, and then watch for changes to
80-
the Pod:-->确认 Pod 中的容器运行正常,然后监视 Pod 的变化:
72+
```shell
73+
kubectl create -f https://k8s.io/examples/pods/storage/projected.yaml
74+
```
8175

82-
```shell
83-
kubectl get --watch pod test-projected-volume
84-
```
76+
<!--
77+
Verify that the Pod's Container is running, and then watch for changes to
78+
the Pod:
79+
-->
80+
确认 Pod 中的容器运行正常,然后监视 Pod 的变化:
8581

86-
<!--The output looks like this:-->输出结果和下面类似:
87-
NAME READY STATUS RESTARTS AGE
88-
test-projected-volume 1/1 Running 0 14s
82+
```shell
83+
kubectl get --watch pod test-projected-volume
84+
```
8985

90-
1. <!--In another terminal, get a shell to the running Container:-->在另外一个终端中,打开容器的 shell:
91-
```shell
92-
kubectl exec -it test-projected-volume -- /bin/sh
93-
```
86+
<!--The output looks like this:-->
87+
输出结果和下面类似:
9488

95-
1. <!--In your shell, verify that the `projected-volume` directory contains your projected sources:-->在 shell 中,确认 `projected-volume` 目录包含你的投射源:
96-
```shell
97-
ls /projected-volume/
98-
```
89+
```
90+
NAME READY STATUS RESTARTS AGE
91+
test-projected-volume 1/1 Running 0 14s
92+
```
9993

94+
3. <!--In another terminal, get a shell to the running Container:-->
95+
在另外一个终端中,打开容器的 shell:
10096

101-
## {{% heading "whatsnext" %}}
97+
```shell
98+
kubectl exec -it test-projected-volume -- /bin/sh
99+
```
100+
101+
4. <!--In your shell, verify that the `projected-volume` directory contains your projected sources:-->
102+
在 shell 中,确认 `projected-volume` 目录包含你的投射源:
102103

104+
```shell
105+
ls /projected-volume/
106+
```
107+
108+
## {{% heading "whatsnext" %}}
103109

104110
<!--
105111
* Learn more about [`projected`](/docs/concepts/storage/volumes/#projected) volumes.
106112
* Read the [all-in-one volume](https://github.com/kubernetes/community/blob/{{< param "githubbranch" >}}/contributors/design-proposals/node/all-in-one-volume.md) design document.
107113
-->
108114

109-
* 进一步了解[`投射`](/docs/concepts/storage/volumes/#projected) 卷。
115+
* 进一步了解[`projected`](/zh/docs/concepts/storage/volumes/#projected) 卷。
110116
* 阅读[一体卷](https://github.com/kubernetes/community/blob/{{< param "githubbranch" >}}/contributors/design-proposals/node/all-in-one-volume.md)设计文档。
111117

112-

0 commit comments

Comments
 (0)