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

  1. string|nil The v4 UUID used by this cluster as its id

  2. string|nil an error message

Usage

  1. local id, err = kong.cluster.get_id()
  2. if err then
  3. -- handle error
  4. end
  5. if not id then
  6. -- no cluster ID is available
  7. end
  8. -- use id here

Back to top