discovery.md

September 11, 2020 ยท View on GitHub

Service Discovery Reference


The Panoptes supports the following service discoveries:

  • Consul
  • etcd
  • Kubernetes / k8s
  • Pseudo

The service discovery is required to enable shards / cluster service and you need to select one of them depending on the size of your nodes and your infrastructure. These four options cover almost all the use cases. The Pseudo is the last option for those who don't want to use another 3rd party software like Consul for service discovery but they need to enable shards. Pseudo is a simple health checking system without registration, instead it gets the node's information through configuration. It is recommended for small shards / cluster size.

Consul

AddressThe address and port of the Consul agent
PrefixThe distributed locking prefix at Consul
HealthcheckURLThe health check url
TLSConfigTLS configuration.

Configuration type: consul or etcd Key: global Value:

{
  "discovery": { 
    "service": "consul", 
    "config": { 
      "address": "127.0.0.1:8500", 
      "healthcheckURL": "http://127.0.0.1:8081/healthcheck"
    } 
  }
}

Configuration type: yaml

discovery:
  service: consul
    config:
      address: 127.0.0.1:8500
      healthcheckURL: http://127.0.0.1:8081/healthcheck 

etcd

EndpointsThe addresses and ports of the Consul agent
PrefixThe distributed locking prefix at Consul
TLSConfigTLS configuration.

Configuration type: consul or etcd Configuration type: consul or etcd Key: global Value:

{
  "discovery": { 
    "service": "consul", 
    "config": { 
      "endpoints": ["127.0.0.1:2379"],
      "healthcheckURL": "http://127.0.0.1:8081/healthcheck"
    } 
  }
}

Configuration type: yaml

discovery:
  service: consul
  config:
    endpoints:
      - 127.0.0.1:2379
    healthcheckURL: "http://127.0.0.1:8081/healthcheck"  


Kubernetes / k8s

NamespaceThe namespace that the Panoptes's pods deployed

Configuration type: yaml / configmap

discovery:
  service: k8s
    config:
       namespace: panoptes 

Pseudo

InstancesThe addresses and ports of the Panoptes nodes
ProbeThe liveness probe to know Panoptes's node health
PathThe path to access on the HTTP/HTTPS server
Timeoutthe probe timeout in second
Intervalthe probe interval in second
TLSConfigTLS configuration.

Configuration type: consul or etcd Key: global Value:

"discovery": {
    "service": "pseudo",
    "config": {
        "instances" : ["panoptes-node1:8081","panoptes-node1:8081"],
        "probe": "http",
        "path": "/healthcheck"
    }
}

Configuration type: yaml

discovery:
  service: pseudo
  config:
    instances:
      - panoptes-node1:8081
      - panoptes-node2:8081
    probe: http
    path: /healthcheck