-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translate i18n/zh/docusaurus-plugin-content-docs/current/platform-engineers/policy/custom-policy.md #797
Conversation
…ineers/policy/custom-policy.md
@@ -2,19 +2,19 @@ | |||
title: 自定义策略 | |||
--- | |||
|
|||
In this section we will introduce how to define a custom policy with CUE. Make sure you've learned the basic knowledge about [Definition Concept](../../getting-started/definition) and [how to manage definition](../cue/definition-edit). | |||
本节将介绍通过 CUE 实现自定义策略,在开始之前,你需要学习模块[模块定义](../../getting-started/definition) 的基本概念 和 [如何管理模块定义](../cue/definition-edit)。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
本节将介绍通过 CUE 实现自定义策略,在开始之前,你需要学习模块[模块定义](../../getting-started/definition) 的基本概念 和 [如何管理模块定义](../cue/definition-edit)。 | |
本节将介绍通过 CUE 实现自定义策略,在开始之前,你需要学习 [模块定义](../../getting-started/definition) 的基本概念和 [如何管理模块定义](../cue/definition-edit)。 |
|
||
Generate resources in policy is similar to trait, policy can be used to define things across components. | ||
通过策略生成资源类似于 Trait ,策略可用于跨 components 定义事物。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Policy 和 Trait 一样也是 OAM 的概念,都不翻译或者都翻译,建议都不翻译。components -> component
@@ -69,15 +68,15 @@ template: { | |||
} | |||
``` | |||
|
|||
Apply to our control plane to make this trait work: | |||
通过控制台,可以创建这个 Trait : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
通过控制台,可以创建这个 Trait : | |
把这个 Trait 应用到控制平面来使其生效: |
|
||
``` | ||
vela def apply -f myroute.cue | ||
``` | ||
|
||
Then our end users can discover it immediately and use it in `Application`. | ||
随后我们的终端用户可以立即发现并在 `Application`中使用这个 Trait 。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
随后我们的终端用户可以立即发现并在 `Application`中使用这个 Trait 。 | |
随后我们的终端用户可以立即发现并在 `Application` 中使用这个 Trait 。 |
@@ -124,13 +123,13 @@ spec: | |||
service: unified | |||
``` | |||
|
|||
You can define any Kubernetes API objects in policies if you want. | |||
如果需要,您可以在策略中定义任何 Kubernetes API 对象。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果需要,您可以在策略中定义任何 Kubernetes API 对象。 | |
如果需要,你可以在策略中定义任何 Kubernetes API 对象。 |
|
||
Not all policies generate resources, there're several [built-in policies](../../end-user/policies/references) which are used to control the whole delivery precess and workflows. These special polices are usually coded in the application controller. | ||
并不是所有的策略都可以生成资源, 有几个 [内置策略](../../end-user/policies/references) 用于控制整个交付过程和工作流程。这些特殊策略通常编写在application controller中。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
并不是所有的策略都可以生成资源, 有几个 [内置策略](../../end-user/policies/references) 用于控制整个交付过程和工作流程。这些特殊策略通常编写在application controller中。 | |
并不是所有的策略都可以生成资源, 有几个 [内置策略](../../end-user/policies/references) 用于控制整个交付过程和工作流程。这些特殊策略通常编写在 application controller 中。 |
|
||
After using `vela up` by the following command: | ||
通过如下命令使用 `vela up` : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
通过如下命令使用 `vela up` : | |
执行 `vela up` 命令后: |
|
||
## What's Next | ||
## 下一篇 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## 下一篇 | |
## 下一步 |
@@ -30,7 +30,7 @@ template: { | |||
} | |||
``` | |||
|
|||
The rule is align with component definition, you must specify `output`, while you can use `outputs` for more objects, the format as below: | |||
规则要和 components 定义保持一致,必须制定 `output`,对于多个对象的 `outputs` ,格式如下: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
components -> component
ouputs 可用于多个对象
Thank you for your contribution. Please sign off your commits. |
…ineers/policy/custom-policy.md Signed-off-by: congcongcode <congcongh13@126.com>
No description provided.