Skip to content

Commit 64dc75b

Browse files
authored
Merge pull request #40090 from SSmallMonster/sync-14
[zh-cn] sync distribute-credentials-secure.md
2 parents c104b6e + 33661d9 commit 64dc75b

File tree

1 file changed

+41
-41
lines changed

1 file changed

+41
-41
lines changed

content/zh-cn/docs/tasks/inject-data-application/distribute-credentials-secure.md

Lines changed: 41 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,13 @@ When you deploy this Pod, the following happens:
269269
当你部署此 Pod 时,会发生以下情况:
270270
271271
<!--
272-
* The `username` key from `mysecret` is available to the container at the path
272+
- The `username` key from `mysecret` is available to the container at the path
273273
`/etc/foo/my-group/my-username` instead of at `/etc/foo/username`.
274-
* The `password` key from that Secret object is not projected.
274+
- The `password` key from that Secret object is not projected.
275275
-->
276-
* 来自 `mysecret` 的键 `username` 可以在路径 `/etc/foo/my-group/my-username`
276+
- 来自 `mysecret` 的键 `username` 可以在路径 `/etc/foo/my-group/my-username`
277277
下供容器使用,而不是路径 `/etc/foo/username`。
278-
* 来自该 Secret 的键 `password` 没有映射到任何路径。
278+
- 来自该 Secret 的键 `password` 没有映射到任何路径。
279279

280280
<!--
281281
If you list keys explicitly using `.spec.volumes[].secret.items`, consider the
@@ -285,15 +285,15 @@ following:
285285
如果你使用 `.spec.volumes[].secret.items` 明确地列出键,请考虑以下事项:
286286

287287
<!--
288-
* Only keys specified in `items` are projected.
289-
* To consume all keys from the Secret, all of them must be listed in the
288+
- Only keys specified in `items` are projected.
289+
- To consume all keys from the Secret, all of them must be listed in the
290290
`items` field.
291-
* All listed keys must exist in the corresponding Secret. Otherwise, the volume
291+
- All listed keys must exist in the corresponding Secret. Otherwise, the volume
292292
is not created.
293293
-->
294-
* 只有在 `items` 字段中指定的键才会被映射。
295-
* 要使用 Secret 中全部的键,那么全部的键都必须列在 `items` 字段中。
296-
* 所有列出的键必须存在于相应的 Secret 中。否则,该卷不被创建。
294+
- 只有在 `items` 字段中指定的键才会被映射。
295+
- 要使用 Secret 中全部的键,那么全部的键都必须列在 `items` 字段中。
296+
- 所有列出的键必须存在于相应的 Secret 中。否则,该卷不被创建。
297297

298298
<!--
299299
### Set POSIX permissions for Secret keys
@@ -379,34 +379,34 @@ secrets change.
379379
### 使用来自 Secret 中的数据定义容器变量 {#define-a-container-env-var-with-data-from-a-single-secret}
380380

381381
<!--
382-
* Define an environment variable as a key-value pair in a Secret:
382+
- Define an environment variable as a key-value pair in a Secret:
383383
-->
384-
* 定义环境变量为 Secret 中的键值偶对:
384+
- 定义环境变量为 Secret 中的键值偶对:
385385

386386
```shell
387387
kubectl create secret generic backend-user --from-literal=backend-username='backend-admin'
388388
```
389389

390390
<!--
391-
* Assign the `backend-username` value defined in the Secret to the `SECRET_USERNAME` environment variable in the Pod specification.
391+
- Assign the `backend-username` value defined in the Secret to the `SECRET_USERNAME` environment variable in the Pod specification.
392392
-->
393-
* 在 Pod 规约中,将 Secret 中定义的值 `backend-username` 赋给 `SECRET_USERNAME` 环境变量。
393+
- 在 Pod 规约中,将 Secret 中定义的值 `backend-username` 赋给 `SECRET_USERNAME` 环境变量。
394394

395395
{{< codenew file="pods/inject/pod-single-secret-env-variable.yaml" >}}
396396

397397
<!--
398-
* Create the Pod:
398+
- Create the Pod:
399399
-->
400-
* 创建 Pod:
400+
- 创建 Pod:
401401

402402
```shell
403403
kubectl create -f https://k8s.io/examples/pods/inject/pod-single-secret-env-variable.yaml
404404
```
405405

406406
<!--
407-
* In your shell, display the content of `SECRET_USERNAME` container environment variable
407+
- In your shell, display the content of `SECRET_USERNAME` container environment variable
408408
-->
409-
* 在 Shell 中,显示容器环境变量 `SECRET_USERNAME` 的内容:
409+
- 在 Shell 中,显示容器环境变量 `SECRET_USERNAME` 的内容:
410410

