spotify / helios

Docker container orchestration platform
Apache License 2.0
2.11k stars 233 forks source link

Tags for service endpoints #367

Closed carlanton closed 9 years ago

carlanton commented 9 years ago

Hi again!

In a Consul service definition it's possible to tag a service with some arbitrary tags:

{
  "service": {
    "name": "redis",
    "tags": ["master", "web-scale"],
    "port": 8000
}

It would be very useful for us (and everyone else using the helios-consul plugin) if we could add this to the Helios job model and expose it to helios-consul through ServiceRegistration.Endpoint.

A Helios job of the Redis example could look something like this:

{
  "command": ["redis", "..."],
  "ports": {
    "default": {
      "externalPort": 8080,
      "internalPort": 8080,
      "protocol": "tcp"
    }
  },
  "registration": {
    "fooservice/default": {
      "ports": {"http": {}},
      "tags": ["master", "web-scale"]
    }
  }
}

I guess that you can't use tags with Nameless, but it would be awesome for helios-consul :-) I can try to make a PR for it if you want!

davidxia commented 9 years ago

Oh interesting. I see here:

The tags is a list of opaque value to Consul, but can be used to distinguish between "master" or "slave" nodes, different versions, or any other service level labels

Do you know how many people are using helios-consul?

carlanton commented 9 years ago

No, I guess it's just us at SVT for now :-) Maybe we should write blog post or something about it because Helios and Consul fits together surprisingly well.

SVT or "Sveriges Television", is the Swedish national public TV broadcaster. I'm working with infrastructure in "SVT interactive", where we develop SVT's online services (svt.se, svtplay.se etc.). We started experimenting with Helios and Consul last year for our new microservice architecture. It's working really well and we will deploy it to production during the spring :-)

rohansingh commented 9 years ago

We actually talked about this a while ago at Spotify. If I recall, we punted on it just because it wasn't high-priority and we found other ways to do what we wanted to use tags for.

Seems like a pretty sane feature to have though.

davidxia commented 9 years ago

@carlanton really cool to see you guys using helios!