amazon-archives / service-discovery-ecs-dns

ARCHIVED: Service Discovery via DNS with ECS.
Apache License 2.0
166 stars 76 forks source link

It doesn't actually create SRV records. #47

Open jackivanov opened 6 years ago

jackivanov commented 6 years ago

How to reproduce:

  1. Create the stack from this template
  2. Check the records aws route53 list-resource-record-sets --hosted-zone-id %hostedzoneid% and see that there are only A records.
[root@ip-10-5-10-105 ec2-user]# /usr/local/bin/ecssd_agent -sync
ERRO[0000] InvalidChangeBatch: Tried to create resource record set [name='ip-10-5-10-105.servicediscovery.internal.', type='A', set-identifier='ip-10-5-10-105.eu-west-1.compute.internal'] but it already exists
    status code: 400, request id: 9802ac73-06b1-11e8-a4eb-11c465327fe3
ERRO[0000] Error creating host A record
INFO[0000] Zone 'servicediscovery.internal' for host 'ip-10-5-10-105.eu-west-1.compute.internal' out of sync, adding 1 and removing 0 records

ecssd_agent continuously shows adding 1, but nothing happens

dannygu commented 6 years ago

Same issue here, creates A record but no SRV...

jackivanov commented 6 years ago

@javierros Could you take a look at this, please?

frankgibbs commented 6 years ago

I'm having a similar issue. I think it's because I have two VPCs (Production & Test) with private hosted zones for each. Both hosted zones have the same namespace (servicediscovery.internal).

the essd_agent uses ListHostedZonesByNameInput to find the HostedZone to add SRV records and ListHostedZonesByNameInput doesn't seem to return Hosted Zones associated to the VPC from which the ECS Container is running, so it's the agent is trying to add the Production service to the Test Hosted Zone.

https://docs.aws.amazon.com/sdk-for-go/api/service/route53/#ListHostedZonesByNameInput

UPDATE passing a custom domain in ecssd_agent.conf fixed my issue

exec /usr/local/bin/ecssd_agent mydomain.local >> /var/log/ecssd_agent.log 2>&1