Configuring Advertised Listeners
Since Task Workers need to know about the advertised hosts of each LH Server, you need to provide information about what hosts the server is advertised on. You can do that either using a wildcard suffix or by manually configuring the host of each server.
This process is the same whether you are using Ingress
or the Gateway API.
Wildcard Suffix
You can specify a wildcard host (for example, *-asdf.test.littlehorse.cloud
), and the Operator will configure Service
s (and optionally TLSRoute
s or Ingress
es) according to the following:
- Bootstrap host:
bootstrap-asdf.test.littlehorse.cloud
- Server 0:
lh-0-asdf.test.littlehorse.cloud
- Server 1:
lh-1-asdf.test.littlehorse.cloud
- Server
N
:lh-N-asdf.test.littlehorse.cloud
This can work great with a wildcard certificate.
If you are using a Cert Manager Issuer
or ClusterIssuer
to provision TLS Certificates, it is required that the wildcard host starts with a ".
" character: it must be a full sub-domain.
An example of an LHCluster
configured this way is as follows:
apiVersion: littlehorse.io/v1
kind: LHCluster
metadata:
name: wildcard-host
namespace: littlehorse
spec:
server:
listeners:
- name: external-wildcard
advertisedListeners:
serverHostSuffix: ".test.littlehorse.cloud"
port: 2443
tls:
# ...
# ...
When working with Ingress
, in almost all cases the advertised port should be set to 443
unless you have done some really advanced Kubernetes cluster setup.
Individual Overrides
You can override the advertised hosts of each individual LH Server Instance using the advertisedListeners.servers
field.
apiVersion: littlehorse.io/v1
kind: LHCluster
metadata:
name: manual-override-hosts
namespace: littlehorse
spec:
server:
listeners:
- name: overriden
port: 2023
advertisedListeners:
servers:
- host: "override-example-internal-1.test.littlehorse.cloud"
port: 1234
- host: "override-example-internal-2.test.littlehorse.cloud"
port: 1235
- host: "override-example-internal-3.test.littlehorse.cloud"
port: 1236
Because of limitations on the name of Kubernetes Ports, the name of a listener cannot exceed 14 characters.