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

Dive in IAC (Infrastructure as Code)

Buzzvil
October 17, 2018

Dive in IAC (Infrastructure as Code)

By Noah

Buzzvil

October 17, 2018
Tweet

More Decks by Buzzvil

Other Decks in Programming

Transcript

  1. Index 1. What is Devops? 2. What is IAC (Infrastructure

    as code)? 3. What is benefit? 4. Why Terraform? 5. How to Adjust Buzzvil? 6. Cons of Terraform? 7. What to do next?
  2. 1. What is Devops? - Move to cloud (e.g. AWS,

    Azure and Google cloud). - Ops team spending all their time working on software. (e.g Chef, Puppet, Terraform and Docker) - To automate as much of the software process.
  3. 2. What is IAC (Infrastructure As Code) Goal - Write

    and execute code to define, deploy and update your infrastructure - Treat all aspects of operations as software - even those aspects that represent hardware (e.g, setting up physical servers) Four categories of IAC tools - AD hoc script - Configuration management tools - Server templating tools - Server provisioning tools
  4. 2. What is IAC (Infrastructure As Code) 1) AD hoc

    script - Straightforward approach to automating anything to write - e.g boto3
  5. 2. What is IAC (Infrastructure As Code) 2) Configuration management

    tool - Coding conventions - Idempotence - Distribution - e.g stack.py
  6. 2. What is IAC (Infrastructure As Code) 3) Server Templating

    Tools - An alternative to configuration management that has been growing in popularity - To create an image of a server that captures a fully self-contained “snapshot”. - e.g Packer
  7. 2. What is IAC (Infrastructure As Code) 4) Server Provisioning

    Tools - Provisioning tools to not only servers, but also databases, caches, load balancers, subnet, firewall settings, routing rules and almost every aspect - No in Buzzvil
  8. 3. What is benefits? What is difficult? - Click button

    on AWS console can make a mistake - Understand the structure of infrastructure is so hard - No History - Do the same job repeatedly
  9. 3. What is benefits? - Speed and safety - Documentation

    - Version control - Validation - Reuse - Happiness
  10. 4. Why Terraform Versus Procedural Language - How to achieve

    some desired end state e.g) create 15 instances
  11. 4. Why Terraform Versus CloudFormation (AWS) Pros - Handle Existing

    Resource ( Import existing resource ) - Verify changes ( Terraform presents a detailed and readable summary of the changes ) - Scope ( Support other cloud providers and 3rd party ) Cons - Wait condition ( No wait condition for service ) - No rolling update for Auto Scaling group
  12. 5. How to adjust Buzzvil Create redis instance task STEP

    1. Build AMI Image STEP 2. AD hoc script Create Instance STEP 3. Master - Slave with SSH
  13. 5. How to adjust Buzzvil Disk Full Error … Method

    create_instace is used for creating many kinds of instance. In this error, parameter must to be “volume_size = 200”
  14. 5. How to adjust Buzzvil - BuzzAd, BuzzScreen redis has

    same spec ( Reuse ), only different AMI image.
  15. 5. How to adjust Buzzvil - Show relation Master -

    Slave - Set Master - Slave, after created redises automatically
  16. 6. Cons of Terraform Cons - Wait condition ( Service

    ) - No rollback for Auto scaling group Resolution Harmony with Kubernetes , Terraform control static resource (e.g VPC, Subnet, EIP, Security_group …)
  17. 7. What to do next? - Import existing resource to

    Terraform - Harmony with Kubernetes - Make module for reuse - Provisioning with Ansible