Discovery Providers
GoAkt ships with a discovery provider API that can help any developer to extend GoAkt cluster capability.
By default GoAkt comes bundled with the following fully function discovery providers:
kubernetes api integration is fully functional
NATS integration is fully functional
DNS is fully functional
Static is fully functional and for demo purpose
Kubernetes
This provider makes use of the Kubernetes API to discover cluster nodes during cluster mode bootstrap.
Get Started
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 nameapp.kubernetes.io/component
: set this label with the application nameapp.kubernetes.io/name
: set this label with the application name
Role Based Access
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:
Example
A working example can be found here
NATS
This discovery provider make uses of the NATS client to connect to NATS server to discover cluster nodes during cluster mode bootstrap.
Get Started
To use the NATS discovery provider one needs to provide the following:
NatsServer
: the NATS Server addressNatsSubject
: the NATS subject to useActorSystemName
: the actor system nameApplicationName
: the application nameTimeout
: the nodes discovery timeoutMaxJoinAttempts
: the maximum number of attempts to connect an existing NATs server. Defaults to5
ReconnectWait
: the time to backoff after attempting a reconnect to a server that we were already connected to previously. Default to2 seconds
Host
: the given node host addressDiscoveryPort
: the discovery port of the given node
DNS
This provider performs nodes discovery based upon the domain name provided. This is very useful when doing local development using docker.
Get Started
To use the DNS discovery provider one needs to provide the following:
DomainName
: the domain nameIPv6
: it states whether to lookup for IPv6 addresses.
Example
A working example can be found here
Static
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.
Get Started
Example
A working example can be found here
Last updated