Question about ECS Fargate

0

I am trying to deploy my.net core service in a container on AWS ECS, and I want to imply when this service start it will register in my consul server and execute health check, but I can only get my host ip after it is deployed, I can not pass the right host ip address to consul server so that I can not execute health check, is there any way to get host ip from container?

Chao
gefragt vor einem Jahr339 Aufrufe
2 Antworten
0
Akzeptierte Antwort

Im guessing you get the container ip and not the host it’s running on?

Is this similar to https://groups.google.com/g/nomad-tool/c/S-MS5sbmzJ0?pli=1

If not you will never get the host IP until It’s deployed is it will be deployed in a cluster.

profile picture
EXPERTE
beantwortet vor einem Jahr
  • Sorry for the late reply, I just find a way to solve this. By using Dns.GetHostEntry(Dns.GetHostName()).AddressList.First(), it can easily get the private IP address of server. At first, I use toString() rather than first().but finally it works. Thank you Again.!!

0

Hello, Do you have all the prerequisites that Consul requires?

https://developer.hashicorp.com/consul/docs/ecs/requirements

AWS
beantwortet vor einem Jahr
  • Yes, Finally solved problem, thanks your time

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen