yyyar / gobetween

:cloud: Modern & minimalistic load balancer for the Сloud era
http://gobetween.io
Other
1.93k stars 210 forks source link

Mesos/Marathon Discovery #20

Open nickdoikov opened 8 years ago

nickdoikov commented 8 years ago

For future releases we can add mesos/marathon support via their rest api.

https://mesosphere.github.io/marathon/docs/generated/api.html#

api enteryponint - ip/hostname:port api service enterypoint - /v2/apps/[app_id]/tasks

Response:

Body

Type: application/json

Example:

{
  "tasks": [
    {
      "appId": "/minecraft/survival-world",
      "host": "srv7.hw.ca1.mesosphere.com",
      "id": "minecraft_survival-world.564bd685-4c30-11e5-98c1-be5b2935a987",
      "ports": [
        31756
      ],
      "slaveId": null,
      "stagedAt": "2015-08-26T20:23:39.463Z",
      "startedAt": "2015-08-26T20:23:44.678Z",
      "version": "2015-04-17T04:00:14.171Z"
    }
  ]
}

Type: text/plain

minecraft_survival-world    10013   srv7.hw.ca1.mesosphere.com:31756
nickdoikov commented 8 years ago

marathon event bus https://mesosphere.github.io/marathon/docs/event-bus.html marathon-go https://github.com/gambol99/go-marathon

flyinprogrammer commented 8 years ago

for applications with more than 1 port you will need some sort of opinions with labels to determine which endpoints map to which ports.

nickdoikov commented 8 years ago

in common cases each service used unique ip:port pair even if it runned on same node. If you wand build something different - feel free to use exec discovery or register your services in consul .

There are no profit in more then one port using by same application . If application use more then one port- most of all it used for different needs so it should be exposed via different server.