Access the application
After deploying the application, the next station is publishing your service.
There are multiple ways to do this, for testing, such as Port Forward and Node Port. for production, such as LoadBalancer and via cluster gateway. This section focus on the production environment.
#
Use LoadBalancer by Cloud ProviderThis way is only suitable for the cloud environment, such as Aliyun, AWS, and Azure.
For the webservice component, you only need to set the ExposeType
to LoadBalancer
, it means this component will generate a Kubernetes Service with LoadBalancer type. After deployment, you could get the service endpoints.
For Example:
For other components, similarly, only need to generate the Kubernetes Service with LoadBalancer type.
#
Use HTTP Domain by Ingress GatewayThis way required installed the ingress controller in the cluster.
Users could bound the gateway
trait for the component to generate the Ingress. for example:
This means accessing the component service by domain testsvc.example.com
, there are two rules, the request path begins with /manage
will request the component 8090 port. others request path request the component 8000 port.
In VelaUX, you can click the Add Trait
button and select the gateway
trait type. refer to follow configuration:
#
Use TraefikThis way required installed the traefik addon firstly.
Get more info about this addon, refer to Traefik Addon
This addon provides three traits, including http-route, https-route and tcp-route.
#
HTTP/HTTPSFor HTTP, you can click the Add Trait
button and select the http-route
trait type. refer to follow configuration:
There must be one route rule. The port is the same as the service port, the route condition supports the Header and Request Path.
For HTTPS, you must create the TLS certificate firstly. In VelaUX, open the Integrations page, there is a TLS Certificate
type. Click the New button, You need to provide the certificate public and private keys and encoded the content by base64.
This will generate the secret and distribute to managed clusters with the application.
Then open the application configuration page and click the Add Trait
button and select the https-route
trait type. refer to follow configuration:
The secret name is the same as the name of the certificate configuration.
#
TCPThis way is suitable for the service with the stream protocol, reusing the same public IP address.
You can click the Add Trait
button and select the tcp-route
trait type. refer to follow configuration: