Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Does OpsWorks work?

Does OpsWorks work?

Presented at AWS User Group Taipei #1.

Richard Lee

April 19, 2013
Tweet

More Decks by Richard Lee

Other Decks in Technology

Transcript

  1. Does OpsWorks Work?
    Richard Lee
    Polydice, Inc.

    View full-size slide

  2. DevOps &
    Mobile
    @ Polydice
    @dlackty everywhere.
    Richard Lee

    View full-size slide

  3. Mobile Traffic > 50 %
    Android and other native platforms
    Mobile-First Design!
    High availability APIs is essential

    View full-size slide

  4. What is OpsWorks?

    View full-size slide

  5. Before switching to AWS, we used
    to be on Heroku platform. But...
    Somebody That I Used To Know

    View full-size slide

  6. Based on AWS
    Simple scaling
    Almost no operation cost
    Git-base deployment
    Lots of addons
    Good
    No system softs
    Addons reliability
    AWS US East region
    Routergate
    Issues
    I still recommend Heroku for startups
    but not suitable for complicated stack

    View full-size slide

  7. PaaS IaaS
    OpsWorks
    Here!

    View full-size slide

  8. EC2 instances +
    Auto setup +
    Centralized configuration +
    App deployment +
    Simple scaling = AWESOME!
    OpsWorks

    View full-size slide

  9. OpsWorks 101
    Your first course of OpsWorks

    View full-size slide

  10. Five steps to make it work
    Create
    Stack
    Config
    Layers
    Config
    App
    Add
    Instances
    Deploy

    View full-size slide

  11. Create stack
    A stack represents a collection of EC2 instances that have a
    common purpose.
    Some stack names for example:
    ↟iCook
    ↟Inside
    ↟MyAwesomeApp
    ↟YourFantasticStartup

    View full-size slide

  12. Stack naming

    View full-size slide

  13. Limited AMIs
    ↟Amazon Linux
    ↟Ubuntu 12.04

    View full-size slide

  14. Limited AMIs
    ↟Amazon Linux
    ↟Ubuntu 12.04

    View full-size slide

  15. AWS region &
    Availability zone

    View full-size slide

  16. Instances naming
    ↟Numerical
    ↟US Cities
    ↟Baked Goods

    View full-size slide

  17. Custom Chef JSON
    Centralized configuration as JSON
    For example, put your
    ↟3rd-Party service credentials
    ↟Targeted version of app to install

    View full-size slide

  18. Five steps to make it work
    Create
    Stack
    Config
    Layers
    Config
    App
    Add
    Instances
    Deploy

    View full-size slide

  19. Add layers
    A layer is a blueprint for a set of EC2 instances.
    For example:
    ↟Rails App Layer
    ↟MySQL Server Layer
    ↟Memcached layer
    ↟Redis layer

    View full-size slide

  20. Many built-in layers!

    View full-size slide

  21. What if there’re no built-in stacks for your need?
    Just create custom layer and add Chef recipes
    ↟Tons of open sourced cookbooks
    ↟Fork the AWS official cookbooks and make changes
    Resources
    ↟Peepcode’s video series Meet Chef
    ↟Polydice’s Cookbooks on GitHub

    View full-size slide

  22. Five steps to make it work
    Create
    Stack
    Config
    Layers
    Config
    App
    Add
    Instances
    Deploy

    View full-size slide

  23. Config app
    An app represents code stored in a repository that you
    want to install on application server instances.
    More than just copy file & restart server:
    ↟Notify load balancer
    ↟Assets precompile
    ↟Other tasks via custom recipes

    View full-size slide

  24. Many built-in app types,
    And built-in repo types!

    View full-size slide

  25. Five steps to make it work
    Create
    Stack
    Config
    Layers
    Config
    App
    Add
    Instances
    Deploy

    View full-size slide

  26. Create instances
    Instance are created based on layers.
    ↟24/7 instances
    ↟Time-based instance
    ↟Load-based instances
    Notice:
    ↟Only one layer per instance
    ↟You can also associate Elastic IP to instances

    View full-size slide

  27. Five steps to make it work
    Create
    Stack
    Config
    Layers
    Config
    App
    Add
    Instances
    Deploy

    View full-size slide

  28. Deploy
    Perform commands on slected instances
    ↟Deploy
    ↟Rollback
    ↟Exectue recipes
    ↟Update custom cookbooks / dependencies

    View full-size slide

  29. Recap: Five steps to make it work
    Create
    Stack
    Config
    Layers
    Config
    App
    Add
    Instances
    Deploy

    View full-size slide

  30. iCook is now fully OpsWorks-based!
    Spent 4 weeks working on this migration
    ↟4 layers (Rails / Worker / Redis / ElasticSearch)
    ↟Integrated with RDS / ElasticCache / ELB
    ↟Few 24/7 instances with some time-based ones
    ↟Performance++ & Response time--
    ↟Cost--!

    View full-size slide

  31. Email: [email protected]
    Twitter & GitHub: @dlackty
    Thank You!

    View full-size slide