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

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南