You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/operation/resource-definition.md
+55-40
Original file line number
Diff line number
Diff line change
@@ -1,51 +1,31 @@
1
1
---
2
-
sidebar_position: 4
2
+
sidebar_position: 1
3
3
---
4
4
5
5
# Resource Definitions
6
6
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
9
8
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.
11
10
12
-
1. Click on `Operations` in the left-hand sidebar.
13
-
2. Select the `Resource Definitions` tab to view the list of resource definitions.
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.
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.
Resource definitions support the use of both built-in templates provided by Walrus and imported templates.
27
23
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).
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.
33
27
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.
The matching rules for resource definitions dictate the template and configuration used when deploying that type of
46
-
resource.
47
-
48
-
### Selectors
28
+
#### Selectors
49
29
50
30
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.
51
31
@@ -54,7 +34,7 @@ the `foo` project's `dev` environment, whereas it doesn't match a resource in th
Matching rules are not required to be exclusive. That is, multiple rules can match a single resource.
60
40
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
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.
71
50
72
-
##Resource Definition Schema
51
+
### Input/Output and UI Schema
73
52
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.
76
54
77
55
For example, consider a resource definition that uses Templates A and B in its matching rules.
78
56
@@ -81,6 +59,43 @@ For example, consider a resource definition that uses Templates A and B in its m
81
59
82
60
Consequently, the resource definition's schema will include the input `image` and the output `endpoint`.
83
61
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.
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.
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).
0 commit comments