add zh pages
This commit is contained in:
+12
-10
@@ -1,17 +1,17 @@
|
||||
---
|
||||
title: 为容器设置启动时要执行的命令及其入参
|
||||
content_template: templates/task
|
||||
content_type: task
|
||||
weight: 10
|
||||
---
|
||||
<!--
|
||||
---
|
||||
title: Define a Command and Arguments for a Container
|
||||
content_template: templates/task
|
||||
content_type: task
|
||||
weight: 10
|
||||
---
|
||||
-->
|
||||
|
||||
{{% capture overview %}}
|
||||
<!-- overview -->
|
||||
|
||||
<!--
|
||||
This page shows how to define commands and arguments when you run a container
|
||||
@@ -19,17 +19,18 @@ in a {{< glossary_tooltip term_id="pod" >}}.
|
||||
-->
|
||||
本页将展示如何为 {{< glossary_tooltip term_id="pod" >}} 中的容器设置启动时要执行的命令及其入参。
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture prerequisites %}}
|
||||
|
||||
## {{% heading "prerequisites" %}}
|
||||
|
||||
|
||||
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture steps %}}
|
||||
|
||||
<!-- steps -->
|
||||
|
||||
<!--
|
||||
## Define a command and arguments when you create a Pod
|
||||
@@ -234,9 +235,10 @@ Here are some examples:
|
||||
| `[/ep-1]` | `[foo bar]` | `[/ep-2]` | `[zoo boo]` | `[ep-2 zoo boo]` |
|
||||
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
||||
|
||||
<!--
|
||||
* Learn more about [configuring pods and containers](/docs/tasks/).
|
||||
@@ -247,7 +249,7 @@ Here are some examples:
|
||||
* 了解更多 [在容器中运行命令](/docs/tasks/debug-application-cluster/get-shell-running-container/)。
|
||||
* 请参阅 [有关容器的文档](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#container-v1-core)。
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+12
-10
@@ -1,17 +1,17 @@
|
||||
---
|
||||
title: 为容器设置环境变量
|
||||
content_template: templates/task
|
||||
content_type: task
|
||||
---
|
||||
|
||||
<!--
|
||||
---
|
||||
title: Define Environment Variables for a Container
|
||||
content_template: templates/task
|
||||
content_type: task
|
||||
weight: 20
|
||||
---
|
||||
-->
|
||||
|
||||
{{% capture overview %}}
|
||||
<!-- overview -->
|
||||
|
||||
<!--
|
||||
This page shows how to define environment variables for a container
|
||||
@@ -20,17 +20,18 @@ in a Kubernetes Pod.
|
||||
|
||||
本页将展示如何为 kubernetes Pod 下的容器设置环境变量。
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture prerequisites %}}
|
||||
|
||||
## {{% heading "prerequisites" %}}
|
||||
|
||||
|
||||
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture steps %}}
|
||||
|
||||
<!-- steps -->
|
||||
|
||||
<!--
|
||||
## Define an environment variable for a container
|
||||
@@ -167,9 +168,10 @@ Upon creation, the command `echo Warm greetings to The Most Honorable Kubernetes
|
||||
-->
|
||||
创建后,命令 `echo Warm greetings to The Most Honorable Kubernetes` 将在容器中运行。
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
||||
|
||||
<!--
|
||||
* Learn more about [environment variables](/docs/tasks/inject-data-application/environment-variable-expose-pod-information/).
|
||||
@@ -181,4 +183,4 @@ Upon creation, the command `echo Warm greetings to The Most Honorable Kubernetes
|
||||
* 有关如何通过环境变量来使用 Secret,请参阅[这里](/docs/user-guide/secrets/#using-secrets-as-environment-variables)。
|
||||
* 关于 [EnvVarSource](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#envvarsource-v1-core) 资源的信息。
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
---
|
||||
title: 使用 Secret 安全地分发凭证
|
||||
content_template: templates/task
|
||||
content_type: task
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
<!-- overview -->
|
||||
本文展示如何安全地将敏感数据(如密码和加密密钥)注入到 Pods 中。
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture prerequisites %}}
|
||||
|
||||
## {{% heading "prerequisites" %}}
|
||||
|
||||
|
||||
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture steps %}}
|
||||
|
||||
<!-- steps -->
|
||||
|
||||
## 将 secret 数据转换为 base-64 形式
|
||||
|
||||
@@ -187,9 +188,10 @@ base-64 形式的密码为 `Mzk1MjgkdmRnN0pi`。
|
||||
SECRET_PASSWORD=39528$vdg7Jb
|
||||
```
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
||||
|
||||
* 了解更多关于 [Secrets](/docs/concepts/configuration/secret/)。
|
||||
* 了解 [Volumes](/docs/concepts/storage/volumes/)。
|
||||
@@ -200,4 +202,4 @@ base-64 形式的密码为 `Mzk1MjgkdmRnN0pi`。
|
||||
* [Volume](/docs/api-reference/{{< param "version" >}}/#volume-v1-core)
|
||||
* [Pod](/docs/api-reference/{{< param "version" >}}/#pod-v1-core)
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
+13
-11
@@ -1,22 +1,23 @@
|
||||
---
|
||||
title: 通过文件将Pod信息呈现给容器
|
||||
content_template: templates/task
|
||||
content_type: task
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
<!-- overview -->
|
||||
|
||||
此页面描述Pod如何使用DownwardAPIVolumeFile把自己的信息呈现给pod中运行的容器。DownwardAPIVolumeFile可以呈现pod的字段和容器字段。
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture prerequisites %}}
|
||||
|
||||
## {{% heading "prerequisites" %}}
|
||||
|
||||
|
||||
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture steps %}}
|
||||
|
||||
<!-- steps -->
|
||||
|
||||
## Downward API
|
||||
|
||||
@@ -175,9 +176,9 @@ kubectl exec -it kubernetes-downwardapi-volume-example-2 -- sh
|
||||
```
|
||||
你可以使用同样的命令查看`cpu_request`, `mem_limit` 和`mem_request` 文件.
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture discussion %}}
|
||||
|
||||
<!-- discussion -->
|
||||
|
||||
## Capabilities of the Downward API
|
||||
|
||||
@@ -225,10 +226,11 @@ kubectl exec -it kubernetes-downwardapi-volume-example-2 -- sh
|
||||
对于容器来说,有时候拥有自己的信息是很有用的,可避免与Kubernetes过度耦合。Downward API使得容器使用自己或者集群的信息,而不必通过Kubernetes客户端或API服务器。
|
||||
|
||||
一个例子是有一个现有的应用假定要用一个非常熟悉的环境变量来保存一个唯一标识。一种可能是给应用增加处理层,但这样是冗余和易出错的,而且它违反了低耦合的目标。更好的选择是使用Pod名称作为标识,把Pod名称注入这个环境变量中。
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
||||
|
||||
* [PodSpec](/docs/resources-reference/{{< param "version" >}}/#podspec-v1-core)
|
||||
* [Volume](/docs/resources-reference/{{< param "version" >}}/#volume-v1-core)
|
||||
@@ -236,6 +238,6 @@ kubectl exec -it kubernetes-downwardapi-volume-example-2 -- sh
|
||||
* [DownwardAPIVolumeFile](/docs/resources-reference/{{< param "version" >}}/#downwardapivolumefile-v1-core)
|
||||
* [ResourceFieldSelector](/docs/resources-reference/{{< param "version" >}}/#resourcefieldselector-v1-core)
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
|
||||
|
||||
+11
-9
@@ -1,9 +1,9 @@
|
||||
---
|
||||
title: 通过环境变量将Pod信息呈现给容器
|
||||
content_template: templates/task
|
||||
content_type: task
|
||||
---
|
||||
|
||||
{{% capture overview %}}
|
||||
<!-- overview -->
|
||||
|
||||
此页面显示了Pod如何使用环境变量把自己的信息呈现给pod中运行的容器。环境变量可以呈现pod的字段和容器字段。
|
||||
|
||||
@@ -11,17 +11,18 @@ content_template: templates/task
|
||||
环境变量 和[DownwardAPIVolumeFiles](/docs/resources-reference/{{< param "version" >}}/#downwardapivolumefile-v1-core).
|
||||
这两种呈现Pod和Container字段的方式都称为*Downward API*。
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture prerequisites %}}
|
||||
|
||||
## {{% heading "prerequisites" %}}
|
||||
|
||||
|
||||
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
{{% capture steps %}}
|
||||
|
||||
<!-- steps -->
|
||||
|
||||
## Downward API
|
||||
|
||||
@@ -137,9 +138,10 @@ kubectl logs dapi-envars-resourcefieldref
|
||||
67108864
|
||||
```
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
{{% capture whatsnext %}}
|
||||
|
||||
## {{% heading "whatsnext" %}}
|
||||
|
||||
|
||||
* [给容器定义环境变量](/docs/tasks/configure-pod-container/define-environment-variable-container/)
|
||||
* [PodSpec](/docs/resources-reference/{{< param "version" >}}/#podspec-v1-core)
|
||||
@@ -149,7 +151,7 @@ kubectl logs dapi-envars-resourcefieldref
|
||||
* [ObjectFieldSelector](/docs/resources-reference/{{< param "version" >}}/#objectfieldselector-v1-core)
|
||||
* [ResourceFieldSelector](/docs/resources-reference/{{< param "version" >}}/#resourcefieldselector-v1-core)
|
||||
|
||||
{{% /capture %}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user