Skip to content

Commit dd48fd8

Browse files
aiwantaozigitlawr
authored andcommitted
docs: update resource definition
1 parent a20d164 commit dd48fd8

File tree

14 files changed

+118
-84
lines changed

14 files changed

+118
-84
lines changed

docs/operation/catalog/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 1
2+
sidebar_position: 3
33
---
44

55
# Catalog

docs/operation/connector.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 3
2+
sidebar_position: 5
33
---
44

55
# Connectors

docs/operation/resource-definition.md

+55-40
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,31 @@
11
---
2-
sidebar_position: 4
2+
sidebar_position: 1
33
---
44

55
# Resource Definitions
66

7-
A resource definition specifies a new type of resource, detailing its name, type, matching rules, and schema for deployment
8-
and usage under certain conditions. This enables Walrus to understand and manage the lifecycle of this resource type effectively.
7+
## Concepts
98

10-
## Viewing the Resource Definition List
9+
Resource Definition is used to declare a new type of resource, describing the name, type, matching rules, as well as administrator configurations and UI styles used under specific conditions. This enables Walrus to effectively understand and manage the lifecycle of this type of resource, which is the core for building multi-cloud applications and simplifying deployment configurations.
1110

12-
1. Click on `Operations` in the left-hand sidebar.
13-
2. Select the `Resource Definitions` tab to view the list of resource definitions.
11+
![definition-explain](/img/v0.6.0/operation/definition/definition-explain.png)
1412

15-
![definition-list](/img/v0.5.0/operation/definition/op-definition-list-en.png)
13+
Analogous to the concept of multi-architecture in containers, which allows different architecture image manifests to be included in the same image, enabling automatic selection of the appropriate image based on the actual environment when fetching images, allowing containers to seamlessly switch between different hardware.
14+
Walrus Resource Definitions are like manifests in the deployment process, containing configurations with different rules, and automatically selecting the appropriate template based on the environment during deployment.
1615

17-
## Viewing Resource Definition Details
16+
![definition-explain2](/img/v0.6.0/operation/definition/definition-explain2.png)
1817

19-
1. Navigate to `Operations` -> `Resource Definitions` in the left-hand sidebar to access the list of resource definitions.
20-
2. Locate the resource definition you wish to view and click on its name to open its detailed page.
21-
3. On the resource definition details page, you can view detailed information about the resource definition, including its matching rules, inputs and outputs, UI schema, and the list of resources created using this resource definition.
22-
4. In the list of created resources, you can manage resources by starting, stopping, deploying, deleting, etc. The list supports filtering by project name and matching rules.
18+
A resource definition consists of four parts: template, matching rules, administrator configurations, and UI styles.
2319

24-
![definition-detail](/img/v0.5.0/operation/definition/op-definition-detail-en.png)
20+
### Template
2521

26-
## Creating a Resource Definition
22+
Resource definitions support the use of both built-in templates provided by Walrus and imported templates.
2723

