fix several small problem (#854)

* fix several small problem

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* addon paramter extract to 3 level

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>

* fix comments

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
This commit is contained in:
wyike 2022-07-13 13:12:51 +08:00 committed by GitHub
parent 519f74e92d
commit bcbc873f67
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 21 additions and 2 deletions

View File

@ -160,7 +160,7 @@ spec:
The detail of the example is [velaux](https://github.com/kubevela/catalog/tree/master/addons/velaux).
#### Define parameter for addon
### Define parameter for addon
When the resource is defined in CUE, you can also define parameters for addon by writing a `parameter.cue` file in the resources folder as shown below:
@ -170,7 +170,7 @@ parameter: {
}
```
It can cooperate with the resource file in CUE:
It can cooperate with the resource file in CUE, here we have a CUE file `vela-apiserver.cue` :
```cue
output: {
@ -200,6 +200,7 @@ kind: Application
spec:
components:
- type: webservice
name: api-server
properties:
image: "oamdev/vela-apiserver:v1.4.0"
traits:
@ -208,6 +209,8 @@ spec:
name: my-account
```
**Please notice** The **name** of component is the same with file name in the `resource/` folder with file type suffix trimmed.
##### Use context render component
Besides using `parameter` to generate component dynamically, you can also use `context` to render runtime variable.

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 150 KiB

View File

@ -80,6 +80,10 @@ Let's continue our demo, the first deployment has no difference with a normal de
vela status canary-demo
```
If you have enabled [velaux](../reference/addons/velaux) addon, you can view the application topology graph that all `v1` pods are ready now.
![image](../resources/helm-rollout-v1.jpg)
Access the gateway endpoint. You can see the result always is `Demo: V1`
```shell
$ curl -H "Host: canary-demo.com" <ingress-controller-address>/version
@ -142,6 +146,10 @@ After verify the success of the canary version through business-related metrics,
vela workflow resume canary-demo
```
View topology graph again, you will see `kruise-rollout` trait created a `v2` pod, and this pod will serve the canary traffic. Meanwhile, the pods of `v1` are still running and server non-canary traffic.
![image](../resources/helm-rollout-v2.jpg)
Access the gateway endpoint again multi times. You will find out the chance to meet result `Demo: v2` is highly increased, almost 90%.
```shell

View File

@ -128,6 +128,10 @@ Let's continue our demo, the first deployment has no difference with a normal de
vela status canary-demo
```
If you have enabled [velaux](../reference/addons/velaux) addon, you can view the application topology graph that all `v1` pods are ready now.
![image](../resources/object-rollout-v1.jpg)
Access the gateway endpoint with the specific host.
```shell
$ curl -H "Host: canary-demo.com" <ingress-controller-address>/version
@ -260,6 +264,10 @@ Services:
The application's status is `runningWorkflow` that means the application's rollout process has not finished yet.
View topology graph again, you will see `kruise-rollout` trait created a `v2` pod, and this pod will serve the canary traffic. Meanwhile, the pods of `v1` are still running and server non-canary traffic.
![image](../resources/object-rollout-v2.jpg)
Access the gateway endpoint again. You will find out there is about 20% chance to meet `Demo: v2` result.
```shell