This is an automated email from the ASF dual-hosted git repository. fanrui pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/flink-kubernetes-operator.git
The following commit(s) were added to refs/heads/main by this push: new d920a235 [FLINK-35448] Translate pod templates documentation into Chinese d920a235 is described below commit d920a235a3357311b96e3c087d5918d83da27853 Author: caicancai <2356672...@qq.com> AuthorDate: Fri May 24 21:17:39 2024 +0800 [FLINK-35448] Translate pod templates documentation into Chinese Co-authored-by: Yuepeng Pan <flin...@126.com> Co-authored-by: 1996fanrui <1996fan...@gmail.com> --- .../docs/custom-resource/pod-template.md | 42 +++++++++++----------- docs/content/docs/custom-resource/pod-template.md | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/docs/content.zh/docs/custom-resource/pod-template.md b/docs/content.zh/docs/custom-resource/pod-template.md index bf7097e5..a10efc79 100644 --- a/docs/content.zh/docs/custom-resource/pod-template.md +++ b/docs/content.zh/docs/custom-resource/pod-template.md @@ -26,21 +26,18 @@ under the License. # Pod template -The operator CRD is designed to have a minimal set of direct, short-hand CRD settings to express the most -basic attributes of a deployment. For all other settings the CRD provides the `flinkConfiguration` and -`podTemplate` fields. +<a name="pod-template"></a> -Pod templates permit customization of the Flink job and task manager pods, for example to specify -volume mounts, ephemeral storage, sidecar containers etc. +Operator CRD 被设计为一组直接、简短的 CRD 设置,以表达 deployment 的最基本属性。对于所有其他设置,CRD 提供了 `flinkConfiguration` 和 `podTemplate` 字段。 -Pod templates can be layered, as shown in the example below. -A common pod template may hold the settings that apply to both job and task manager, -like `volumeMounts`. Another template under job or task manager can define additional settings that supplement or override those -in the common template, such as a task manager sidecar. +Pod templates 允许自定义 Flink Job 和 Task Manager 的 pod,例如指定卷挂载、临时存储、sidecar 容器等。 -The operator is going to merge the common and specific templates for job and task manager respectively. +Pod template 可以被分层,如下面的示例所示。 +一个通用的 pod template 可以保存适用于作业和 task manager 的设置,比如 `volumeMounts`。作业或 task manager 下的另一个模板可以定义补充或覆盖通用模板中的其他设置,比如一个 task manager sidecar。 -Here the full example: +Operator 将分别合并作业和 task manager 的通用和特定模板。 + +下面是一个完整的示例: ```yaml apiVersion: flink.apache.org/v1beta1 @@ -93,18 +90,21 @@ spec: ``` {{< hint info >}} -When using the operator with Flink native Kubernetes integration, please refer to [pod template field precedence]( -https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/resource-providers/native_kubernetes/#fields-overwritten-by-flink). +当使用与 Flink 原生 Kubernetes 集成的 operator 时,请参考 [pod template 字段优先级]( +https://nightlies.apache.org/flink/flink-docs-master/docs/deployment/resource-providers/native_kubernetes/#fields-overwritten-by-flink)。 {{< /hint >}} + ## Array Merging Behaviour -When layering pod templates (defining both a top level and jobmanager specific podtemplate for example) the corresponding yamls are merged together. +<a name="array-meging-behaviour"></a> + +当分层 pod templates(例如同时定义顶层和 jobmanager 特定的 pod 模板)时,相应的 yaml 会合并在一起。 -The default behaviour of the pod template mechanism is to merge array arrays by merging the objects in the respective array positions. -This requires that containers in the podTemplates are defined in the same order otherwise the results may be undefined. +Pod 模板机制的默认行为是通过合并相应数组位置的对象来合并数组。 +这要求 podTemplates 中的容器以相同的顺序定义,否则结果可能未定义。 -Default behaviour (merge by position): +默认行为(按位置合并): ``` arr1: [{name: a, p1: v1}, {name: b, p1: v1}] @@ -113,10 +113,10 @@ arr1: [{name: a, p2: v2}, {name: c, p2: v2}] merged: [{name: a, p1: v1, p2: v2}, {name: c, p1: v1, p2: v2}] ``` -The operator supports an alternative array merging mechanism that can be enabled by the `kubernetes.operator.pod-template.merge-arrays-by-name` flag. -When true, instead of the default positional merging, object array elements that have a `name` property defined will be merged by their name and the resulting array will be a union of the two input arrays. +Operator 支持另一种数组合并机制,可以通过 `kubernetes.operator.pod-template.merge-arrays-by-name` 标志启用。 +当为 true 时,不会进行默认的位置合并,而是根据名称合并定义了 `name` 属性的对象数组元素,并且生成的数组将是两个输入数组的并集。 -Merge by name: +通过名称合并: ``` arr1: [{name: a, p1: v1}, {name: b, p1: v1}] @@ -125,4 +125,4 @@ arr1: [{name: a, p2: v2}, {name: c, p2: v2}] merged: [{name: a, p1: v1, p2: v2}, {name: b, p1: v1}, {name: c, p2: v2}] ``` -Merging by name can we be very convenient when merging container specs or when the base and override templates are not defined together. +当合并容器规格或者当基础模板和覆盖模板没有一起定义时,按名称合并可以非常方便。 diff --git a/docs/content/docs/custom-resource/pod-template.md b/docs/content/docs/custom-resource/pod-template.md index bf7097e5..3695864c 100644 --- a/docs/content/docs/custom-resource/pod-template.md +++ b/docs/content/docs/custom-resource/pod-template.md @@ -125,4 +125,4 @@ arr1: [{name: a, p2: v2}, {name: c, p2: v2}] merged: [{name: a, p1: v1, p2: v2}, {name: b, p1: v1}, {name: c, p2: v2}] ``` -Merging by name can we be very convenient when merging container specs or when the base and override templates are not defined together. +Merging by name can be very convenient when merging container specs or when the base and override templates are not defined together.