Translate i18n/zh/docusaurus-plugin-content-docs/current/developers/references/README.md
This commit is contained in:
parent
d95a986650
commit
c7386edaea
|
|
@ -1,46 +1,45 @@
|
|||
---
|
||||
title: The Reference Documentation of Capabilities
|
||||
title: 功能参考文档
|
||||
---
|
||||
|
||||
In this documentation, we will show how to check the detailed schema of a given capability (i.e. component type or trait).
|
||||
在这篇文档中,我们将展示如何查看给定能力的详细文档 (比如 component 或者 trait)。
|
||||
|
||||
This may sound challenging because every capability is a "plug-in" in KubeVela (even for the built-in ones), also, it's by design that KubeVela allows platform administrators to modify the capability templates at any time. In this case, do we need to manually write documentation for every newly installed capability? And how can we ensure those documentations for the system is up-to-date?
|
||||
这听起来很有挑战,因为每种能力都是 KubeVela 的一个插件(内置能力也是如此)。同时,根据设计, KubeVela 允许平台管理员随时修改功能模板。在这种情况下,我们是否需要为每个新安装的功能手动写文档? 以及我们如何确保系统的那些文档是最新的?
|
||||
|
||||
## Using Browser
|
||||
## 使用浏览器
|
||||
|
||||
Actually, as a important part of its "extensibility" design, KubeVela will always **automatically generate** reference documentation for every workload type or trait registered in your Kubernetes cluster, based on the template in its definition of course. This feature works for any capability: either built-in ones or your own workload types/traits.
|
||||
|
||||
Thus, as an end user, the only thing you need to do is:
|
||||
实际上,作为其可扩展设计的重要组成部分, KubeVela 总是会根据模板的定义对每种 workload 类型或者 Kubernetes 集群注册的 trait 自动生成参考文档。此功能适用于任何功能:内置功能或者你自己的 workload 类型/ traits 。
|
||||
因此,作为一个终端用户,你唯一需要做的事情是:
|
||||
|
||||
```console
|
||||
$ vela show COMPONENT_TYPE or TRAIT --web
|
||||
```
|
||||
|
||||
This command will automatically open the reference documentation for given component type or trait in your default browser.
|
||||
这条命令会自动在你的默认浏览器中打开对应的 component 类型或者 traint 参考文档。
|
||||
|
||||
Let's take `$ vela show webservice --web` as example. The detailed schema documentation for `Web Service` component type will show up immediately as below:
|
||||
以 `$ vela show webservice --web` 为例。 `Web Service` component 类型的详细的文档将立即显示如下:
|
||||
|
||||

|
||||
|
||||
Note that there's in the section named `Specification`, it even provides you with a full sample for the usage of this workload type with a fake name `my-service-name`.
|
||||
注意, 在名为 `Specification` 的部分中,它甚至为你提供了一种使用假名称 `my-service-name` 的这种 workload 类型。
|
||||
|
||||
Similarly, we can also do `$ vela show autoscale`:
|
||||
同样的, 我们可以执行 `$ vela show autoscale`:
|
||||
|
||||

|
||||
|
||||
With these auto-generated reference documentations, we could easily complete the application description by simple copy-paste, for example:
|
||||
使用这些自动生成的参考文档,我们可以通过简单的复制粘贴轻松地完成应用程序描述,例如:
|
||||
|
||||
```yaml
|
||||
name: helloworld
|
||||
|
||||
services:
|
||||
backend: # copy-paste from the webservice ref doc above
|
||||
backend: # 复制粘贴上面的 webservice 参考文档
|
||||
image: oamdev/testapp:v1
|
||||
cmd: ["node", "server.js"]
|
||||
port: 8080
|
||||
cpu: "0.1"
|
||||
|
||||
autoscale: # copy-paste and modify from autoscaler ref doc above
|
||||
autoscale: # 复制粘贴并修改上面的 autoscaler 参考文档
|
||||
min: 1
|
||||
max: 8
|
||||
cron:
|
||||
|
|
@ -51,9 +50,9 @@ services:
|
|||
timezone: "America/Los_Angeles"
|
||||
```
|
||||
|
||||
## Using Terminal
|
||||
## 使用命令行终端
|
||||
|
||||
This reference doc feature also works for terminal-only case. For example:
|
||||
此参考文档功能也适用于仅有命令行终端的情况,例如:
|
||||
|
||||
```shell
|
||||
$ vela show webservice
|
||||
|
|
@ -96,9 +95,9 @@ $ vela show webservice
|
|||
+------+------------------------------------------------------------------+--------+----------+---------+
|
||||
```
|
||||
|
||||
## For Built-in Capabilities
|
||||
## 内置功能
|
||||
|
||||
Note that for all the built-in capabilities, we already published their reference docs below based on the same doc generation mechanism.
|
||||
注意,对于所有的内置功能,我们已经将它们的参考文档发布在下面,这些文档遵循同样的文档生成机制。
|
||||
|
||||
|
||||
- Workload Types
|
||||
|
|
@ -110,4 +109,4 @@ Note that for all the built-in capabilities, we already published their referenc
|
|||
- [autoscale](traits/autoscale)
|
||||
- [rollout](traits/rollout)
|
||||
- [metrics](traits/metrics)
|
||||
- [scaler](traits/scaler)
|
||||
- [scaler](traits/scaler)
|
||||
|
|
|
|||
Loading…
Reference in New Issue