Skip to content

Documentation

Oliver Naaris edited this page Mar 3, 2016 · 9 revisions

This is the Wiki page for the ExampleLoginApp

Overall solution description

The solution utilizes Docker for application packaging and runtime. Jenkins is responsible of building and packaging the Java application into an Docker container via Maven and Bash. After packaging, Jenkins pushes the finished application container to Docker Hub and triggers docker-compose so that the container gets pulled and executed on the Swarm cluster. All external application bound traffic is handled through the Elastic Load Balancer and outbound traffic from the private subnets via the NAT gateway. User account verification e-mail relaying is handled through Sendgrid. The application data store is a regular MySql database running as standalone.

Network topology diagram

Infrastructure development and deployment

Infrastructure on AWS is deployed via Chef, using the knife-ec2 plugin. This plugin enables to use a command line tool to quickly bootstrap a few VM-s via the AWS API. Local infrastructure development should be handled via Test-Kitchen. Some middleware like MySql and Docker are installed via cookbooks, other middleware images like Consul, Swarm and Tomcat are from DockerHub.

Knife-ec2 examples: https://github.com/olivernaaris/exampleloginapp/blob/master/commands

Jenkins build process

Jenkins fetches the application code from Github and runs Maven in the project workspace to build and package the application into an war file. The Bash script runs shell commands to run the Dockerfile build and deploy the new image via docker-compose.

Application high availability

High availability can be achieved by creating more Swarm master and slave nodes. Docker Swarm schedules an container to one of the healthy slave hosts and exposes an port. Once the ELB detects the exposed port on the host, it start forwarding traffic to that host. Because of budget and time constraints we are currently only running one Swarm master and slave. The MySql database is also working in non HA mode.

Future improvement ideas that can be done to improve existing solution

  • Database and application HA by implementing database replication and more Docker hosts.
  • AMI and Docker base image building pipeline via Packer, Chef and Jenkins
  • Monitoring
  • High level orchestration with Terraform
  • Better Docker scheduler – Kubernetes

Application Git Repo: https://github.com/olivernaaris/tutorials It's a fork from https://github.com/eugenp/tutorials with a few of my own modifications.