Balaji Vajjala's Blog

A DevOps Blog from Trenches

05

  • 5.5 Chaos Monkey
    • Learning Objectives
    • Chaos Monkey
    • Run the Chaos Monkey job
    • View the Chaos Monkey code

5.5 Chaos Monkey

Learning Objectives

By the end of this lesson you will be able to:

  • Create and run a rudimentary Chaos Monkey that randomly terminates instances.

Chaos Monkey

Slide1

Run the Chaos Monkey job

  1. Go to http://IPADDRESS:8080/jenkins/job/Chaos/. IPADDRESS is the IP Address assigned to you when you launched the Jenkins stack.
  2. Select the Configure link for the Jenkins job. View the job configuration.

View the Chaos Monkey code

  1. Open the infrastructure destroyer Ruby file. You can find this file by visiting https://github.com/stelligent/devopsinthecloud/blob/master/chaos/infrastructure_destroyer.rb.

    “` $ cd devopsinthecloud/chaos

    “`

    “` $ sudo vim infrastructure_destroyer.rb

    “`

  2. This script is configured in Jenkins to run every night.

  3. Using the Ruby AWS SDK, it randomly terminates instances.
  4. Be cautious in using this tool. You need an architecture designed to accommodate this kind of failure. This is only an example of one resource – EC2 instance. There are myriad combinations of havoc you can apply to your infrastructure.