Skip to content

Commit e43de9a

Browse files
committed
[zh]Resync tasks files[11]
1 parent 6845b64 commit e43de9a

11 files changed

+103
-74
lines changed

content/zh/docs/tasks/configmap-secret/managing-secret-using-config-file.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,8 @@ kubectl get secret mysecret -o yaml
183183

184184
```yaml
185185
apiVersion: v1
186+
data:
187+
config.yaml: YXBpVXJsOiAiaHR0cHM6Ly9teS5hcGkuY29tL2FwaS92MSIKdXNlcm5hbWU6IHt7dXNlcm5hbWV9fQpwYXNzd29yZDoge3twYXNzd29yZH19
186188
kind: Secret
187189
metadata:
188190
creationTimestamp: 2018-11-15T20:40:59Z
@@ -191,8 +193,6 @@ metadata:
191193
resourceVersion: "7225"
192194
uid: c280ad2e-e916-11e8-98f2-025000000001
193195
type: Opaque
194-
data:
195-
config.yaml: YXBpVXJsOiAiaHR0cHM6Ly9teS5hcGkuY29tL2FwaS92MSIKdXNlcm5hbWU6IHt7dXNlcm5hbWV9fQpwYXNzd29yZDoge3twYXNzd29yZH19
196196
```
197197
198198
<!--
@@ -230,6 +230,8 @@ stringData:
230230

231231
```yaml
232232
apiVersion: v1
233+
data:
234+
username: YWRtaW5pc3RyYXRvcg==
233235
kind: Secret
234236
metadata:
235237
creationTimestamp: 2018-11-15T20:46:46Z
@@ -238,8 +240,6 @@ metadata:
238240
resourceVersion: "7579"
239241
uid: 91460ecb-e917-11e8-98f2-025000000001
240242
type: Opaque
241-
data:
242-
username: YWRtaW5pc3RyYXRvcg==
243243
```
244244

245245
<!-- Where `YWRtaW5pc3RyYXRvcg==` decodes to `administrator`. -->
@@ -248,8 +248,8 @@ data:
248248
<!-- ## Clean Up -->
249249
## 清理 {#clean-up}
250250

251-
<!-- To delete the Secret you have just created: -->
252-
删除你刚才创建的 Secret:
251+
<!-- To delete the Secret you have created: -->
252+
删除你创建的 Secret:
253253

254254
```shell
255255
kubectl delete secret mysecret
@@ -260,7 +260,7 @@ kubectl delete secret mysecret
260260
<!--
261261
- Read more about the [Secret concept](/docs/concepts/configuration/secret/)
262262
- Learn how to [manage Secret with the `kubectl` command](/docs/tasks/configmap-secret/managing-secret-using-kubectl/)
263-
- Learn how to [manage Secret using kustomizae](/docs/tasks/configmap-secret/managing-secret-using-kustomize/)
263+
- Learn how to [manage Secret using kustomize](/docs/tasks/configmap-secret/managing-secret-using-kustomize/)
264264
-->
265265
- 进一步阅读 [Secret 概念](/zh/docs/concepts/configuration/secret/)
266266
- 了解如何[使用 `kubectl` 命令管理 Secret](/zh/docs/tasks/configmap-secret/managing-secret-using-kubectl/)

content/zh/docs/tasks/configmap-secret/managing-secret-using-kubectl.md

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ weight: 10
55
description: 使用 kubectl 命令行创建 Secret 对象。
66
---
77
<!--
8-
title: Managing Secret using kubectl
8+
title: Managing Secrets using kubectl
99
content_type: task
1010
weight: 10
1111
description: Creating Secret objects using kubectl command line.
@@ -23,7 +23,7 @@ description: Creating Secret objects using kubectl command line.
2323
## 创建 Secret {#create-a-secret}
2424

2525
<!--
26-
A `Secret` can contain user credentials required by Pods to access a database.
26+
A `Secret` can contain user credentials required by pods to access a database.
2727
For example, a database connection string consists of a username and password.
2828
You can store the username in a file `./username.txt` and the password in a
2929
file `./password.txt` on your local machine.
@@ -38,12 +38,12 @@ echo -n '1f2d1e2e67df' > ./password.txt
3838
```
3939