411411
```shell
412412
kubectl exec -i -t env-single-secret -- /bin/sh -c 'echo $SECRET_USERNAME'
@@ -426,35 +426,35 @@ secrets change.
426426
### 使用来自多个 Secret 的数据定义环境变量 {#define-container-env-var-with-data-from-multi-secrets}
427427
428428
<!--
429-
* As with the previous example, create the Secrets first.
429+
- As with the previous example, create the Secrets first.
430430
-->
431-
* 和前面的例子一样,先创建 Secret:
431+
- 和前面的例子一样,先创建 Secret:
432432
433433
```shell
434434
kubectl create secret generic backend-user --from-literal=backend-username='backend-admin'
435435
kubectl create secret generic db-user --from-literal=db-username='db-admin'
436436
```
437437

438438
<!--
439-
* Define the environment variables in the Pod specification.
439+
- Define the environment variables in the Pod specification.
440440
-->
441-
* 在 Pod 规约中定义环境变量:
441+
- 在 Pod 规约中定义环境变量:
442442

443443
{{< codenew file="pods/inject/pod-multiple-secret-env-variable.yaml" >}}
444444

445445
<!--
446-
* Create the Pod:
446+
- Create the Pod:
447447
-->
448-
* 创建 Pod:
448+
- 创建 Pod:
449449

450450
```shell
451451
kubectl create -f https://k8s.io/examples/pods/inject/pod-multiple-secret-env-variable.yaml
452452
```
453453

454454
<!--
455-
* In your shell, display the container environment variables
455+
- In your shell, display the container environment variables
456456
-->
457-
* 在你的 Shell 中,显示容器环境变量的内容:
457+
- 在你的 Shell 中,显示容器环境变量的内容:
458458

459459
```shell
460460
kubectl exec -i -t envvars-multiple-secrets -- /bin/sh -c 'env | grep _USERNAME'
@@ -481,35 +481,35 @@ This functionality is available in Kubernetes v1.6 and later.
481481
{{< /note >}}
482482

483483
<!--
484-
* Create a Secret containing multiple key-value pairs
484+
- Create a Secret containing multiple key-value pairs
485485
-->
486-
* 创建包含多个键值偶对的 Secret:
486+
- 创建包含多个键值偶对的 Secret:
487487

488488
```shell
489489
kubectl create secret generic test-secret --from-literal=username='my-app' --from-literal=password='39528$vdg7Jb'
490490
```
491491

492492
<!--
493-
* Use envFrom to define all of the Secret's data as container environment variables. The key from the Secret becomes the environment variable name in the Pod.
493+
- Use envFrom to define all of the Secret's data as container environment variables. The key from the Secret becomes the environment variable name in the Pod.
494494
-->
495-
* 使用 `envFrom` 来将 Secret 中的所有数据定义为环境变量。
495+
- 使用 `envFrom` 来将 Secret 中的所有数据定义为环境变量。
496496
Secret 中的键名成为容器中的环境变量名:
497497

498498
{{< codenew file="pods/inject/pod-secret-envFrom.yaml" >}}
499499

500500
<!--
501-
* Create the Pod:
501+
- Create the Pod:
502502
-->
503-
* 创建 Pod:
503+
- 创建 Pod:
504504

505505
```shell
506506
kubectl create -f https://k8s.io/examples/pods/inject/pod-secret-envFrom.yaml
507507
```
508508

509509
<!--
510-
* In your shell, display `username` and `password` container environment variables
510+
- In your shell, display `username` and `password` container environment variables
511511
-->
512-
* 在 Shell 中,显示环境变量 `username``password` 的内容:
512+
- 在 Shell 中,显示环境变量 `username``password` 的内容:
513513

514514
```shell
515515
kubectl exec -i -t envfrom-secret -- /bin/sh -c 'echo "username: $username\npassword: $password\n"'
@@ -530,15 +530,15 @@ This functionality is available in Kubernetes v1.6 and later.
530530
-->
531531
### 参考 {#references}
532532

533-
* [Secret](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#secret-v1-core)
534-
* [Volume](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#volume-v1-core)
535-
* [Pod](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#pod-v1-core)
533+
- [Secret](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#secret-v1-core)
534+
- [Volume](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#volume-v1-core)
535+
- [Pod](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#pod-v1-core)
536536

537537
## {{% heading "whatsnext" %}}
538538

539539
<!--
540-
* Learn more about [Secrets](/docs/concepts/configuration/secret/).
541-
* Learn about [Volumes](/docs/concepts/storage/volumes/).
540+
- Learn more about [Secrets](/docs/concepts/configuration/secret/).
541+
- Learn about [Volumes](/docs/concepts/storage/volumes/).
542542
-->
543-
* 进一步了解 [Secret](/zh-cn/docs/concepts/configuration/secret/)
544-
* 了解[](/zh-cn/docs/concepts/storage/volumes/)
543+
- 进一步了解 [Secret](/zh-cn/docs/concepts/configuration/secret/)
544+
- 了解[](/zh-cn/docs/concepts/storage/volumes/)

0 commit comments

Comments
 (0)