Definition
Definition are the basic building block of the KubeVela platform. A definition encapsulates an arbitrarily complex automation as a lego style module that can be used to compose an Application, then safely shared, and repeatably executed by any KubeVela engine.
There're four types of Definition, they're ComponentDefinition
, TraitDefinition
, PolicyDefinition
and WorkflowStepDefinition
, corresponding to the application concepts.
#
How to get out-of-box Definitions?There're two sources to get out-of-box definitions:
- Built-in definitions will be installed along with KubeVela helm chart. You can refer to the following links to learn more about built-in definitions.
- Addons, as extensions of KubeVela, each addon contains a bunch of definitions along its CRD controllers.
- The community has a verified addon registry which contains a large catalog of addons, the registry is maintained by the KubeVela team.
#
Lifecycle of a DefinitionA definition's lifecycle usually has 3 stages:
#
DiscoveryWhen definitions installed in the system, they can be discovered by end user immediately.
- Check the list:
- Show the details:
You can also view the details with a browser, the following command will launch a server and invoke your browser automatically:
- Discover in UI console ( addon
velaux
installed)
These definitions can also be discovered by the UI console, the more important thing is they can be displayed very well with ui schema defined.
#
UseIf you're a fan of our UI console, the usage of definition is very straight forward, just click along with the creation of the deployment process.
- Create Application and choose Component type which is actually choosing which component definition to use.
- Fill the properties of component is actually fill the parameter of component definition.
- The same step for trait, policy and workflow.
Finally, the UI console will compose the whole deployment plan in the format of OAM like below, then KubeVela controller will take care of the rest things:
Use the definition in command works the same, you can compose the application yaml manually and use vela
command line tool to deploy.
#
Customize⚠️ In most cases, you don't need to customize any definitions unless you're going to extend the capability of KubeVela. Before that, you should check the built-in definitions and addons to confirm if they can fit your needs.
A new definition is built in a declarative template in CUE configuration language. If you're not familiar with CUE, you can refer to CUE Basic for some knowledge.
A definition describes the module's inputs, outputs, operations, and the wiring between them. Here is an example of a simple component definition:
The type
defines what kind of definition it is, the parameter
defines the inputs, while the output
section defines the outputs.
You can refer to detail docs about how to manage definition or learn the definition protocol.
#
Next Step- View Architecture to learn the overall architecture of KubeVela.