<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Deb Bakshiyev on Medium]]></title>
        <description><![CDATA[Stories by Deb Bakshiyev on Medium]]></description>
        <link>https://medium.com/@dbakshiyev?source=rss-725978f38c4f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*XAdEM3Z7AQ_68wQ7.</url>
            <title>Stories by Deb Bakshiyev on Medium</title>
            <link>https://medium.com/@dbakshiyev?source=rss-725978f38c4f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 05:03:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dbakshiyev/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Running Chaos Monkey on Spinnaker/Google Compute Engine (GCE)]]></title>
            <link>https://blog.spinnaker.io/running-chaos-monkey-on-spinnaker-google-compute-engine-gce-155dc52f20ef?source=rss-725978f38c4f------2</link>
            <guid isPermaLink="false">https://medium.com/p/155dc52f20ef</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[spinnaker]]></category>
            <category><![CDATA[chaos-monkey]]></category>
            <dc:creator><![CDATA[Deb Bakshiyev]]></dc:creator>
            <pubDate>Tue, 09 May 2017 20:05:22 GMT</pubDate>
            <atom:updated>2017-05-09T20:05:22.870Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*_jOlIUUXJVeNKlKs5HmwKA.png" /></figure><p>Chaos Monkey is a service that randomly terminates VM instances and containers–these frequent failures promote the creation of resilient services. <a href="http://techblog.netflix.com/2016/10/netflix-chaos-monkey-upgraded.html">Chaos Monkey 2.0</a> is tightly integrated with Spinnaker: it relies on the Spinnaker APIs to terminate instances, retrieves deployment information from Spinnaker, and is configured using the Spinnaker UI.</p><p>Here, I’ll walk you through setting up and running Chaos Monkey on Google Compute Engine (GCE).</p><p><strong>Part 0: Prerequisites</strong></p><p>Deploy Spinnaker:</p><ul><li><a href="http://www.spinnaker.io/docs/creating-a-spinnaker-instance">Here</a> and <a href="http://www.spinnaker.io/v1.0/docs/installation-tools">here</a> are some resources to get you started.</li></ul><p>Install Go toolchain:</p><ul><li>See <a href="https://golang.org/doc/install#install">here</a>, make sure you have the latest version.</li></ul><p>Set up a Cloud SQL Instance:</p><ul><li>Go to the <a href="https://console.cloud.google.com/sql/instances"><strong>Cloud SQL Instances Page</strong></a><strong> </strong>in the Google Cloud Platform Console.</li><li>Click<strong> Create Instance.</strong></li><li>Select MySQL, then <strong>Next</strong>.</li><li><strong>Choose Second Generation</strong>.</li><li>Enter an ID.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c5RONDEy0lYgvG6b." /></figure><ul><li>Enter a password for the root user (remember this password).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bZ8mioTL_iQLZIum." /></figure><ul><li>Click <strong>Create</strong>.</li><li><em>(Optional)</em> Create a new user named <strong>chaosmonkey</strong>, with the same permissions as root. This may be useful in the future if you want to configure users with unique permissions.</li><li>To do this, click on your new instance and go to <strong>Access Control</strong>, then <strong>Users.</strong></li><li>Click on <strong>Create user account.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*vuiKQ1HM4P7rpxUG." /></figure><ul><li>Set <strong>chaosmonkey</strong> as the user name and fill in a password. Then click <strong>Create</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mwkd4ofEJ14xbAZT." /></figure><p><strong>Part 1: Authorize VM and create chaosmonkey database</strong></p><p>Add your VM’s external IP to the list of authorized networks:</p><ul><li>You can find the IP by going to Compute Engine’s<strong> VM instances </strong>panel and clicking on your instance.</li><li>Click on <strong>Access Control</strong> on your Cloud SQL instance’s details page.</li><li>Click<strong> Add Network</strong>.</li><li>Name your network if you’d like, and add the IP address you just copied.</li><li>Hit <strong>Done</strong>, and then <strong>Save</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*KCgmfNC6EJ1_K_sO." /></figure><p>Create a chaosmonkey database in the Cloud SQL Instance you created:</p><ul><li>Click on your instance on the Cloud SQL Instances Page.</li><li>Click on <strong>Databases</strong> (there should already be some there), and then <strong>New database.</strong></li><li>Name the database chaosmonkey, then click <strong>Create</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LYxWEf1ZTWYp-NkO." /></figure><p><strong>Part 2: Install and Configure Chaos Monkey</strong></p><p><strong>Install Chaos Monkey</strong> (requires Go and Git toolchains):</p><pre>go get github.com/netflix/chaosmonkey/cmd/chaosmonkey</pre><p><strong>Enable Chaos Monkey </strong>using one of these three configuration options:</p><ol><li>Add the following flag to feature in settings.js:</li></ol><pre>chaosMonkey: true</pre><p>This will surface Chaos Monkey in Deck, you will see it as an option under config.</p><p>2. Alternatively, you can configure Chaos Monkey using the unified config in <a href="https://github.com/spinnaker/spinnaker/">spinnaker/spinnaker</a>.</p><p>To do this, flip the chaos flag to true:</p><pre>chaos:</pre><pre> enabled: true</pre><p>3. If you’re using <a href="https://github.com/spinnaker/halyard">Halyard</a> (a tool for managing Spinnaker deployments), run:</p><pre>hal config features edit --chaos true</pre><p>Once Chaos Monkey is enabled, you’ll be able to view it in Deck as an option under Config.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AcwB1g6pPaxY0SqC." /></figure><p><strong>Part 3: Configure Chaos Monkey</strong></p><p>Chaos Monkey will look for its config file in a few locations:</p><ul><li>. (current directory)</li><li>/apps/chaosmonkey/</li><li>/etc</li><li>/etc/chaosmonkey</li></ul><p>Set up the Chaos Monkey config file, chaosmonkey.toml, in one of those locations:</p><pre><strong>[chaosmonkey]</strong><br>enabled = <strong>true</strong><br>schedule_enabled = <strong>true</strong><br>leashed = <strong>false</strong><br>accounts = [“my-google-account”]</pre><pre><strong>[database]</strong><br>host = “&lt;Cloud SQL Instance IP goes here&gt;”<br>name = “chaosmonkey”<br>user = “chaosmonkey”<br>encrypted_password = “&lt;user’s password goes here&gt;”</pre><pre><strong>[spinnaker]</strong><br>endpoint = “http://localhost:8084&quot;</pre><ul><li>Enter your clouddriver accounts in the account field. These could be accounts for other platforms if you have a multi-cloud deployment.</li><li>Use your Cloud SQL instance’s IPv4 address as the database host name–you can find this on the Cloud SQL Instance detail page.</li><li>If you have a chaosmonkey user, set chaosmonkey as the user. Otherwise, set it as root.</li><li>Enter your Spinnaker API url as the endpoint.</li><li>You can find more information on configuration files <a href="https://netflix.github.io/chaosmonkey/Configuration-file-format/">here</a>.</li></ul><p>If it’s been configured correctly, you can add the tables to the database by running:</p><pre>chaosmonkey migrate</pre><p><strong>Part 4: Configure Applications to Use Chaos Monkey</strong></p><p>Create a New Application in Deck, making sure to check the <strong>Chaos Monkey: Enabled</strong> checkbox.</p><ul><li>If you’d like to run through quickly setting up and terminating instances, you should also check <strong>Consider only cloud provider health when executing tasks.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uDnQ9zu720sXWyLm." /></figure><p>Verify that Chaos Monkey can reach Spinnaker by running:</p><pre>chaosmonkey config &lt;appname&gt;</pre><p>This should output the Chaos Monkey configuration for the app you just created.</p><p>Verify that Chaos Monkey can reach the database by running:</p><pre>sudo /home/&lt;user&gt;/go/bin/chaosmonkey fetch-schedule</pre><p>This will attempt to retrieve the termination schedule for the day. If there are none, it will write an empty file to /etc/cron.d/chaosmonkey-daily-terminations.</p><p>You will see an error if Chaos Monkey cannot reach the database.</p><p>That’s it! You should now have Chaos Monkey set up and ready to go.</p><p>Go <a href="https://netflix.github.io/chaosmonkey/">here</a> to read more documentation on Chaos Monkey, including an example of setting up a cron job that runs a daily schedule.</p><p>Keep reading if you’d like to experiment with terminating instances and set up an audit log.</p><p><strong>Part 5: Terminate instances</strong></p><p>Create a server group:</p><ul><li>Go to <strong>Clusters</strong> and click on <strong>Create Server Group.</strong></li><li>Select the <strong>ubuntu-trusty </strong>image.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ecfGE1rLXjU-scKb." /></figure><ul><li>Select<strong> Custom Type</strong> under Instance Type, then<strong> f1-micro</strong>.</li><li>Click <strong>Create</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6k3GpYAqrp0JcWYg." /></figure><ul><li>You can create more server groups if you’d like to try terminating several instances.</li></ul><p>Once the server groups are created, run:</p><pre>chaosmonkey eligible &lt;app name&gt; &lt;account name&gt;</pre><ul><li>Since you’ve enabled Chaos Monkey for this application, this will output any server groups you have created for this app.</li><li>To terminate an instance, run:</li></ul><pre>chaosmonkey terminate &lt;app name&gt; &lt;account name&gt;</pre><ul><li>You can view the progress of the termination task under <strong>Tasks</strong> on Deck.</li><li><em>Note: The above process is the same on Kubernetes and all other platforms supported by Spinnaker.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XRyrXbBH9TEaz7AW." /></figure><p>Congratulations! You’ve now successfully configured Chaos Monkey and used it to terminate an instance.</p><p><strong>Extra Credit: Spinnaker Audit Log</strong></p><p>As your use of Chaos Monkey becomes more extensive and complicated, you may want to be able to easily view logs of its actions. An audit log will let you track Chaos Monkey’s activity via <a href="https://cloud.google.com/logging/">Stackdriver logging</a>.</p><p>Go <a href="https://medium.com/continuous-delivery-scale/spinnaker-echo-google-cloud-functions-stackdriver-logging-spinnaker-audit-log-81139f084db9">here</a> for more information on how to set this up–as an added bonus, this logging functionality extends beyond Chaos Monkey and will allow you to view logs of all the events Echo propagates.</p><p><strong>References</strong>:</p><ul><li><a href="https://netflix.github.io/chaosmonkey/How-to-deploy/">Chaos Monkey</a></li><li><a href="https://cloud.google.com/sql/docs/mysql/create-instance#create-2nd-gen">Cloud SQL</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=155dc52f20ef" width="1" height="1" alt=""><hr><p><a href="https://blog.spinnaker.io/running-chaos-monkey-on-spinnaker-google-compute-engine-gce-155dc52f20ef">Running Chaos Monkey on Spinnaker/Google Compute Engine (GCE)</a> was originally published in <a href="https://blog.spinnaker.io/">The Spinnaker Community Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>