This section will introduce how to pass data between components.
In KubeVela, we can use inputs and outputs in Components to pass data.
Outputs is made of
valueFrom. Input will use
name to reference output.
We can write
valueFrom in the following ways:
- Fill string value in the field, eg.
- Use expression, eg.
valueFrom: output.metadata.name. Note that
outputis a built-in field referring to the resource in the component that is rendered and deployed to the cluster.
+to combine above two ways, the computed value will be the result, eg.
valueFrom: output.metadata.name + "testString".
Inputs is made of
parameterKey. Input uses
from to reference output,
parameterKey is a expression that assigns the value of the input to the corresponding field.
- Specify inputs:
- The field parameterKey specifies the field path of the parameter key in component to be assigned after rendering:
Which means the input value will be passed into the below properties:
In the following we will apply a WordPress server with the MySQL address passed from a MySQL component:
The WordPress with MySQL has been successfully applied.