title: Setting Routes
This section is used to configure the access to your app.
Install
Make sure KubeVela is installed in your cluster
Install route trait controller with helm
-
Add helm chart repo for route trait
helm repo add oam.catalog http://oam.dev/catalog/
-
Update the chart repo
helm repo update
-
Install route trait controller
helm install --create-namespace -n vela-system routetrait oam.catalog/routetrait
-
Apply definition yaml in registry.
Setting route policy
Add routing config under express-server
:
services:
express-server:
...
route:
domain: example.com
rules:
- path: /testapp
rewriteTarget: /
The full specification of route
could show up by $ vela show route
or be found on its reference documentation
Apply again:
$ vela up
Check the status until we see route is ready:
$ vela status testapp
About:
Name: testapp
Namespace: default
Created at: 2020-11-04 16:34:43.762730145 -0800 PST
Updated at: 2020-11-11 16:21:37.761158941 -0800 PST
Services:
- Name: express-server
Type: webservice
HEALTHY Ready: 1/1
Last Deployment:
Created at: 2020-11-11 16:21:37 -0800 PST
Updated at: 2020-11-11T16:21:37-08:00
Routes:
- route: Visiting URL: http://example.com IP: <ingress-IP-address>
In kind cluster setup, you can visit the service via localhost:
If not in kind cluster, replace 'localhost' with ingress address
$ curl -H "Host:example.com" http://localhost/testapp
Hello World