Closed lpmontx closed 6 years ago
Hi,
You absolutely right - it is better to use agent instead of catalog methods to register services. However, I do not see the meta-fields in agent registration requests.
Please compare the docs: Agent (no metadata) - https://www.consul.io/api/agent/service.html#register-service Catalog (with metadata) - https://www.consul.io/api/catalog.html#register-entity
Am I missing something?
@lpmontx @vgv there is no agent API for registering nodes. That registration info comes from the consul configuration file and node-meta
is a node level property, not service level.
Consul 1.0.7 has meta-fields in both catalog and agent service registration. These changes wil be released in 1.4.0 milestone in the next couple of days
Based on things I have read my understanding is we should use 'agent' API for service registration. It seems the 'catalog' API works for registration but inter-node sync is better handled if agent is used. I see node metadata was recently added to catalog API service registration but not the agent API registration. I see no way to add node metadata after registration. So it seems the agent API needs a similar change as was done in the catalog API. If I am misunderstanding please explain. Please elaborate on use of catalog vs agent API.
Further complicating this discussion: The agent API derives the node from that of the agent so although one would be passing node specific data the node itself is not an argument to the API. (odd)