28-
1. Select `New Resource Definition` in the list of resource definitions.
29-
2. Complete the form. `Name` serves as the identifier of the resource definition and must be unique within the system. `Type` represents the type of resource, and multiple resource definitions can exist under the same `Type`. `Matching Rules` specifies how resources of this type align with templates under certain conditions. For more information, see [Resource Definition Matching Rules](#resource-definition-matching-rules).
30-
3. Click `Save` to finalize the creation.
24+
### Matching Rules
3125

32-
![definition-create](/img/v0.5.0/operation/definition/op-definition-create-en.png)
26+
The matching rules of a resource definition define matching conditions through selectors, as well as the templates and predefined configurations used when deploying resources of this type.
3327

34-
## Deleting a Resource Definition
35-
36-
1. Go to `Operations` -> `Resource Definitions` in the left-hand sidebar to view the list of resource definitions.
37-
2. Identify the resource definition you intend to delete.
38-
3. Before selecting the resource definition for deletion, ensure no existing resources depend on it. Then, click the `Delete` button.
39-
4. Confirm the deletion by clicking the `Confirm` button.
40-
41-
![definition-delete](/img/v0.5.0/operation/definition/op-definition-del-en.png)
42-
43-
## Resource Definition Matching Rules
44-
45-
The matching rules for resource definitions dictate the template and configuration used when deploying that type of
46-
resource.
47-
48-
### Selectors
28+
#### Selectors
4929

5030
A single matching rule can include multiple selectors. These selectors are based on equality, and their combination functions through a logical AND operation. A resource aligns with a matching rule if it meets all of the rule's selectors, leading to the application of the associated template and configuration during deployment.
5131

@@ -54,7 +34,7 @@ the `foo` project's `dev` environment, whereas it doesn't match a resource in th
5434

5535
![definition-selector](/img/v0.5.0/operation/definition/op-definition-selector-en.png)
5636

57-
### Rule Precedence
37+
#### Rule Precedence
5838

5939
Matching rules are not required to be exclusive. That is, multiple rules can match a single resource.
6040
In such scenarios, the rule with the highest priority is used. Priority is determined by the score of the selectors matched in the rule, with a higher score leading to a higher precedence. Selector scores are as follows:
@@ -63,16 +43,14 @@ In such scenarios, the rule with the highest priority is used. Priority is deter
6343
| -------------- | ---------------- | ----------- | ------------ | --------------- | ---------------- | ------------ |
6444
| Match Score | 1 | 2 | 4 | 8 | 16 | 32 |
6545

66-
### Template Configuration
46+
### Predefined Template Configurations
6747

6848
Template configurations within each matching rule are applied during the deployment of
69-
a resource following that rule. If a configuration is outlined in the resource definition schema and set by users in resource
70-
attributes,
49+
a resource following that rule. By adding predefined configurations under matching rules, admin can be provided with best practices to simplify deployment configurations.
7150

72-
## Resource Definition Schema
51+
### Input/Output and UI Schema
7352

74-
The schema (input variables and outputs) of a resource definition is generated automatically from the combined
75-
schema of all templates included in its matching rules.
53+
The input variables and output of a resource definition are automatically generated from all templates included in its matching rules.
7654

7755
For example, consider a resource definition that uses Templates A and B in its matching rules.
7856

@@ -81,6 +59,43 @@ For example, consider a resource definition that uses Templates A and B in its m
8159

8260
Consequently, the resource definition's schema will include the input `image` and the output `endpoint`.
8361

62+
The UI schema of a resource definition is automatically generated based on input variables, supporting customizable user interface styles to shield complexity.
63+
64+
## Managing Resource Definitions
65+
66+
### Viewing the Resource Definition List
67+
68+
1. Click on `Operations` in the left-hand sidebar.
69+
2. Select the `Resource Definitions` tab to view the list of resource definitions.
70+
71+
![definition-list](/img/v0.5.0/operation/definition/op-definition-list-en.png)
72+
73+
### Viewing Resource Definition Details
74+
75+
1. Navigate to `Operations` -> `Resource Definitions` in the left-hand sidebar to access the list of resource definitions.
76+
2. Locate the resource definition you wish to view and click on its name to open its detailed page.
77+
3. On the resource definition details page, you can view detailed information about the resource definition, including its matching rules, inputs and outputs, UI schema, and the list of resources created using this resource definition.
78+
4. In the list of created resources, you can manage resources by starting, stopping, deploying, deleting, etc. The list supports filtering by project name and matching rules.
79+
80+
![definition-detail](/img/v0.5.0/operation/definition/op-definition-detail-en.png)
81+
82+
### Creating a Resource Definition
83+
84+
1. Select `New Resource Definition` in the list of resource definitions.
85+
2. Complete the form. `Name` serves as the identifier of the resource definition and must be unique within the system. `Type` represents the type of resource, and multiple resource definitions can exist under the same `Type`. `Matching Rules` specifies how resources of this type align with templates under certain conditions. For more information, see [Resource Definition Matching Rules](#resource-definition-matching-rules).
86+
3. Click `Save` to finalize the creation.
87+
88+
![definition-create](/img/v0.5.0/operation/definition/op-definition-create-en.png)
89+
90+
### Deleting a Resource Definition
91+
92+
1. Go to `Operations` -> `Resource Definitions` in the left-hand sidebar to view the list of resource definitions.
93+
2. Identify the resource definition you intend to delete.
94+
3. Before selecting the resource definition for deletion, ensure no existing resources depend on it. Then, click the `Delete` button.
95+
4. Confirm the deletion by clicking the `Confirm` button.
96+
97+
![definition-delete](/img/v0.5.0/operation/definition/op-definition-del-en.png)
98+
8499
### Customizing the UI Schema of a Resource Definition
85100

86101
You can customize the UI schema of a resource definition. This is especially useful when you want to simplify or modify the configurations

docs/operation/template/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 1
2+
sidebar_position: 2
33
---
44

55
# Template

docs/operation/variable.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 2
2+
sidebar_position: 4
33
---
44

55
# Variables

i18n/zh/docusaurus-plugin-content-docs/current/operation/catalog/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 1
2+
sidebar_position: 3
33
---
44

55
# 模板库

i18n/zh/docusaurus-plugin-content-docs/current/operation/connector.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 3
2+
sidebar_position: 5
33
---
44

55
# 连接器

i18n/zh/docusaurus-plugin-content-docs/current/operation/resource-definition.md

+55-36
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,53 @@
11
---
2-
sidebar_position: 4
2+
sidebar_position: 1
33
---
44

55
# 资源定义
66

7-
资源定义用于声明一种新类型的资源,它描述该资源类型的名称、类型、匹配规则以及在特定条件下的部署和使用的模式。这使得 Walrus 能够有效地理解和管理这种资源类型的生命周期。
7+
## 概念
88

9-
## 查看资源定义列表
9+
资源定义用于声明一种新类型的资源,它描述该资源类型的名称、类型、匹配规则以及在特定条件下的管理员配置和使用的 UI 样式。这使得 Walrus 能够有效地理解和管理这种资源类型的生命周期,是实现构建多云应用、简化部署配置的核心。
1010

11-
1. 在左侧边栏中点击`操作中心`
12-
2. 选择`资源定义`标签以查看资源定义列表。
11+
![definition-explain](/img/v0.6.0/operation/definition/definition-explain-cn.png)
1312

14-
![definition-list](/img/v0.5.0/operation/definition/op-definition-list.png)
13+
类比容器中多架构的概念,允许在同一个镜像中包含不同架构的镜像 Manifest 配置,获取镜像时根据实际环境自动选择合适镜像,使得容器可以在不同硬件上无缝切换。
14+
Walrus 资源定义就是部署过程中的 Manifest,包含不同规则的配置,在部署时,自动根据部署环境选择合适的部署模板。
1515

16-
## 查看资源定义详情
16+
![definition-explain2](/img/v0.6.0/operation/definition/definition-explain2-cn.png)
1717

18-
1. 在左侧边栏中导航到`操作中心` -> `资源定义`以访问资源定义列表。
19-
2. 找到您希望查看的资源定义并点击其名称以打开其详细页面。
20-
3. 在资源定义详细页面中,您可以查看资源定义的详细信息,包括其匹配规则,输入输出,UI 模式和使用该资源定义创建的资源列表。
21-
4. 在已创建的资源列表中,您可以对资源进行管理操作,例如启动、停止、部署、删除等。列表支持对项目名称和匹配规则进行筛选。
18+
资源定义包括四个部分:模板,匹配规则,模版配置和 UI 样式。
2219

23-
![definition-detail](/img/v0.5.0/operation/definition/op-definition-detail.png)
20+
### 模板
2421

25-
## 创建资源定义
22+
资源定义支持使用Walrus 内置的模板或导入的模板。
2623

27-
1. 在资源定义列表中选择`新建资源定义`
28-
2. 完成表单。`名称`作为资源定义的标识符,`名称`在系统内必须唯一。`类型`表示资源的类型,相同`类型`下可以有多个资源定义。`匹配规则`指定了在特定条件下,这种类型的资源如何与模板对齐。更多信息请参阅[资源定义匹配规则](#resource-definition-matching-rules)
29-
3. 点击`保存`以完成创建。
24+
### 匹配规则
3025

31-
![definition-create](/img/v0.5.0/operation/definition/op-definition-create.png)
26+
资源定义的匹配规则通过选择器定义了匹配条件,以及部署该类型资源时使用的模板和预定义配置。
3227

33-
## 删除资源定义
34-
35-
1. 在左侧边栏中前往`操作中心` -> `资源定义`以查看资源定义列表。
36-
2. 确定您打算删除的资源定义。
37-
3. 在选择删除资源定义之前,请确保没有现有资源依赖于它。然后,点击`删除`按钮。
38-
4. 点击`确认`按钮确认删除。
39-
40-
![definition-delete](/img/v0.5.0/operation/definition/op-definition-del.png)
41-
42-
## 资源定义匹配规则
43-
44-
资源定义的匹配规则决定了部署该类型资源时使用的模板和配置。
45-
46-
### 选择器
28+
#### 选择器
4729

4830
单个匹配规则可以包括多个选择器。这些选择器基于相等性,它们的组合通过逻辑与操作(AND)来功能。如果资源满足规则的所有选择器,则与匹配规则对齐,从而在部署过程中应用相关的模板和配置。
4931

5032
例如,带有选择器`项目名称=foo``环境名称=dev`的匹配规则匹配`foo`项目的`dev`环境中的资源,而不匹配`test`环境中的资源。
5133

5234
![definition-selector](/img/v0.5.0/operation/definition/op-definition-selector.png)
5335

54-
### 规则优先级
36+
#### 规则优先级
5537

5638
匹配规则不是互斥的。也就是说,多个规则可以匹配单个资源。在这种情况下,将使用优先级最高的规则。优先级由规则中匹配的选择器评分决定,评分总和越高,优先级越高。选择器评分如下:
5739

5840
| 条件类型 | 环境类型 | 项目标签 | 项目名称 | 环境标签 | 环境名称 | 资源标签 |
5941
| -------- | -------- | -------- | -------- | -------- | -------- | -------- |
6042
| 匹配分数 | 1 | 2 | 4 | 8 | 16 | 32 |
6143

62-
### 模板配置
44+
### 预定义模版配置
6345

64-
每个匹配规则中的模板配置在遵循该规则的资源部署期间应用。如果资源定义模式中概述了配置,并且用户在资源属性中设置了配置,
46+
通过在匹配的规则下添加预定义配置,能够为用户提供最佳实践,简化用户部署配置。
6547

66-
## 资源定义模式
48+
### 输入输出和 UI 样式
6749

68-
资源定义的模式(输入变量和输出)是从其匹配规则中包含的所有模板的组合模式自动生成的
50+
资源定义的输入变量和输出是从其匹配规则中包含的所有模板的组合模式自动生成的
6951

7052
例如,考虑一个资源定义,它在其匹配规则中使用模板 A 和 B。
7153

@@ -74,6 +56,43 @@ sidebar_position: 4
7456

7557
因此,资源定义的模式将包括输入`image`和输出`endpoint`
7658

59+
资源定义的 UI 样式是根据输入变量自动生成的,支持根据需求定制的用户界面样式,屏蔽复杂度。
60+
61+
## 管理资源定义
62+
63+
### 查看资源定义列表
64+
65+
1. 在左侧边栏中点击`操作中心`
66+
2. 选择`资源定义`标签以查看资源定义列表。
67+
68+
![definition-list](/img/v0.5.0/operation/definition/op-definition-list.png)
69+
70+
### 查看资源定义详情
71+
72+
1. 在左侧边栏中导航到`操作中心` -> `资源定义`以访问资源定义列表。
73+
2. 找到您希望查看的资源定义并点击其名称以打开其详细页面。
74+
3. 在资源定义详细页面中,您可以查看资源定义的详细信息,包括其匹配规则,输入输出,UI 模式和使用该资源定义创建的资源列表。
75+
4. 在已创建的资源列表中,您可以对资源进行管理操作,例如启动、停止、部署、删除等。列表支持对项目名称和匹配规则进行筛选。
76+
77+
![definition-detail](/img/v0.5.0/operation/definition/op-definition-detail.png)
78+
79+
### 创建资源定义
80+
81+
1. 在资源定义列表中选择`新建资源定义`
82+
2. 完成表单。`名称`作为资源定义的标识符,`名称`在系统内必须唯一。`类型`表示资源的类型,相同`类型`下可以有多个资源定义。`匹配规则`指定了在特定条件下,这种类型的资源如何与模板对齐。更多信息请参阅[资源定义匹配规则](#resource-definition-matching-rules)
83+
3. 点击`保存`以完成创建。
84+
85+
![definition-create](/img/v0.5.0/operation/definition/op-definition-create.png)
86+
87+
### 删除资源定义
88+
89+
1. 在左侧边栏中前往`操作中心` -> `资源定义`以查看资源定义列表。
90+
2. 确定您打算删除的资源定义。
91+
3. 在选择删除资源定义之前,请确保没有现有资源依赖于它。然后,点击`删除`按钮。
92+
4. 点击`确认`按钮确认删除。
93+
94+
![definition-delete](/img/v0.5.0/operation/definition/op-definition-del.png)
95+
7796
### 自定义资源定义的 UI 模式
7897

7998
您可以自定义资源定义的 UI 模式。当您想简化或修改该类型资源的用户配置时,这一点尤其有用。

i18n/zh/docusaurus-plugin-content-docs/current/operation/template/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 1
2+
sidebar_position: 2
33
---
44

55
# 模板

i18n/zh/docusaurus-plugin-content-docs/current/operation/variable.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 2
2+
sidebar_position: 4
33
---
44

55
# 变量
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)