Skip to content

Configuring Load Balancing #11

Open
@amlwwalker

Description

@amlwwalker

I've been using nginx-proxy for a while now, and came across this when wanting to move off vanilla ec2 and over to ecs.
I've got it to a point where if I go directly to one of the 2 instances I am creating when I create a cluster (not both), I get the 'nginx is working' page. I have been writing down my understanding as following along, so will paste here:

First make a cluster

The name comes from the ecs config when you run ecs-cli configure...

ecs-cli up --keypair cluster-pair --capability-iam --size 2 --instance-type t2.small --force
Then we register the task that handles the proxy
aws ecs register-task-definition --cli-input-json file://./examples/task.json
Next we create a service, and connect up to the load balancer

(You need to have already created a load balancer)

aws ecs create-service --cluster ClusterName --role ecsServiceRole --load-balancers loadBalancerName=ECSLB,containerName=ecs-nginx-proxy,containerPort=80 --cli-input-json file://./examples/service.json

This tells the service that it should be accessible on port 80, the container is the ecs-nginx-proxy container, and the details are in service.json.

However when I configure the load balancer, and point it at my two instances that were created due to the above, going to its DNS address I get nothing back. Its only if I go directly to one of the instances.

Am I right in thinking that both sample_task and task are running on both instances and the load balancer is supposed to point to both instances?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions