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
已提问 1 年前339 查看次数
2 回答
0
已接受的回答

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
专家
已回答 1 年前
  • 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
已回答 1 年前
  • Yes, Finally solved problem, thanks your time

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则