Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Register out kubernetes #70

Closed
kolesoffac opened this issue Nov 26, 2018 · 1 comment
Closed

Register out kubernetes #70

kolesoffac opened this issue Nov 26, 2018 · 1 comment
Labels
question Further information is requested

Comments

@kolesoffac
Copy link

kolesoffac commented Nov 26, 2018

I have syncCatalog is enabled. I registered outside service on node use rest api consul agent. In kubernetes auto create service(my-service) from consul catalog.

How can i access my-service from kubernetes use dns name?

my-service.default return ip pod of consul-agent(daemontset), but my need ip node where run consul-agent.

Thanks

@lkysow lkysow added the question Further information is requested label Jun 7, 2019
@lkysow
Copy link
Member

lkysow commented Sep 17, 2019

Hi Anatoly,
If you're registering an external service, you should not use /agent/service/register endpoint of a node in Kubernetes. The agent endpoint assumes that the service is running on the same node of the agent. If the node goes down, it will assume your service is unhealthy which isn't true since you're not actually running on that node.

If you can, you should run the Consul agent on your external node and register your service with that agent.

If you can't do that, you can use the /catalog/register endpoint and create a new node and service with the right IP. Then when this service is synced into Kubernetes it should have the right IP.

@lkysow lkysow closed this as completed Sep 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants