Skip to main content

Services

The service resource allows you to define and manage services that can be used by machines or by the public internet. Services are independent of the machine lifecycle, so they can be created, updated, and deleted without affecting the machines that use them.

If you want to know how to deploy a a service Building and Deploying > Deploying.

Configuration​

PropertyTypeRequired
namespacestring
namestring✓
tagsarray<string>
bindobject✓
targetobject✓

If you want to know more about namespaces, check Building and Deploying > Namespaces

Name​

The name is the unique identifier for your service within a namespace.

Validation:

  • It must start with a letter
  • Can contain alphanumeric characters
  • Can contain - (underscore) and _ (hyphen)
  • Can contain multiple consecutive _ (underscore)
  • Cannot contain multiple consecutive - (hyphen)
robot-service.lttle.yaml
service:
name: terminator-service

Tags​

Tags are used to organize and categorize resources. They can be any valid UTF-8 string and can be used to filter resources in the Web Console.

robot-service.lttle.yaml
service:
tags:
- terminator

Bindings​

It defines how the service is exposed. It can be either internal or external.

Internal​

It exposes the service only internally on the tenant. It is used for inter-machine communication.

PropertyTypeDefault
portint (min: 0 max: 65535)The target port
robot-service.lttle.yaml
service:
bind:
internal: {}

In order to access the service within a machine you need to use the following http url:

http://<service>.<namespace>.svc.lttle.local:<port>

If you want to define a specific port you can do it like this:

robot-service.lttle.yaml
service:
namespace: robot
name: terminator-service
bind:
internal:
port: 8080

And the URL will be:

http://terminator-service.robot.svc.lttle.local:8080

All services are scoped within a tenant and you can only access services within the same tenant.

External​

It exposes the service to the public internet. It is used to expose services that need to be accessed from outside the tenant.

PropertyTypeDefaultRequired
portint (min: 0 max: 65535)The target port✓
hoststring✓
protocolhttp | https | tls✓
Port​

The port property defines the port on which the service will be exposed.

robot-service.lttle.yaml
service:
bind:
external:
port: 8080
Host​

The host property defines the hostname that will be used to access the service. It must be a valid fully qualified domain name (FQDN).

robot-service.lttle.yaml
service:
bind:
external:
host: robot-<tenant>.eu.lttle.host

It can also be on a custom domain that you own:

robot-service.lttle.yaml
service:
bind:
external:
host: robot.com
warning

Using a custom domain requires you to both configure the DNS records accordingly and to also validate the domain ownership. Check Domains and DNS for more information.

Protocol​

States what outbound protocol the service is using. It can be either http, https or tls.

robot-service.lttle.yaml
service:
bind:
external:
protocol: https

Target​

It defines what machine the service is pointing to.

PropertyTypeRequiredDefault
namespacestring
namestring✓
portint (min: 0, max: 65535)✓
protocolhttp | https | tls✓
connection-trackingconnection-aware | objectconnection-aware

Port​

The port property defines the port on which the target machine is listening.

robot-service.lttle.yaml
service:
target:
port: 8080

Connection Tracking​

There are two types of connection tracking: connection-aware and traffic-aware.

Connection Aware​

This is the default connection tracking strategy. It keeps the machine ready as long as there is an active connection to the service.

robot-service.lttle.yaml
service:
target:
connection-tracking: connection-aware

References:

Traffic Aware​

This connection tracking strategy keeps the machine ready as long as there is traffic to the service. It is useful for workloads that do not use persistent connections, such as HTTP/1.1 without keep-alive.

Domains and DNS​

For development, research and testing feel free to use the eu.lttle.host sub-domain. For production workloads, you should use your own domain and configure the DNS records accordingly.

We are maintaining the eu.lttle.host sub-domain and you can use it for free. We are using a wildcard certificate for it, so you don't need to worry about certificates during the early stages of your project.

tip

If you want to use https or tls with your custom domain, you also need to create a certificate resource with the same domain. This resource will configure TLS termination with a valid certificate matching your domain.

Configure DNS​

To configure your own domain for production workloads, you need to set up the DNS records to point to your services. This typically involves creating A records in your DNS provider's management console.

Use this IP address for the A records depending on the region you are using:

RegionIP Address
eu (Europe)46.105.65.138

Here is how you can set it up in cloudflare: Cloudflare | Manage DNS records.

DNS Validation​