mantl / mesos-consul

Mesos to Consul bridge for service discovery
Apache License 2.0
338 stars 95 forks source link

Whitelisting tasks #45

Closed dylanmei closed 8 years ago

dylanmei commented 8 years ago

When using a Spark framework, many entries are created for "task-0", "task-1", and so on. These are entries I didn't want. But when using the Kafka framework, "broker-1", "broker-2" are exactly what I want. I'm interested in a way to whitelist on some level, either by the framework, a role, and/or some string pattern.

kamaradclimber commented 8 years ago

I would be interested in this as well.

We currently have many apps running through marathon. Only some of them should be registered into consul (we want to ignore test apps for instance)

stevendborrelli commented 8 years ago

@dylanmei @ChrisAubuchon @kamaradclimber what do folks think of using labels on the mesos task?

https://issues.apache.org/jira/browse/MESOS-2120

For example, a marathon task.json would have:

   "labels": {
        "dns-register": "false"
    },

or

   "labels": {
        "dns-register": "true"
        "dns-name": "spark-worker"
    },
dylanmei commented 8 years ago

I'm not sure if marathon labels manifest themselves as mesos task meta-data. But even if they do, Spark and other frameworks don't support this concept.

I assume the whitelisting would be part of the mesos-consul setup via config/env, or through consul kv.

kamaradclimber commented 8 years ago

agreed with @dylanmei, marathon apps are handled by our users who can put whatever they want.

We would prefer to control the whilelist on the mesos-consul side.

ChrisAubuchon commented 8 years ago

Branch feature/whitelist adds a --whitelist option to the command line and takes a regular expression argument. It can be specified multiple times. For example: mesos-consul --whitelist=broker-.* --whitelist=mesos-consul

dylanmei commented 8 years ago

@ChrisAubuchon This is great, I'll try this out within a couple days!

kamaradclimber commented 8 years ago

Just tested it, it works great, thanks @ChrisAubuchon