routetrait

command module
v0.0.0-...-a67e8b1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

README


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

  1. Add helm chart repo for route trait

    helm repo add oam.catalog  http://oam.dev/catalog/
    
  2. Update the chart repo

    helm repo update
    
  3. Install route trait controller

    helm install --create-namespace -n vela-system routetrait oam.catalog/routetrait
    
    
  4. 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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the standard v1alpha1 API group +kubebuilder:object:generate=true +groupName=standard.oam.dev
Package v1alpha1 contains API Schema definitions for the standard v1alpha1 API group +kubebuilder:object:generate=true +groupName=standard.oam.dev

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL