Using ECS and EFS with an Application load balancer

0

I have an a few clusters I have created in ECS using the fargate service. These are all connected to a load balancer and work as they are supposed to. Today I created a task definition for a new cluster using the cloudmd image. I'm following this official AWS video. Sadly, I seem to be experiencing an issue I can't figure out.

My issue is that even though I've mounted my EFS file system using the task definition as directed in the video, the file system does not seem to mount properly. Opening the website when the service has finished deploying gives me this error:

ENOENT: no such file or directory, lstat '/usr/src/app/cloudcmd'
From my investigation, this issue seems to stem from the load balancer.

How I arrived at this conclusion was that I launched a service, but I didn't add a load balancer. Instead I created a public IP and used that to access the container. Without the load balancer, the cloudcmd image loads perfectly and also shows my mounted EFS file system. Immediately I add the load balancer, it does not work.

To also be sure that the issue is not from the docker image, I used an nginx image and pointed it to the HTML file I created on my file system. This also worked when I didn't add the load balancer but once I added the load balancer again, I could not access the specified HTML file.

My question is that I really don't know what to do at the load balancer level and would like some help figuring out what the issue could be and any solutions to it.

I can always create a service and not add it to a load balancer but rather use the public IP but for me that is unsafe, and I would rather my service be behind a private subnet.

Thanks

1 Answer
0

For further investigation, we would have to look on the ELB Logs.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions