GithubHelp home page GithubHelp logo

kintoandar / bakery Goto Github PK

View Code? Open in Web Editor NEW
18.0 3.0 2.0 6 KB

Baking delicious cloud instances ๐Ÿฐ

Home Page: https://blog.kintoandar.com/2017/06/Baking-delicious-cloud-instances.html

License: MIT License

terraform packer aws ansible cloud-init infrastructure-as-code

bakery's Introduction

Table of Contents

Bakery - Baking delicious cloud instances

This repository illustrates the proposed workflow described on this blogpost for baking AMIs, launching instances and using Ansible to abstract both configuration logic flows, so I highly recommend you read it first.

Workflow

The following sequence diagram describes the workflow:

bakery_sequence

Example

In this example, we want to spin up an instance with Prometheus using a separated data volume, which is useful for instance failures and service upgrades. The flow is something like this:

bakery_flow

Requirements

This demo has the following requirements:

  • AWS API access tokens
  • Packer >= 1.0.0
  • Ansible >= 2.3.0.0

How to

To generate an AMI to be used in this workflow you'll just need to run:

# Get the repo
git clone https://github.com/kintoandar/bakery.git
cd bakery

# Download ansible roles dependencies
ansible-galaxy install -r ./requirements.yml -p ./roles

# Use packer to build the AMI (using ansible)
export AWS_SECRET_ACCESS_KEY=XXXXXXXXXXXXXXXXXXXXXXXX
export AWS_ACCESS_KEY_ID=XXXXXXXXXXXXXXXXXX
packer build ./packer.json

Testing

Now, to test the new AMI, just launch it with an extra EBS volume and use the provided cloud-init configuration example as the user-data. After the boot, you can check the cloud-init log in the instance:

less /var/log/cloud-init-output.log

Be sure that /root/bakery/cloud-init.json was created with all the required overrides for Ansible, specially the cloud_init=true.

Ready to be served

Happy baking ๐Ÿฐ

bakery's People

Contributors

kintoandar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

nyrank opsbay

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.