update manualscale cue to set default replica 1 and update appfile example to exclude scaler trait

This commit is contained in:
Hongchao Deng
2020-10-30 21:14:53 -07:00
parent c51f4d5074
commit 8b3c2104bc
4 changed files with 18 additions and 18 deletions
@@ -25,5 +25,5 @@ spec:
}
parameter: {
//+short=r
replica: *2 | int
replica: *1 | int
}
+14 -14
View File
@@ -69,9 +69,9 @@ Check the status of the service:
```console
$ vela svc status express-server
Showing status of service(type: webservice) express-server deployed in Environment default
Service express-server Status: HEALTHY Ready: 1/1
scaler: replica=1
Last Deployment:
...
```
@@ -111,15 +111,6 @@ metadata:
spec:
components:
- componentName: express-server
traits:
- trait:
apiVersion: core.oam.dev/v1alpha2
kind: ManualScalerTrait
...
- trait:
apiVersion: standard.oam.dev/v1alpha1
kind: Route
...
---
apiVersion: core.oam.dev/v1alpha2
kind: Component
@@ -155,8 +146,8 @@ servcies:
route:
domain: example.com
rules:
- path: /testapp(.*)
rewriteTarget: /$1
- path: /testapp
rewriteTarget: /
```
Apply again:
@@ -165,7 +156,16 @@ Apply again:
$ vela up
```
**In [kind cluster setup](../../install.md#kind)**, we can visit the web service:
Check status and we can see route trait:
```console
$ vela svc status express-server
Showing status of service(type: webservice) express-server deployed in Environment default
Service express-server Status: HEALTHY Ready: 1/1
route: Visiting URL: http://example.com IP: localhost
...
```
**In [kind cluster setup](../../install.md#kind)**, we can visit the web service via localhost:
> If no in kind cluster, replace localhost with ingress address
+2 -2
View File
@@ -21,8 +21,8 @@ services:
cmd: ["node", "server.js"]
port: 8080
scaler:
replica: 1
# scaler:
# replica: 1
# route:
# domain: example.com
+1 -1
View File
@@ -7,5 +7,5 @@ output: {
}
parameter: {
//+short=r
replica: *2 | int
replica: *1 | int
}