nicolaka / ddc-aws

Docker Data Center on AWS
Apache License 2.0
11 stars 5 forks source link

Docker Datacenter on AWS

This project is not maintained anymore. The maintained version is here.

TL;DR One click deploy of highly-scalable, production-ready Docker Datacenter on AWS based on Docker and AWS best-practices

Docker Datacenter is an integrated solution including open source and commercial software, the integrations between them, full Docker API support, validated configurations and commercial support for your Docker Datacenter environment. A pluggable architecture allows flexibility in compute, networking and storage providers used in your CaaS infrastructure without disrupting the application code. Enterprises can leverage existing technology investments with Docker Datacenter. The open APIs allow Docker Datacenter CaaS to easily integrate into your existing systems like LDAP/AD, monitoring, logging and more.

Docker Data Center is composed of two main components: Docker Universal Control Plane (UCP) and Docker Trusted Registry (DTR). UCP is an enterprise-grade cluster management solution from Docker that helps you manage your whole cluster from a single place. UCP is made of the UCP controllers and UCP nodes.

DTR is the enterprise-grade image storage solution from Docker that helps you can securely store and manage the Docker images you use in your applications. DTR is made of DTR replicas only that are deployed on UCP nodes.

Architecture

The AWS Cloudformation starts the installation process by creating all the required AWS resources such as the VPC, security groups, public and private subnets, internet gateways, NAT gateways, and S3 bucket. It then launches the first UCP controller instance and goes through the installation process of Docker engine and UCP containers. It backs the Root CAs created by the first UCP controllers to S3. Once the first UCP controller is up and running, the process of creating the other UCP controllers, the UCP cluster nodes, and the first DTR replica is triggered. Similar to the first UCP controller node, all other nodes are started by installing Docker Commercially Supported engine, followed by running the UCP and DTR containers to join the cluster. Three ELBs, one for UCP, one for DTR and a third for your application, are launched and automatically configured to provide resilient loadbalancing across the two AZs. Additionally, UCP controllers and nodes are launched in an ASG to provide scaling functionality if needed. This architecture ensures that both UCP and DTR instances are spread across both AZs to ensure resiliency and high-availability. UCP worker nodes are launched with interlock and nginx to dynamically register your deployed applications.

How to Launch Latest Release(v1.3)

You can launch the Cloudformation template using the AWS Console or using the AWS CLI as follows:

1) AWS Console:

Docker Datacenter on AWS

2) AWS CLI:

docker run --env AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID> \
--env AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY> \
--env AWS_DEFAULT_REGION=<AWS_REGION> \
garland/aws-cli-docker aws cloudformation create-stack \
--stack-name <STACK_NAME> \
--capabilities CAPABILITY_IAM \
--template-url https://s3-us-west-2.amazonaws.com/ddc-on-aws-public/ddc_on_aws.json \
--parameters \
ParameterKey=KeyName,ParameterValue=<SSH_KEY_NAME> \
ParameterKey=RootVolumeSize,ParameterValue=<ROOT_VOLUME_SIZE> \
ParameterKey=UCPFQDN,ParameterValue=<UCP_FQDN> \
ParameterKey=UCPControllersInstanceType,ParameterValue=<INSTANCE_TYPE> \
ParameterKey=DTRInstanceType,ParameterValue=<INSTANCE_TYPE> \
ParameterKey=UCPNodesInstanceType,ParameterValue=<INSTANCE_TYPE> \
ParameterKey=ClusterSize,ParameterValue=<CLUSTER_SIZE> \
ParameterKey=License,ParameterValue=<YOUR_DDC_LICENSE_S3_URL>
docker run --env AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID> \
--env AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY> \
--env AWS_DEFAULT_REGION=<AWS_REGION> \
garland/aws-cli-docker aws cloudformation describe-stacks --stack-name <STACK_NAME>

Required Paramters

Key Functionalities

Software Versions

Notes and Caveats

FAQ

  1. Open an issue in this repo after checking that it doesn't already exist.
  2. Make sure you capture the stack events and parameters provided.
  3. Make sure you capture the cloudformation stack ID.
  4. Open an issue with Docker Support by emailing support@docker.com
  5. If you know which instance is failing, ssh into the instance( via the jumphost instance) and capture the following:
/var/log/cloud-init-output.log
/var/lib/cloud/instance/scripts/part-001

It is easy to deploy a your Docker applications on Docker Datacenter. You can launch your applications from CLI (instruction here) or UCP portal (instruction here).

If you wish to access your application using a DNS name, you need to do two things:

  1. Create a DNS record (A or CNAME) for your application using the APP ELB that gets created. The APP ELB load-balances traffic across all UCP worker nodes that have NGINX running which automatically get updated when you launch your application.

  2. Launch your application with interlock labels. Note: Interlock+NGINX are already deployed as part of the Cloudformation template.

For example, to access a Compose app using app.example.com, you first need to create a DNS record for it using the APP ELB's DNS name/IP then launch it with following labels:

app:
    image: ehazlett/docker-demo:latest
    ports:
        - 8080
    labels:
        - "interlock.hostname=app"
        - "interlock.domain=example.com"

More details on interlock can be found here.

Run your container with the following Docker run options --log-driver=awslogs --log-opt awslogs-group=DDCLogGroup and you should see your container logs in AWS's Log Group.

The solution provided is based on Docker and AWS best practices and therefore the Docker Dataceter components of the solution are commercially supported by Docker while the AWS components are supported by AWS. If you are facing any issues related to launching the solution please open issues here on Github. If the issues your'e facing are related to Docker Datacenter components please contact Docker support. If the issues your'e facing are related to AWS specifically, please contact AWS support.

You can obtain trial license quickly and easily by going to here. If you're interested in buying Docker Datacenter subscription please contact Docker here.

Version 1.3 Cloudformation Test Results