Luis
unread,Jan 13, 2016, 6:10:27 AM1/13/16Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to consu...@googlegroups.com
Hi guys,
I'm working on removing chef server out of our platform. This has
several consequences. One that I'm analyzing is the service discovery.
We use chef server searches mainly for a couple of things.
One is services discovery for another services configuration. This
happens inside every node. Some of this discovery operations are being
moved to live DNS discovery and others will be moved to configuration
files through consul-template or similar.
We use chef server searches for scripts execution. This happens
outside the nodes. With scripts execution I mean maintenance
operations with, for example, fabric or deploys with, for example,
capistrano, ansible, fabric, etc...
The first case is pretty clear to me. I have some doubts about the second one.
We run this searches based on different parameters like role of the
server, datacenter, environment or even some variable tags.
The role filter is pretty much covered with the service discovery
capabilities of consul. The datacenter one is solved too in consul. I
have doubts about environment or any other type of variable.
If I'm not wrong service tags is the only attribute in consul that
allows variable values. It's also possible to list services by a
specific tag. This could solve the problem. I could set the
environment of a service as a tag. I could also set another arbitrary
values in the tags list to be able to do searches by other type of
filters.
I can see there are a couple of API endpoints that allow services
register, which are agent and catalog. I'm already setting tags with
agent endpoint for operations that happen inside a node. However,
sometimes, I may need to change a tag of a service from outside the
node. In this case I believe I would use the catalog endpoint.
I've notice that this endpoints allow absolute service registering.
Not updates. What I'm doing when I want to change a tag with the agent
endpoint is reading the service config json, modify the tag and
re-register the service.
I believe that for registering the service through the catalog API it
would be the same thing. GET the service, modify the tags and POST the
service.
I'm considering other options too for the inventory replacement but it
would be great to be able to use consul for it since we are already
integrating it for live service discovery.
Anyone can tell if my description and use case as a inventory makes
sense? Or I am missing something.
Thanks