Service Discovery
Last updated
Last updated
GoAkt ships with a API that can help any developer to extend GoAkt cluster capability.
By default GoAkt comes bundled with the following fully function discovery providers:
is fully functional
and
is fully functional
is fully functional
is fully functional and for demo purpose
This provider makes use of the to discover cluster nodes during cluster mode bootstrap.
To get the kubernetes discovery working as expected, the following pod labels need to be set:
app.kubernetes.io/part-of
: set this label with the actor system name
app.kubernetes.io/component
: set this label with the application name
app.kubernetes.io/name
: set this label with the application name
You’ll also have to grant the Service Account that your pods run under access to list pods. The following configuration can be used as a starting point. It creates a Role, pod-reader, which grants access to query pod information. It then binds the default Service Account to the Role by creating a RoleBinding. Adjust as necessary:
To use the NATS discovery provider one needs to provide the following:
NatsServer
: the NATS Server address
NatsSubject
: the NATS subject to use
ActorSystemName
: the actor system name
ApplicationName
: the application name
Timeout
: the nodes discovery timeout
MaxJoinAttempts
: the maximum number of attempts to connect an existing NATs server. Defaults to 5
ReconnectWait
: the time to backoff after attempting a reconnect to a server that we were already connected to previously. Default to 2 seconds
Host
: the given node host address
DiscoveryPort
: the discovery port of the given node
This provider performs nodes discovery based upon the domain name provided. This is very useful when doing local development using docker.
To use the DNS discovery provider one needs to provide the following:
DomainName
: the domain name
IPv6
: it states whether to lookup for IPv6 addresses.
This provider performs nodes discovery based upon the list of static hosts addresses. The address of each host is the form of host:port
where port
is the gossip protocol port.
A working example can be found
This discovery provider make uses of the client to connect to NATS server to discover cluster nodes during cluster mode bootstrap.
A working example can be found
A working example can be found