kong.cluster
kong.cluster
Cluster-level utilities
kong.cluster.get_id()
Returns the unique id for this Kong cluster. If Kong is running in DB-less mode without a cluster ID explicitly defined, then this method returns nil.
For Hybrid mode, all Control Planes and Data Planes belonging to the same cluster returns the same cluster ID. For traditional database based deployments, all Kong nodes pointing to the same database will also return the same cluster ID.
Returns
string|nil
The v4 UUID used by this cluster as its idstring|nil
an error message
Usage
local id, err = kong.cluster.get_id()
if err then
-- handle error
end
if not id then
-- no cluster ID is available
end
-- use id here