All Projects → codesuki → Ecs Nginx Proxy

codesuki / Ecs Nginx Proxy

Licence: mit
Reverse proxy for AWS ECS. Lets you address your docker containers by sub domain.

Projects that are alternatives of or similar to Ecs Nginx Proxy

Elastic Ci Stack For Aws
An auto-scaling cluster of build agents running in your own AWS VPC
Stars: ✭ 313 (+236.56%)
Mutual labels:  aws, continuous-integration, continuous-delivery, continuous-deployment
Serverless Plugin Canary Deployments
Canary deployments for your Serverless application
Stars: ✭ 283 (+204.3%)
Mutual labels:  aws, continuous-integration, continuous-delivery, continuous-deployment
Gocd
Main repository for GoCD - Continuous Delivery server
Stars: ✭ 6,314 (+6689.25%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Ecs Refarch Continuous Deployment
ECS Reference Architecture for creating a flexible and scalable deployment pipeline to Amazon ECS using AWS CodePipeline
Stars: ✭ 776 (+734.41%)
Mutual labels:  aws, ecs, continuous-deployment
Dyn365 Ce Devops
DevOps for Dynamics 365 Customer Engagement (CE) is becoming a popular topic. The goal of this project is to help Dynamics 365 CE solution builders understand and accelerate their implementation of DevOps practices with Dynamics CE and VSTS.
Stars: ✭ 82 (-11.83%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Agent
The Buildkite Agent is an open-source toolkit written in Golang for securely running build jobs on any device or network
Stars: ✭ 534 (+474.19%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Abstruse
Abstruse is a free and open-source CI/CD platform that tests your models and code.
Stars: ✭ 704 (+656.99%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Haiku
🚀 Instant Heroku deploys from GitHub branches
Stars: ✭ 17 (-81.72%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Hygieia
CapitalOne DevOps Dashboard
Stars: ✭ 3,682 (+3859.14%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Aws Scalable Big Blue Button Example
Demonstration of how to deploy a scalable video conference solution based on Big Blue Button
Stars: ✭ 29 (-68.82%)
Mutual labels:  aws, ecs, container
Git Push Deploy
Simple Automated CI/CD Pipeline for GitHub and GitLab Projects
Stars: ✭ 21 (-77.42%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Piplin
📤 An open source self-hosted continuous integration and deployment system - QQ群: 656868
Stars: ✭ 1,044 (+1022.58%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Bzppx Codepub
暴走皮皮虾之代码发布系统,是现代的持续集成发布系统,由后台管理系统和agent两部分组成,一个运行着的agent就是一个节点,本系统并不是造轮子,是"鸟枪"到"大炮"的创新,对"前朝遗老"的革命.
Stars: ✭ 471 (+406.45%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Devops Readme.md
What to Read to Learn More About DevOps
Stars: ✭ 398 (+327.96%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Buddy Cli
CLI tool for Buddy Cloud
Stars: ✭ 69 (-25.81%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Circleci Images
Scripts to generate images for building projects on CircleCI 2.0
Stars: ✭ 397 (+326.88%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Agola
Agola: CI/CD Redefined
Stars: ✭ 783 (+741.94%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Docker For All
Docker applied in development, devops, testing, product management etc.
Stars: ✭ 88 (-5.38%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Cds
Enterprise-Grade Continuous Delivery & DevOps Automation Open Source Platform
Stars: ✭ 3,677 (+3853.76%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment
Jenkins
Jenkins automation server
Stars: ✭ 18,225 (+19496.77%)
Mutual labels:  continuous-integration, continuous-delivery, continuous-deployment

ecs-nginx-proxy

License Build Status nginx latest Docker Pulls

ecs-nginx-proxy lets you run a nginx reverse proxy in an AWS ECS cluster.
Uses ecs-gen to automatically make containers accessible by subdomain as they are started.
My use case is using a wildcard domain to make per branch test environments accessible by branch.domain.com. Heavily inspired by nginx-proxy.

Security notice

Currently I am only using this for a development cluster in a private network. I advise against using this in a production environment. If you want to do this consider using ecs-gen to create your own nginx config + container setup which is as secure as you need it to be.

Sample use case

ecs-nginx-proxy You want to spin up development environments on AWS ECS for each pull request on your project. How do you make this easy to use? Do you look up the instance IP and connect directly?
The easiest, at least for me, is to setup a wildcard DNS record and route to each deployed branch based on the subdomain, e.g. *.domain.com, branch.domain.com.
This projects enables you to do that.

Usage

Requirements

  • Wildcard domain like *.domain.com
  • ELB/ALB for this domain
  • ECS Cluster

IAM Policy

  • EC2 instances in the cluster need a role including ecs:Describe*, ecs:List* and ec2:Describe*
  • Easiest is to use AmazonEC2ContainerServiceFullAccess although that gives more permissions than needed

Setup

  • Create a new ECS task
  • Add a container using the codesuki/ecs-nginx-proxy docker image and make port 80 accessible
  • Create a new service using the above task and a ELB
  • Connect to the ELB serving the wildcard domain

Adding containers

Each container you want to make accessible needs to have its corresponding port mapped (can be random mapping) and the environment variable VIRTUAL_HOST set to the hostname it should respond to.

You can customize nginx settings per container by adding environment variables prefixed by NGINX_GEN_. For examples, you could add an environment variable named NGINX_GEN_client_max_body_size to configure the nginx client_max_body_size setting.

Sample ECS task and service description

For reference JSON descriptions for the ecs-nginx-proxy task, service and a sample task can be found in the examples/ folder. Check out the commands below or just the sample descriptions if you already know how to work with AWS ECS.

To register the sample tasks and services with your AWS ECS cluster run the following commands.

Register task

Requirements

  • ECS Cluster
  • Cluster EC2 instances need ecs:Describe* and ecs:List* permissions (see Requirements above)
aws ecs register-task-definition --cli-input-json file://./examples/task.json

Register service

Requirements

  • ELB or ALB + Target Group
  • Service role for the ELB/ALB containing AmazonEC2ContainerServiceRole

If you use ELB

You need to supply the load balancer name.

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

If you use ALB

You need to supply the target group ARN.

aws ecs create-service --cluster <NAME> --role <NAME> --load-balancers targetGroupArn=<ARN>,containerName=ecs-nginx-proxy,containerPort=80 --cli-input-json file://./examples/service.json

Register sample task

Before running the commands below change the VIRTUAL_HOST environment variable in examples/samples_task.json to a domain corresponding to your load balancer setup.

aws ecs register-task-definition --cli-input-json file://./examples/sample_task.json

Register sample service

aws ecs create-service --cluster <NAME> --service-name sample-service --task-definition sample-task --desired-count 1

TODO

  • Support SSL connections (for now you can do SSL termination at the ALB)
  • Support path based routing (e.g. domain.com/service)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].