4040
<!--
41-
The `-n` flag in the above two commands ensures that the generated files will
42-
not contain an extra newline character at the end of the text. This is
43-
important because when `kubectl` reads a file and encode the content into
44-
base64 string, the extra newline character gets encoded too.
41+
In these commands, the `-n` flag ensures that the generated files do not have
42+
an extra newline character at the end of the text. This is important because
43+
when `kubectl` reads a file and encodes the content into a base64 string, the
44+
extra newline character gets encoded too.
4545
-->
46-
上面两个命令中的 `-n` 标志确保生成的文件在文本末尾不包含额外的换行符。
46+
在这些命令中,`-n` 标志确保生成的文件在文本末尾不包含额外的换行符。
4747
这一点很重要,因为当 `kubectl` 读取文件并将内容编码为 base64 字符串时,多余的换行符也会被编码。
4848

4949
<!--
@@ -66,7 +66,7 @@ secret/db-user-pass created
6666
```
6767

6868
<!--
69-
Default key name is the filename. You may optionally set the key name using
69+
The default key name is the filename. You can optionally set the key name using
7070
`--from-file=[key=]source`. For example:
7171
-->
7272
默认密钥名称是文件名。 你可以选择使用 `--from-file=[key=]source` 来设置密钥名称。例如:
@@ -78,24 +78,27 @@ kubectl create secret generic db-user-pass \
7878
```
7979

8080
<!--
81-
You do not need to escape special characters in passwords from files
82-
().
81+
You do not need to escape special characters in password strings that you
82+
include in a file.
8383
-->
84-
你无需转义文件(`--from-file`)中的密码的特殊字符
84+
你不需要对文件中包含的密码字符串中的特殊字符进行转义
8585

8686
<!--
8787
You can also provide Secret data using the `--from-literal=<key>=<value>` tag.
8888
This tag can be specified more than once to provide multiple key-value pairs.
8989
Note that special characters such as `$`, `\`, `*`, `=`, and `!` will be
9090
interpreted by your [shell](https://en.wikipedia.org/wiki/Shell_(computing))
9191
and require escaping.
92+
9293
In most shells, the easiest way to escape the password is to surround it with
93-
single quotes (`'`). For example, if your actual password is `S!B\*d$zDsb=`,
94-
you should execute the command this way:
94+
single quotes (`'`). For example, if your password is `S!B\*d$zDsb=`,
95+
run the following command:
9596
-->
9697
你还可以使用 `--from-literal=<key>=<value>` 标签提供 Secret 数据。
9798
可以多次使用此标签,提供多个键值对。
98-
请注意,特殊字符(例如:`$``\``*``=``!`)由你的 [shell](https://en.wikipedia.org/wiki/Shell_(computing)) 解释执行,而且需要转义。
99+
请注意,特殊字符(例如:`$``\``*``=``!`)由你的 [shell](https://en.wikipedia.org/wiki/Shell_(computing))
100+
解释执行,而且需要转义。
101+
99102
在大多数 shell 中,转义密码最简便的方法是用单引号括起来。
100103
比如,如果你的密码是 `S!B\*d$zDsb=`
101104
可以像下面一样执行命令:
@@ -109,8 +112,8 @@ kubectl create secret generic dev-db-secret \
109112
<!-- ## Verify the Secret -->
110113
## 验证 Secret {#verify-the-secret}
111114

112-
<!-- You can check that the secret was created: -->
113-
你可以检查 secret 是否已创建:
115+
<!-- Check that the Secret was created: -->
116+
检查 secret 是否已创建:
114117

115118
```shell
116119
kubectl get secrets
@@ -151,19 +154,18 @@ username: 5 bytes
151154
<!--
152155
The commands `kubectl get` and `kubectl describe` avoid showing the contents
153156
of a `Secret` by default. This is to protect the `Secret` from being exposed
154-
accidentally to an onlooker, or from being stored in a terminal log.
157+
accidentally, or from being stored in a terminal log.
155158
-->
156159
`kubectl get``kubectl describe` 命令默认不显示 `Secret` 的内容。
157-
这是为了防止 `Secret` 被意外暴露给旁观者或存储在终端日志中
160+
这是为了防止 `Secret` 被意外暴露或存储在终端日志中
158161

159162
<!-- ## Decoding the Secret {#decoding-secret} -->
160163
## 解码 Secret {#decoding-secret}
161164

162165
<!--
163-
To view the contents of the Secret we just created, you can run the following
164-
command:
166+
To view the contents of the Secret you created, run the following command:
165167
-->
166-
要查看我们刚刚创建的 Secret 的内容,可以运行以下命令
168+
要查看创建的 Secret 的内容,运行以下命令
167169

168170
```shell
169171
kubectl get secret db-user-pass -o jsonpath='{.data}'
@@ -195,8 +197,8 @@ echo 'MWYyZDFlMmU2N2Rm' | base64 --decode
195197
<!-- ## Clean Up -->
196198
## 清理 {#clean-up}
197199

198-
<!-- To delete the Secret you have just created: -->
199-
删除刚刚创建的 Secret:
200+
<!-- Delete the Secret you created: -->
201+
删除创建的 Secret:
200202

201203
```shell
202204
kubectl delete secret db-user-pass
@@ -208,8 +210,8 @@ kubectl delete secret db-user-pass
208210

209211
<!--
210212
- Read more about the [Secret concept](/docs/concepts/configuration/secret/)
211-
- Learn how to [manage Secret using config file](/docs/tasks/configmap-secret/managing-secret-using-config-file/)
212-
- Learn how to [manage Secret using kustomize](/docs/tasks/configmap-secret/managing-secret-using-kustomize/)
213+
- Learn how to [manage Secrets using config files](/docs/tasks/configmap-secret/managing-secret-using-config-file/)
214+
- Learn how to [manage Secrets using kustomize](/docs/tasks/configmap-secret/managing-secret-using-kustomize/)
213215
-->
214216
- 进一步阅读 [Secret 概念](/zh/docs/concepts/configuration/secret/)
215217
- 了解如何[使用配置文件管理 Secret](/zh/docs/tasks/configmap-secret/managing-secret-using-config-file/)

content/zh/docs/tasks/configmap-secret/managing-secret-using-kustomize.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ kubectl describe secrets/db-user-pass-96mffmfh4k
125125
输出类似于:
126126

127127
```
128-
Name: db-user-pass
128+
Name: db-user-pass-96mffmfh4k
129129
Namespace: default
130130
Labels: <none>
131131
Annotations: <none>
@@ -154,8 +154,8 @@ To check the actual content of the encoded data, please refer to
154154
<!-- ## Clean Up -->
155155
## 清理 {#clean-up}
156156

157-
<!-- To delete the Secret you have just created: -->
158-
删除你刚才创建的 Secret:
157+
<!-- To delete the Secret you have created: -->
158+
删除你创建的 Secret:
159159

160160
```shell
161161
kubectl delete secret db-user-pass-96mffmfh4k

content/zh/docs/tasks/inject-data-application/define-environment-variable-container.md

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ that run in the Pod. To set environment variables, include the `env` or
3939
<!--
4040
In this exercise, you create a Pod that runs one container. The configuration
4141
file for the Pod defines an environment variable with name `DEMO_GREETING` and
42-
value `"Hello from the environment"`. Here is the configuration file for the
42+
value `"Hello from the environment"`. Here is the configuration manifest for the
4343
Pod:
4444
-->
4545
本示例中,将创建一个只包含单个容器的 Pod。Pod 的配置文件中设置环境变量的名称为 `DEMO_GREETING`
46-
其值为 `"Hello from the environment"`。下面是 Pod 的配置文件内容
46+
其值为 `"Hello from the environment"`。下面是 Pod 的配置清单
4747

4848
{{< codenew file="pods/inject/envars.yaml" >}}
4949

5050
<!--
51-
1. Create a Pod based on the YAML configuration file:
51+
1. Create a Pod based on that manifest:
5252
-->
53-
1. 基于 YAML 文件创建一个 Pod:
53+
1. 基于配置清单创建一个 Pod:
5454

5555
```shell
5656
kubectl apply -f https://k8s.io/examples/pods/inject/envars.yaml
@@ -59,7 +59,7 @@ Pod:
5959
<!--
6060
1. List the running Pods:
6161
-->
62-
1. 获取一下当前正在运行的 Pods 信息:
62+
2. 获取一下当前正在运行的 Pods 信息:
6363

6464
```shell
6565
kubectl get pods -l purpose=demonstrate-envars
@@ -69,17 +69,17 @@ Pod:
6969
The output is similar to this:
7070
-->
7171
查询结果应为:
72-
73-
```shell
72+
73+
```
7474
NAME READY STATUS RESTARTS AGE
7575
envar-demo 1/1 Running 0 9s
7676
```
7777

7878
<!--
7979
1. List the Pod's container environment variables:
8080
-->
81-
1. 列出 Pod 容器的环境变量:
82-
81+
3. 列出 Pod 容器的环境变量:
82+
8383
```shell
8484
kubectl exec envar-demo -- printenv
8585
```
@@ -88,8 +88,8 @@ Pod:
8888
The output is similar to this:
8989
-->
9090
打印结果应为:
91-
92-
```shell
91+
92+
```
9393
NODE_VERSION=4.4.2
9494
EXAMPLE_SERVICE_PORT_8080_TCP_ADDR=10.3.245.237
9595
HOSTNAME=envar-demo
@@ -101,25 +101,44 @@ Pod:
101101
<!--
102102
{{< note >}}
103103
The environment variables set using the `env` or `envFrom` field
104-
will override any environment variables specified in the container image.
104+
override any environment variables specified in the container image.
105105
{{< /note >}}
106106
-->
107107
{{< note >}}
108108
通过 `env` 或 `envFrom` 字段设置的环境变量将覆盖容器镜像中指定的所有环境变量。
109109
{{< /note >}}
110110
111+
<!--
112+
{{< note >}}
113+
Environment variables may reference each other, however ordering is important.
114+
Variables making use of others defined in the same context must come later in
115+
the list. Similarly, avoid circular references.
116+
{{< /note >}}
117+
-->
111118
{{< note >}}
112-
环境变量之间可能出现互相依赖或者循环引用的情况,使用之前需注意引用顺序
119+
环境变量可以互相引用,但是顺序很重要。
120+
使用在相同上下文中定义的其他变量的变量必须在列表的后面。
121+
同样,请避免使用循环引用。
113122
{{< /note >}}
114123
115124
<!--
116125
## Using environment variables inside of your config
117126
118-
Environment variables that you define in a Pod's configuration can be used elsewhere in the configuration, for example in commands and arguments that you set for the Pod's containers. In the example configuration below, the `GREETING`, `HONORIFIC`, and `NAME` environment variables are set to `Warm greetings to`, `The Most Honorable`, and `Kubernetes`, respectively. Those environment variables are then used in the CLI arguments passed to the `env-print-demo` container.
127+
Environment variables that you define in a Pod's configuration can be used
128+
elsewhere in the configuration, for example in commands and arguments that
129+
you set for the Pod's containers.
130+
In the example configuration below, the `GREETING`, `HONORIFIC`, and
131+
`NAME` environment variables are set to `Warm greetings to`, `The Most
132+
Honorable`, and `Kubernetes`, respectively. Those environment variables
133+
are then used in the CLI arguments passed to the `env-print-demo`
134+
container.
119135
-->
120136
## 在配置中使用环境变量
121137
122-
您在 Pod 的配置中定义的环境变量可以在配置的其他地方使用,例如可用在为 Pod 的容器设置的命令和参数中。在下面的示例配置中,环境变量 `GREETING``HONORIFIC``NAME` 分别设置为 `Warm greetings to``The Most Honorable``Kubernetes`。然后这些环境变量在传递给容器 `env-print-demo` 的 CLI 参数中使用。
138+
您在 Pod 的配置中定义的环境变量可以在配置的其他地方使用,
139+
例如可用在为 Pod 的容器设置的命令和参数中。
140+
在下面的示例配置中,环境变量 `GREETING` ,`HONORIFIC` 和 `NAME` 分别设置为 `Warm greetings to` ,
141+
`The Most Honorable` 和 `Kubernetes`。然后这些环境变量在传递给容器 `env-print-demo` 的 CLI 参数中使用。
123142
124143
```yaml
125144
apiVersion: v1

content/zh/docs/tasks/manage-daemon/rollback-daemon-set.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ You should already know how to [perform a rolling update on a
3838
3939
### Step 1: Find the DaemonSet revision you want to roll back to
4040
41-
You can skip this step if you just want to roll back to the last revision.
41+
You can skip this step if you only want to roll back to the last revision.
4242
4343
List all revisions of a DaemonSet:
4444
-->

content/zh/docs/tasks/manage-daemon/update-daemon-set.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ kubectl edit ds/fluentd-elasticsearch -n kube-system
191191
<!--
192192
##### Updating only the container image
193193
194-
If you just need to update the container image in the DaemonSet template, i.e.
194+
If you only need to update the container image in the DaemonSet template, i.e.
195195
`.spec.template.spec.containers[*].image`, use `kubectl set image`:
196196
--->
197197
##### 只更新容器镜像
@@ -295,10 +295,10 @@ DaemonSet rollout won't progress.
295295
(通常由于拼写错误),就会发生 DaemonSet 滚动更新中断。
296296

297297
<!--
298-
To fix this, just update the DaemonSet template again. New rollout won't be
298+
To fix this, update the DaemonSet template again. New rollout won't be
299299
blocked by previous unhealthy rollouts.
300300
-->
301-
要解决此问题,只需再次更新 DaemonSet 模板即可。以前不健康的滚动更新不会阻止新的滚动更新
301+
要解决此问题,需再次更新 DaemonSet 模板。新的滚动更新不会被以前的不健康的滚动更新阻止
302302

303303
<!--
304304
#### Clock skew

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ preview of what changes `apply` will make.
2626
## {{% heading "prerequisites" %}}
2727

2828
<!--
29-
Install [`kubectl`](/docs/tasks/tools/install-kubectl/).
29+
Install [`kubectl`](/docs/tasks/tools/).
3030
-->
31-
安装 [`kubectl`](/zh/docs/tasks/tools/install-kubectl/)
31+
安装 [`kubectl`](/zh/docs/tasks/tools/)
3232

3333
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
3434

content/zh/docs/tasks/manage-kubernetes-objects/imperative-command.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Kubernetes 对象。本文档解释这些命令的组织方式以及如何使用
2121
## {{% heading "prerequisites" %}}
2222

2323
<!--
24-
Install [`kubectl`](/docs/tasks/tools/install-kubectl/).
24+
Install [`kubectl`](/docs/tasks/tools/).
2525
-->
26-
安装[`kubectl`](/zh/docs/tasks/tools/install-kubectl/)
26+
安装[`kubectl`](/zh/docs/tasks/tools/)
2727

2828
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
2929

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ This document explains how to define and manage objects using configuration file
2121
## {{% heading "prerequisites" %}}
2222

2323
<!--
24-
Install [`kubectl`](/docs/tasks/tools/install-kubectl/).
24+
Install [`kubectl`](/docs/tasks/tools/).
2525
-->
26-
安装 [`kubectl`](/zh/docs/tasks/tools/install-kubectl/)
26+
安装 [`kubectl`](/zh/docs/tasks/tools/)
2727

2828
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
2929

0 commit comments

Comments
 (0)