ECS fargate with consul-agent and proxy as sidecar container

I am trying to implement consul-agent and proxy as sidecar container inside my ECS fargate service. So, inside the task, there will be 3 containers running:

  • core-business-service-container
  • consul-agent-container
  • core-business-consul-proxy-container

All containers are up and running on ECS task. The node has registered in the consul UI as well. But, the service is not up in the consul UI.

I dig in and found the log of ‘consul-agent-container’, Here is the error log:

2021/03/12 03:33:14 [ERR] http: Request PUT /v1/agent/check/pass/greeting-fargate-proxy-ttl?note=, error: CheckID “greeting-fargate-proxy-ttl” does not have associated TTL from=127.0.0.1:43252

Here are the commands I used to connect consul.

  1. consul-agent-container:

“exec consul agent -ui -data-dir /consul/data -client=“127.0.0.1” -bind=”{{ GetPrivateIP }}" -retry-join “172.31.79.139"”

  1. core-business-consul-proxy-container:

“exec consul connect proxy -register -service greeting-fargate -http-addr 127.0.0.1:8500 -listen 127.0.0.1:8080 -service-addr 127.0.0.1:3000”

I am stucked here for couple of days and didn’t get any helpful solution. Can anyone please help me out?

@deependra97, can you please share how you are registering the core-business-service with consul?

Hi @devarshi , I am using consul connect proxy to connect core business service with the consul-agent.

I have followed this blog: Managing Microservice Deployments on AWS with HashiCorp Consul

In this blog, AWS EC2 platform is used. But, I have implemented the Solution on Fargate. (AWS Fargate | Serverless Compute Engine | Amazon Web Services)

Since ECS fargate won’t support to run agent as daemon sets, I am trying to implement consul agent and consul connect proxy as the sidecar containers.

Please let me know if you require any additional information from my side.

Many Thanks
Dipendra

Hi Dipendra,
I think you might be missing actually registering your services with Consul. The -register flag on consul connect envoy doesn’t register the underlying service, it registers the proxy itself.

See this tutorial: Secure Service Communication with Consul Service Mesh and Envoy | Consul - HashiCorp Learn where you’ll see that both counting and dashboard need to be registered with Consul separately from the proxies.

Hi @Ikysow, When I run a single task(pod), it works perfectly. When I try to add additional task/pod, then the additional one is giving such issue.

Hi @deependra97 , we have the tech preview of Consul on ECS/Fargate available. You might want to check it out to see if it helps you with your deployment

Hi Devarshi,

Yes I am interested.

Can we have a workshop/demo session?

Many Thanks
Dipendra

Hi Dipendra,

How to get started and installation guide can be found here . We can schedule some time to understand your use case and requirements. Please let me know a few pacific friendly time slots that work for you.

Thanks,
Devarshi