All Projects → nuxero → docker-swarm-aws

nuxero / docker-swarm-aws

Licence: other
This is a small example of provisioning a docker swarm cluster on aws using terraform and packer

Programming Languages

HCL
1544 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to docker-swarm-aws

circleci-packer-example
Example: packer image builder on CircleCI
Stars: ✭ 20 (-25.93%)
Mutual labels:  packer
builderator
Tools to make CI Packer builds awesome
Stars: ✭ 21 (-22.22%)
Mutual labels:  packer
dinivas
AWS, GCP alternative on premise. Dinivas manage your private Cloud (OpenStack) infrastructure by providing many features based on popular Open Source projects
Stars: ✭ 15 (-44.44%)
Mutual labels:  packer
serverless
BlueNimble is a Hybrid Serverless Platform focusing on developer productivity and application portability. Create and run scalable APIs and applications without coding or by coding less. Focus on application business logic without any knowledge of the underlying microservices architecture.
Stars: ✭ 30 (+11.11%)
Mutual labels:  swarm
neovimfiles
My Neovim configuration written in Lua
Stars: ✭ 52 (+92.59%)
Mutual labels:  packer
aztack
Terraform module for creating Kubernetes clusters running on Azure
Stars: ✭ 69 (+155.56%)
Mutual labels:  packer
packer-FreeBSD
Build a FreeBSD VM for Vagrant using packer
Stars: ✭ 23 (-14.81%)
Mutual labels:  packer
kubernetes workshop
Kubernetes is an open source Container Orchestration System for automatic deployment, scaling, and management of Containerized application. Kubernetes gives you the freedom to take advantage of on-premise, hybrid or public cloud infrastructure. Kubernetes helps you to scale both horizontally and vertically depends on the load.
Stars: ✭ 27 (+0%)
Mutual labels:  swarm
packer-ubuntu20.04
Packer vsphere-iso builder for Ubuntu-20.04
Stars: ✭ 25 (-7.41%)
Mutual labels:  packer
packer-vsphere-iso-windows
Create Packer Templates for Windows Server on VMware vSphere (and vCenter)
Stars: ✭ 73 (+170.37%)
Mutual labels:  packer
arch-ansible
An Ansible playbook to install Arch Linux
Stars: ✭ 33 (+22.22%)
Mutual labels:  packer
packer-plugin-vultr
Packer Builder plugin for Vultr snapshots
Stars: ✭ 42 (+55.56%)
Mutual labels:  packer
gruntwork-io.github.io
The gruntwork.io website
Stars: ✭ 38 (+40.74%)
Mutual labels:  packer
pkenv
Packer version manager
Stars: ✭ 50 (+85.19%)
Mutual labels:  packer
Swarm
Swarm movement simulation
Stars: ✭ 21 (-22.22%)
Mutual labels:  swarm
opnsense-starterkit
Try opnsense, build opnsense images or start development
Stars: ✭ 18 (-33.33%)
Mutual labels:  packer
docker-chaos-monkey
A Chaos Monkey system for Docker Swarm
Stars: ✭ 30 (+11.11%)
Mutual labels:  swarm
cstruct-go
a fast c-style struct packer & unpacker for golang
Stars: ✭ 28 (+3.7%)
Mutual labels:  packer
bee-js
Javascript client library for connecting to Bee decentralised storage
Stars: ✭ 50 (+85.19%)
Mutual labels:  swarm
clusterplex
ClusterPlex is basically an extended version of Plex, which supports distributed Workers across a cluster to handle transcoding requests.
Stars: ✭ 123 (+355.56%)
Mutual labels:  swarm

Docker Swarm on AWS

This repo provisions a Docker Swarm Cluster on AWS using Packer and Terraform.

First export yout credentials and create the ami using packer. Provide the region variable when executing packer. The packer script uploads two files docker.conf and init.py. The first is for customize the docker service and the latter is a python script for initialize the cluster and add nodes to it.

export AWS_ACCESS_KEY_ID=your-access-key-here
export AWS_SECRET_ACCESS_KEY=your-secret-access-key-here
export AWS_DEFAULT_REGION=your-region

cd packer/
packer build -var 'region=us-east-1' docker.json

Write down the ami id generated.

Set the terraform variables like this:

export TF_VAR_manager_count=how-many-managers-do-you-want Ej: 1, 3, 5 (odd numbers recommended)
export TF_VAR_worker_count=how-many-workers-do-you-want Ej: 1,5,10,1000
export TF_VAR_key=your-key
export TF_VAR_ec2_ami=the-ami-key-generated-with-packer

Also check all the variables on the variables.tf file and modify as you wish. Now you can provision the infrastructure with Terraform

cd terraform/
terraform apply

A brief description of scripts is provided next:

  • provider.tf defines the aws region.
  • variables.tf contains all variables used on the scripts.
  • securitygroups.tf defines the security groups for elastic load balancer and ec2 instances.
  • iam.tf contains the iam role assigned to cluster nodes.
  • loadbalancing.tf defines the elastic load balancer
  • autoscaling.tf contains the launch configurations and autoscaling groups for worker and manager nodes.

Currently there are no outputs defined so you should login to AWS console to get nodes information.

TO-DO

  • Think about how to initialize cluster and how worker nodes will automagically join to it
  • Improve cluster initializer/join-nodes script
  • Remove workers from cluster when replaced
  • Deploy some CI/CD tools on cluster (Jenkins?)
  • Add a Docker registry
  • Add a proxy for accessing containers (Docker Flow Proxy?)
  • Add a monitoring tool
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].