This documentation will explain the core resource model of KubeVela which is fully powered by Open Application Model (OAM).
KubeVela introduces an
Application CRD as its main API that captures a full application deployment. Every application is composed by multiple components with attachable operational behaviors (traits). For example:
Though the application object doesn't have fixed schema, it is a composition object assembled by several programmable building blocks as shown below.
The component model in KubeVela is designed to allow component providers to encapsulate deployable/provisionable entities by leveraging widely adopted tools such as CUE, Helm etc, and give a easier path to developers to deploy complicated microservices with ease.
Templates based encapsulation is probably the mostly widely used approach to enable efficient application deployment and exposes easier interfaces to end users. For example, many tools today encapsulate Kubernetes Deployment and Service into a Web Service module, and then instantiate this module by simply providing parameters such as image=foo and ports=80. This pattern can be found in cdk8s (e.g.
web-service.ts ), CUE (e.g.
kube.cue), and many widely used Helm charts (e.g. Web Service).
Hence, a components provider could be anyone who packages software components in form of Helm chart of CUE modules. Think about 3rd-party software distributor, DevOps team, or even your CI pipeline.
In above example, it describes an application composed with Kubernetes stateless workload (component
foo) and a Alibaba Cloud OSS bucket (component
In above example,
type: worker means the specification of this component (claimed in following
properties section) will be enforced by a
ComponentDefinition object named
worker as below:
properties section of
backend only exposes two parameters to fill:
cmd, this is enforced by the
parameter list of the
.spec.template field of the definition.
Traits are operational features that can be attached to component per needs. Traits are normally considered as platform features and maintained by platform team. In the above example,
type: autoscaler in
frontend means the specification (i.e.
of this trait will be enforced by a
TraitDefinition object named
autoscaler as below:
The application also have a
Please note that the end users of KubeVela do NOT need to know about definition objects, they learn how to use a given capability with visualized forms (or the JSON schema of parameters if they prefer). Please check the Generate Forms from Definitions section about how this is achieved.
Once the application is deployed, KubeVela will index and manage the underlying instances with name, revisions, labels and selector etc in automatic approach. These metadata are shown as below.
|The name of its corresponding |
|The name of its corresponding |
|The name of the application it belongs to|
|The name of the component it belongs to|
|The name of trait resource instance|
|The name of the application revision it belongs to|
Consider these metadata as a standard contract for any "day 2" operation controller such as rollout controller to work on KubeVela deployed applications. This is the key to ensure the interoperability for KubeVela based platform as well.
Despite the efficiency and extensibility in abstracting application deployment, IaC (Infrastructure-as-Code) tools may lead to an issue called Infrastructure/Configuration Drift, i.e. the generated component instances are not in line with the expected configuration. This could be caused by incomplete coverage, less-than-perfect processes or emergency changes. This makes them can be barely used as a platform level building block.
Hence, KubeVela is designed to maintain all these programmable capabilities with Kubernetes Control Loop and leverage Kubernetes control plane to eliminate the issue of configuration drifting, while still keeps the flexibly and velocity enabled by IaC.