<?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[Unif.io - Medium]]></title>
        <description><![CDATA[Here at Unif.io, we strive to offer the best technology solutions to fit the needs of your company. Unif.io was founded to provide high-value, customizable consulting services to companies that need help unifying and improving development and operational processes. - Medium]]></description>
        <link>https://medium.com/unif-io?source=rss----85dcac172423---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Unif.io - Medium</title>
            <link>https://medium.com/unif-io?source=rss----85dcac172423---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 06:43:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/unif-io" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Upgrading Artifactory Without Losing your Artifacts]]></title>
            <link>https://medium.com/unif-io/upgrading-artifactory-without-losing-your-artifacts-bd01db74b7d0?source=rss----85dcac172423---4</link>
            <guid isPermaLink="false">https://medium.com/p/bd01db74b7d0</guid>
            <category><![CDATA[immutable]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[artifactory]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Unif.io]]></dc:creator>
            <pubDate>Wed, 01 Mar 2017 16:03:13 GMT</pubDate>
            <atom:updated>2017-03-01T16:03:12.506Z</atom:updated>
            <content:encoded><![CDATA[<p>One of our clients is using <a href="https://www.jfrog.com/artifactory/">Jfrog’s Artifactory</a> product to store their build artifacts. Artifactory is a wonderful artifact repository manager that works great with continuous integration and deployment systems.</p><p>At <a href="http://unif.io/">Unif.io</a>, we believe in immutable architecture. For our Artifactory stack, we create a pre-baked AMI with the application and configure the application upon launch via an autoscaling group’s launch configuration. For upgrades, we take the latest backup of database and data volume and just switch out the AMI that is used. This allows for very little downtime to upgrade our environment as well as provide an easy fallback mechanism if necessary.</p><p>This week, we upgraded our client from Artifactory 4.12.2 to Artifactory 5.0.1 and ran into a couple issues during the upgrade. After much searching online, it appeared that others were having similar problems, but had not found a solution. Hopefully this post will help others running into the same issue.</p><p>The first issue we ran into with the Artifactory 5.0.1 upgrade was that when the application launched on a new version, it was reporting zero artifacts versus the number we originally had.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/801/1*uOg7t6Yh94e6giPYfmY8SQ.png" /></figure><p>The reason for this is due to the database configuration file which changed from storage.properties (in version 4.x) to db.properties (in version 5.x). This resulted in Artifactory launching with the default database configuration which is their built-in Derby database. In our case, we use a MySQL database. This was an easy fix to just change the file that we update with the database configuration.</p><p>After we resolved the database configuration, Artifactory then failed to launch at all. We were getting HTTP error 404.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/591/1*8cKgMDO0BzA7IZ_UKDv7lg.png" /></figure><p>The error in the logs related to a private key mismatch.</p><pre>java.lang.IllegalStateException: Provided private key and latest private key fingerprints mismatch. provided: xxxxxx, latest: yyyy</pre><p>Beginning in version 5.0, Artifactory has an <a href="https://www.jfrog.com/confluence/display/RTF/Access+Tokens">Access Token</a> feature that allows for additional method of authentication for the application. On first launch, access keys are generated if they do not already exist. However, the database already contains an entry for the private key. It does not appear that Artifactory generates the key file based on the value in the database or that the value in the database is updated with new private key. Thus, we get the private key mismatch error startup.</p><p>To resolve this, we followed the following steps:</p><p>1. Ensure you have a good export of the existing database. We are using MySQL, so mysqldump was used to generate an export of the database.</p><p>2. Create an empty database following Artifactory’s documentation as if this is a brand-new installation. In our case, we are using <a href="https://www.jfrog.com/confluence/display/RTF/MySQL">MySQL</a>.</p><p>3. Update the db.properties file to point to the new empty database.</p><p>4. Launch Artifactory. It should start up successfully and show that zero artifacts are being served. This is expected as we are using an empty database.</p><p>5. Verify that the access keys were generated. They can be found in $ARTIFACTORY_HOME/access/etc/keys.</p><p>6. If the application launched successfully, now stop the application and export the database. Again, we used mysqldump to export our database. The backup file will contain a section for access servers. This contains the private key to match the access keys that were generated. Example:</p><pre>LOCK TABLES `access_servers` WRITE;</pre><pre>/*!40000 ALTER TABLE `access_servers` DISABLE KEYS */;</pre><pre>INSERT INTO `access_servers` VALUES (&#39;&lt;server_id&gt;&#39;,&lt;created&gt;,&lt;modified&gt;,&#39;&lt;server_name&gt;&#39;,&#39;&lt;version&gt;&#39;,’&lt;private_key_fingerprint&gt;’,&lt;privkey_modified&gt;,0);</pre><pre>/*!40000 ALTER TABLE `access_servers` ENABLE KEYS */;</pre><pre>UNLOCK TABLES;</pre><p>7. Update the SQL file created in step 1. Replace the access_server section with the entry from the empty database’s export.</p><p>8. Now create a new database and populate with the SQL file updated in step 7.</p><p>9. Update Artifactory database configuration to point to the new database created in step 8.</p><p>10. Start Artifactory. The access keys should now match the private key in the database.</p><p>11. Verify that Artifactory launches successfully and that it is serving the correct number of artifacts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/783/1*avnt-IejON4A1pTdr7NyQg.png" /></figure><p>This should only be required to run through once. Going forward, the access keys should be part of your data volume, so they should always match the value in the database. Hopefully this will help someone else out if they run into similar issues.</p><p>Reference to users with similar issues:</p><ul><li><a href="https://www.jfrog.com/jira/browse/RTFACT-13671">Losing all data (artifacts, users,groups…) after upgrading Artifactory</a></li><li><a href="https://www.jfrog.com/jira/browse/RTFACT-13657">Converting a standalone artifactory to HA ends with mismatching access service ID and cluster ID in the master node</a></li></ul><p>Kathy Jonick, Senior Consultant<br>Unif.io</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/135/1*k_p8RodE3-iP59dpIsdpqw.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd01db74b7d0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/unif-io/upgrading-artifactory-without-losing-your-artifacts-bd01db74b7d0">Upgrading Artifactory Without Losing your Artifacts</a> was originally published in <a href="https://medium.com/unif-io">Unif.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rollback of Artifacts in HashiCorp Atlas]]></title>
            <link>https://medium.com/unif-io/rollback-of-artifacts-in-hashicorp-atlas-ca064b447017?source=rss----85dcac172423---4</link>
            <guid isPermaLink="false">https://medium.com/p/ca064b447017</guid>
            <category><![CDATA[hashicorp]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[immutable]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Unif.io]]></dc:creator>
            <pubDate>Fri, 10 Feb 2017 21:15:52 GMT</pubDate>
            <atom:updated>2017-02-10T21:19:27.482Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’re using the HashiCorp Atlas service for Terraform state storage, you are probably aware of the very handy capability for rolling back to previous versions of a state file. I will stay off my soap box about how to properly prevent ending up in situations where you need this capability, but I confess I have been there and was thankful for the feature.</p><p>If you’re familiar with what Atlas is doing under the covers, you know that it is not actually rolling back anything. As all artifacts are immutable, it is essentially copying the previous version you selected into a new version, which brings us to the point of this post.</p><p>If you’re reading this, you’ve likely already reviewed the only other resource on this topic at</p><p><a href="https://atlas.hashicorp.com/help/terraform/artifacts/managing-versions">Managing Artifact Versions - Help | Atlas by HashiCorp</a></p><p>and realized that there is no convenient rollback option for the artifact registry.</p><p>Now the advice on this page is sound and artifact pinning is a good practice, but it can also hinder continuous delivery. The risk you run by configuring Terraform to simply pull the latest version is that it is far too easy to introduce an under-verified artifact into the deployment path. Fortunately, it is possible for the two paradigms to complement each other through clever usage of artifact metadata. The solution for rollback that I will show you here is also the basis for more effective management of your artifacts in general, which I will expand on in a future post.</p><p>On to the good stuff. As you likely surmised, all artifacts in Atlas are immutable, which is why you can’t find a way to update or delete the artifact you want gone. Our solution to this is the same as the Terraform state approach in that we are going to take the last known good version and copy it into the new latest version. I suspect many of you may have come to this conclusion as well, which would have led you to the Atlas API documentation at</p><p><a href="https://atlas.hashicorp.com/help/api">Atlas API Documentation - Help | Atlas by HashiCorp</a></p><p>But wait, what’s this? Zero API docs for the artifact registry!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*8u11PjxcTn6g4MhBLp6G8A.gif" /></figure><p>Surely there is an API for this. Packer can create the artifact after all.</p><p>Hopefully the next thing you find from Google is this article and all is right with the world again, but up until now some inspection of the Packer code would have led you here:</p><p><a href="https://github.com/hashicorp/atlas-go">hashicorp/atlas-go</a></p><p>Everything you need to know can pretty much be found in <strong>v1/artifact.go</strong>. At this point you can write your own client leveraging this library to handle your artifact manipulation needs.</p><p>For those of you praying that this is not the end of this post, an example of the quick fix for your issue is as follows:</p><pre>curl -X POST -H &quot;Content-Type: application/json&quot; -H &quot;X-Atlas-Token: $ATLAS_TOKEN&quot; -d &#39;<br>{<br> &quot;artifact_version&quot;: {<br>    &quot;id&quot;: &quot;us-east-1:ami-xxxxxxxx&quot;,<br>    &quot;file&quot;: false,<br>    &quot;metadata&quot;: {<br>      &quot;ami_id&quot;: &quot;ami-xxxxxxxx&quot;,<br>      &quot;region&quot;: &quot;us-east-1&quot;,<br>      &quot;region.us-east-1&quot;: &quot;ami-xxxxxxxx&quot;<br>    }<br>  }<br>}&#39; <a href="https://atlas.hashicorp.com/api/v1/artifacts/examplecorp/ecs-base/amazon.image">https://atlas.hashicorp.com/api/v1/artifacts/examplecorp/ecs-base/amazon.image</a></pre><p>The parameters you need to pass will vary depending on your use case and account, so you should start by dumping some current values from your registry with a call like the following:</p><pre>curl -H &quot;X-Atlas-Token: $ATLAS_TOKEN&quot; <a href="https://atlas.hashicorp.com/api/v1/artifacts/examplecorp/ecs-base/amazon.image/search">https://atlas.hashicorp.com/api/v1/artifacts/examplecorp/ecs-base/amazon.image/search</a></pre><p>This will return values like the following:</p><pre>{<br>  &quot;username&quot;: &quot;examplecorp&quot;,<br>  &quot;name&quot;: &quot;ecs-base&quot;,<br>  &quot;tag&quot;: &quot;examplecorp/ecs-base&quot;,<br>  &quot;slug&quot;: &quot;examplecorp/ecs-base/amazon.image/1&quot;,<br>  &quot;artifact_type&quot;: &quot;amazon.image&quot;,<br>  &quot;id&quot;: &quot;us-east-1:ami-xxxxxxxx&quot;,<br>  &quot;version&quot;: 1,<br>  &quot;metadata&quot;: {<br>    &quot;ami_id&quot;: &quot;ami-xxxxxxxx&quot;,<br>    &quot;region&quot;: &quot;us-east-1&quot;,<br>    &quot;region.us-east-1&quot;: &quot;ami-xxxxxxxx&quot;<br>  },<br>  &quot;file&quot;: false<br>}</pre><p>Parameters like <strong>username, name, tag, artifact_type</strong> and <strong>version</strong> are either derived from the URL or generated by Atlas, so you won’t need to specify them.</p><p>I hope this gets you out of your pinch and is food for thought about the possibilities for your registry.</p><p>If you need additional guidance or want to find out more about our services, contact us at <a href="/service/mailto:contact@unif.io">contact@unif.io</a> or visit <a href="http://unif.io/services">unif.io/services</a>. <a href="http://unif.io/">Unif.io</a> offers consulting services to supplement your team and DevOps enablement services through our team of expert developers, architects and engineers.</p><p>Wilson Carey, CTO<br><a href="https://unif.io/">Unif.io</a>, Inc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/135/1*MEccfaZNHwzMtvjba8gG3g.jpeg" /><figcaption>Wilson Carey</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ca064b447017" width="1" height="1" alt=""><hr><p><a href="https://medium.com/unif-io/rollback-of-artifacts-in-hashicorp-atlas-ca064b447017">Rollback of Artifacts in HashiCorp Atlas</a> was originally published in <a href="https://medium.com/unif-io">Unif.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying Consul with ECS — Part 2]]></title>
            <link>https://medium.com/unif-io/deploying-consul-with-ecs-part-2-38de98a56611?source=rss----85dcac172423---4</link>
            <guid isPermaLink="false">https://medium.com/p/38de98a56611</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[aws-ecs]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Unif.io]]></dc:creator>
            <pubDate>Tue, 31 Jan 2017 18:14:12 GMT</pubDate>
            <atom:updated>2017-01-31T18:14:12.212Z</atom:updated>
            <content:encoded><![CDATA[<p>In my last article in this series (<a href="https://blog.unif.io/deploying-consul-with-ecs-2c4ca7ab2981">Deploying Consul with ECS</a>), I covered deployment of the Consul agent using Amazon’s Elastic Container Service (ECS). In this article, I will go further and discuss considerations for running the Consul agent in server mode on ECS.</p><p>Before I dive into server mode however, there have been a fair amount of ECS updates since my last article that bare mentioning here.</p><h3>Host Networking</h3><p>Perhaps the largest advancement since the last article is ECS support for Docker networking modes and more specifically the ability to map directly to the host network.</p><p>I admit I was somewhat resistant to using this when it was first introduced, as philosophically I do believe in keeping workloads agnostic to the underlying cluster hosts and besides I already had the agent working with the bridge network. I’ve since relaxed my stance on this a bit with regards to workloads that are targeted at being system daemons, as they are inherently not agnostic to the cluster host and the need for host context within the container is the norm and not the exception.</p><p>This is best illustrated in the Consul context with the required lookup to the EC2 metadata to obtain the IP of the host. While this solution works, and has the feeling of being host agnostic, it highlights the chicken and egg problem very clearly in that it is exactly the type of problem we would use Consul to solve for our own containerized workloads. At the beginning of the chain of lookups there must be a registry that actually has the host information, thus our efforts to maintain separation end up only introducing additional complexity and management overhead.</p><p>Other advantages of moving to host networking are as follows:</p><ul><li>The official HashiCorp Docker image no longer needs to be modified for this use case. Both IP and hostname of the cluster host can be obtained without a secondary registry. Note that use of the CONSUL_BIND_INTERFACE option will now yield a viable configuration and should be used.</li><li>The official HashiCorp documentation, which is geared towards use of host networking, is more useful.</li><li>Removal of the bridge networking abstraction is a plus for the consensus and gossip traffic, which are sensitive to latency.</li></ul><h3>Container Lifecycle Management</h3><p>In my previous article, I evangelized the approach presented in the <a href="http://docs.aws.amazon.com/AmazonECS/latest/developerguide/start_task_at_launch.html">ECS documentation for managing containerized system daemon processes.</a></p><p>The argument was that these processes should be launched as ECS tasks from each host as opposed to simply starting unmanaged container instances, the value proposition being that these tasks would then be visible to the ECS scheduler for proper accounting of resource consumption.</p><p>While this is superior to unmanaged container processes in terms of visibility, it scales poorly as updates to containers either need to be done manually or via an additional orchestration layer.</p><p>The AWS response to this was the launch of the <a href="https://blox.github.io/">Blox project,</a> targeted at showcasing the customizable nature of ECS with some tangible examples.</p><p>One of the charter projects is a scheduler specifically targeted for daemon process. This is awesome to see them investing in these types of projects, however the current implementation relies on a separate cluster state service and an etcd based registry backend. Not really a winner for trying to deploy Consul to do the same job. While there is a roadmap item for making the data store pluggable, I wouldn’t expect to see it any time soon.</p><p>I have started using a fairly straight forward pattern for managing our daemon containers that I’m surprised I haven’t seen talked about more. For Consul, it requires nothing special at all. The key is the port mapping between the container and the host. As the bind can only occur once per host, the default service scheduler does exactly what we want as long as the desired task count and cluster size are the same. As we codify our infrastructure using Terraform, keeping these values in alignment is easy to maintain.</p><p>While it does feel like I cheated a bit to avoid custom scheduling, it works quite well for our use cases. The main question with this approach used to be how to handle auto scaling, but that has been solved with the <a href="http://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-auto-scaling.html">introduction of application auto scaling</a> where you simply coordinate the host cluster and application policies using the same CloudWatch alarm.</p><p>There are some scenarios (i.e. Registrator) where I’ve mapped an arbitrary port in order to make this work, but given the alternative I’ve made my peace with it for the time being.</p><h3>Consul Server on ECS</h3><p>A Consul server is simply an agent running in server mode. The additional role performed by an agent in server mode can generally be categorized as coordination of activities within the cluster as well as tracking of cluster state.</p><p>The differences in deployment of Consul clients versus server nodes are minimal at the ECS task level.</p><p>An example of the environment variables and arguments passed to the Consul container for an agent in client mode are as follows:</p><pre>&quot;command&quot;: [ <br>    &quot;agent&quot;, <br>    &quot;-client=0.0.0.0&quot;, <br>    &quot;-datacenter=dc0&quot;, <br>    &quot;-retry-join=consul.unif.io&quot; <br>  ], <br>  &quot;environment&quot;: [{ <br>    &quot;name&quot;: &quot;CONSUL_BIND_INTERFACE&quot;, <br>    &quot;value&quot;: &quot;eth0&quot; <br>  }]</pre><p>An example of the environment variables and arguments passed to the Consul container for an agent in server mode are as follows:</p><pre>&quot;command&quot;: [ <br>    &quot;agent&quot;, <br>    &quot;-server&quot;, <br>    &quot;-client=0.0.0.0&quot;, <br>    &quot;-bootstrap-expect=3&quot;, <br>    &quot;-ui&quot;,<br>    &quot;-datacenter=dc0&quot;, <br>    &quot;-retry-join-ec2-tag-key=aws:autoscaling:groupName&quot;, <br>    &quot;-retry-join-ec2-tag-value=ops-cluster&quot;<br>  ], <br>  &quot;environment&quot;: [{ <br>    &quot;name&quot;: &quot;CONSUL_BIND_INTERFACE&quot;, <br>    &quot;value&quot;: &quot;eth0&quot; <br>  }]</pre><p>The only required argument for starting the agent in server mode is -<strong>server</strong>. The other options here deal with establishing communication between nodes and setting parameters for that communication.</p><p>In the absence of the <strong>-retry-join </strong>options, agents must be joined to an existing cluster manually using the <strong>join</strong> command either via the <a href="https://www.consul.io/docs/commands/join.html">CLI</a> or the <a href="https://www.consul.io/docs/agent/http/agent.html#agent_join">HTTP API</a>.</p><p>The <strong>join </strong>command needs only to target a single member of an existing cluster to begin gossiping. Gossip can be initiated with any member of an existing cluster, not just agents in server mode.</p><p>Until recently this initial node discovery was a little challenging, as an ECS task definition requires a fixed value for this parameter. The <strong>-</strong><strong>retry-join-ec2</strong> options were introduced in Consul 0.7.1 and really are the best way to go for node discovery on EC2. What is happening under the hood is a call to the AWS API to describe instances with the specified key/value pair in the tag metadata.</p><p>Node discovery was possible pre-0.7, as illustrated in the agent example above, using an elastic load balancer (ELB) to provide our fixed point. While ELB does not support UDP, the initial connect on the TCP gossip port (8301) is sufficient for node discovery. The ELB is also useful for exposing the HTTP API (8500) and the web user interface (UI). For those who have been using Consul prior to 0.6 and have experience with deploying the UI separately, the UI is now included in the default package and can be enabled by passing the <strong>-ui</strong> argument to the agent. I typically only include server nodes in the ELB pool and by association only enable the UI on those nodes, but that is not a hard and fast rule as all agents expose the HTTP API.</p><p>Now that we’ve configured our agents to cluster automatically at startup, we need to provide some parameters regarding how the cluster organizes itself. This is where the <strong>-bootstrap-expect</strong> parameter comes into play.</p><p>Consul is a consensus based system, which means a quorum of cluster members is required for the system to operate. This is only true for agents running in server mode, as it allows non-server agents to be relatively stateless and is important for scalability. The consensus protocol in use is called Raft and you can find a very good explanation of how Consul utilizes Raft at the following URL:</p><p><a href="https://www.consul.io/docs/internals/consensus.html">Consul by HashiCorp</a></p><p>For our purposes here, what you need to know is that each server needs to be started with the knowledge of how large of a pool of servers to expect so that it can determine what constitutes a quorum. Three servers are a good low water mark for server clusters, as it allows for the failure of one node without losing quorum, which is defined as (n/2) + 1 for a set of n servers. Note that performance drops as the pool of members that must reach consensus increases, which is why HashiCorp recommends a server cluster size of no more than five members.</p><p>This is only scratching the surface of agent configuration. The full documentation can be found at the following URL:</p><p><a href="https://www.consul.io/docs/agent/options.html">Configuration - Consul by HashiCorp</a></p><p>The official Docker image entry point script does a great job of exposing common options and some helper functions as environment variables. For everything else, you can feed in configuration as JSON via the CONSUL_LOCAL_CONFIG environment variable.</p><p>In upcoming posts in this series, I will be covering the following topics:</p><ul><li>Versioning change in the ECS optimized AMI as immutable artifacts utilizing HashiCorp Packer</li><li>Consul on ECS deployment patterns using HashiCorp Terraform</li><li>A comparison of the Blox framework and Consul</li></ul><p>If you need additional guidance or want to find out more about our services, contact us at <a href="/service/mailto:contact@unif.io">contact@unif.io</a> or visit <a href="http://unif.io/services">unif.io/services</a>. <a href="http://unif.io/">Unif.io</a> offers consulting services to supplement your team and DevOps enablement services through our team of expert developers, architects, and engineers.</p><p>Wilson Carey, CTO<br><a href="https://unif.io/">Unif.io</a>, Inc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/135/1*MEccfaZNHwzMtvjba8gG3g.jpeg" /><figcaption>Wilson Carey</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=38de98a56611" width="1" height="1" alt=""><hr><p><a href="https://medium.com/unif-io/deploying-consul-with-ecs-part-2-38de98a56611">Deploying Consul with ECS — Part 2</a> was originally published in <a href="https://medium.com/unif-io">Unif.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cisco CSR 1000V Part 1 — Configuration Overview & Creation of an Immutable Artifact]]></title>
            <link>https://medium.com/unif-io/cisco-csr-1000v-part-1-configuration-overview-creation-of-an-immutable-artifact-dd18c7646aaa?source=rss----85dcac172423---4</link>
            <guid isPermaLink="false">https://medium.com/p/dd18c7646aaa</guid>
            <category><![CDATA[pipeline]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cisco]]></category>
            <category><![CDATA[ci]]></category>
            <category><![CDATA[vpc]]></category>
            <dc:creator><![CDATA[Unif.io]]></dc:creator>
            <pubDate>Thu, 19 Jan 2017 16:36:29 GMT</pubDate>
            <atom:updated>2017-01-19T16:37:25.302Z</atom:updated>
            <content:encoded><![CDATA[<h3>Overview &amp; Some Back Story</h3><p>The team at <a href="http://unif.io/">Unif.io</a> was tasked with eliminating the last piece of on-premises hardware in a client’s infrastructure. This client had a pair of on-premises Cisco ISRs (Integrated Services Routers) that connected their <a href="https://aws.amazon.com/vpc/">AWS VPC (Amazon Web Services Virtual Private Cloud)</a> of backend service nodes to client devices on a private wireless <a href="https://en.wikipedia.org/wiki/Machine_to_machine#Applications">M2M (machine-to-machine)</a> network.</p><p><strong><em>Existing Topology</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*fayEL_Z30n1hdvwN_EYFjQ.png" /></figure><p>To generalize the infrastructure, they needed to connect a private carrier network to their AWS private cloud network. Now, if you are familiar with AWS VPC’s you might be wondering why would you need dedicated on premise Cisco ISRs to accomplish this. Well the answer to that is <a href="https://en.wikipedia.org/wiki/Generic_Routing_Encapsulation">GRE (Generic Routing Encapsulation)</a> which AWS did not support on their <a href="http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpn-connections.html">VPC VPN connections</a>.</p><p><strong><em>So what were our Options?</em></strong></p><p>Replacing the Cisco ISRs with a solution in the clients AWS environment required an <a href="https://aws.amazon.com/ec2/">EC2 (Elastic Cloud Compute)</a> instance that could provide the needed routing capabilities previously handled by the Cisco ISRs. The search for a viable option in the <a href="https://aws.amazon.com/marketplace/b/2649366011?ref_=hmpg_categories_2649366011">AWS Marketplace</a> resulted in a few different <a href="https://en.wikipedia.org/wiki/Amazon_Machine_Image">AMIs (Amazon Machine Images)</a>:</p><ul><li><a href="https://aws.amazon.com/marketplace/pp/B00JK5UPF6">VyOS</a></li><li><a href="https://aws.amazon.com/marketplace/pp/B00EV8VXG2/">Cisco CSR 1000v</a></li><li><a href="https://aws.amazon.com/marketplace/pp/B00G6P8CVW">Netgate pfSense</a> with <a href="https://doc.pfsense.org/index.php/OpenBGPD_package">OpenBGPD package</a></li></ul><p>The Cisco CSR 1000v was certainly not the least expensive of the options, but it would allow migrating the existing Cisco ISR configuration with few modifications. Additionally, many carriers, service providers, and network technicians are familiar with Cisco appliances making maintenance and support less of a frustration. Yes, we probably could have gone with VyOS or pfSense but this would introduce a greater level of complexity to migrating the configuration from the Cisco ISRs and few carriers and network engineers would be familiar with the new configurations. In light of the aforementioned points we selected the Cisco CSR 1000v as it made the most sense for this particular client and infrastructure.</p><p><strong><em>The Continuous Delivery Challenge</em></strong></p><p>Now sometimes a Hybrid cloud solution makes sense, or there is no getting around having some infrastructure components on-premises (or in some type of dedicated DC (Data Center)), but this was the clients last hold out on codifying their entire infrastructure. <a href="https://en.wikipedia.org/wiki/Continuous_delivery">CD (Continuous Delivery)</a> can be challenging when it comes to infrastructure but with the proper tools, environment and deployment pipeline its fully attainable. This particular client had already invested early on developing a comprehensive pipeline for their AWS infrastructure deployment. With valuable feedback loops already in place, getting the Cisco CSR1000v AMI into their existing <a href="https://en.wikipedia.org/wiki/Continuous_delivery#Deployment_pipeline">Deployment Pipeline</a> was the goal.</p><p>Before we configured the Cisco CSR1000v we needed to get it into the existing deployment pipeline as an immutable artifact. Rather than spinning up AWS AMI instances and configuring them at launch in production, the goal was to provision, configure and <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html#how-to-create-ebs-ami">snapshot an AWS AMI</a>, creating an immutable artifact/machine image. Creating immutable artifacts in the AWS environment in an automated, codified, and versioned fashion can be simplified using a tool such as <a href="https://www.packer.io/intro/">Packer</a>, which we decided to use with this project. Packer is an open source <a href="https://github.com/hashicorp">HashiCorp</a> tool that automates and simplifies the process of creating machine images for multiple platforms, including AWS. The impetus behind this choice was to help meet the goals of having a completely immutable infrastructure with every artifact a snapshot ready to deploy with easy rollback, versioning, and guaranteed parity across environments.</p><p><strong><em>Creating Immutable CSR 1000V Artifact</em></strong></p><p>Once we had our plan in place for generating the Immutable CSR 1000v artifact, we needed to automate the configuration of the instance prior to snapshotting it as the immutable artifact with Packer. To create the Packer AMI configuration files for the Cisco CSR1000v, we needed to determine how to bootstrap its configuration. The CSR 1000V AMI did not come with <a href="https://aws.amazon.com/cli/">EC2 or AWS API tools</a> available at boot, nor could they be installed since it was not a standard Linux distribution. This made provisioning post boot via execution of shell scripts very messy via SSH since none of the standard Linux shell utilities were present either. In order to provide a configuration made available at boot, we instead used the <a href="http://www.cisco.com/c/en/us/td/docs/routers/csr1000/software/aws/csraws/awsinstall.html#34024">User Data</a> field, which needed to be populated with a series of number indexed commands to be later parsed at boot and loaded into the running-configuration of the CSR 1000V. Below is an example of the syntax needed in the User Data provided.</p><pre>ios-config-1=”username cisco priv 15 pass ciscoxyz”<br>ios-config-2=”ip scp server enable”<br>ios-config-3=”ip domain lookup”<br>ios-config-4=”ip domain name cisco.com”</pre><p>Bootstrapping the needed configuration in this manner presented a few challenges. There were passwords and other secret data that should not be left in source control, so a means of obtaining that data securely was needed. Also, the User Data configuration syntax was non-standard so it needed to be auto generated from a standard Cisco configuration file to ease readability as well as modification and maintenance for administrators. Lastly, the Cisco CSR needed two separate immutable artifacts created: A Primary and a Secondary version that had slightly different configurations. There were minor differences between the Primary and Secondary configurations, so unifying the commonality between them in one standard template configuration file would ease future maintenance and updates to the configuration for both Cisco CSR artifacts. Our typical approach would have been to create just one immutable artifact reconciling the configuration differences and dependencies via User Data in the launch configuration and for sensitive data via <a href="https://github.com/hashicorp/consul-template">consul-template</a> and <a href="https://www.vaultproject.io/?utm_source=Consul+Template">Vault</a>/<a href="https://www.consul.io/">Consul</a>. Unfortunately, the Cisco CSR AMI utilized User Data for configuration in such a way that would have left <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html">sensitive data inside of the launch configuration which is considered bad practice</a>. As a result, we opted for separate immutable artifacts which sped up the boot time of the CSR AMI artifact and avoided exposure of sensitive data inside of the instance User Data.</p><p>To address these challenges the following files are created in the packer AMI cisco directory:</p><ul><li><strong>cisco.json</strong> — The Packer AMI configuration file specifying all the Packer required values for build.</li><li><strong>cisco-config.conf</strong> — A standard Cisco configuration file to be shared for both primary and secondary configuration using template variables for unique values between the two.</li><li><strong>cisco-userdata.json</strong> — A JSON formatted file containing sections for the Primary and Secondary configuration values. The key value pairs used in the JSON file correspond to the Template variables used in the cisco-config.conf file. Since passwords are stored in this file the file will be encrypted, hosted in a secure S3 bucket and fetched by Packer during build for parsing.</li><li><strong>provision-csr.sh</strong> — A shell script that creates two separate base64 encoded User Data files required for the bootstrapping by Packer. While creating each file the script will operate on each line from the cisco-config.conf, reformat the line to the User Data syntax and replace any template variables with their corresponding key values found in the cisco-userdata.json file.</li></ul><p>At this point, we had come up with a deployment plan that allowed for the generation of immutable artifacts during the build phase using Packer. The deployment plan provided secure easy to maintain configuration files versioned in source control, immutable Cisco CSR artifacts, and a solid means for integration into the clients automated deployment pipeline. The client’s AWS infrastructure components, such as their VPC, VPG (Virtual Private Gateway), etc., were all managed using another HashiCorp tool: <a href="https://www.terraform.io/">Terraform</a>. Terraform maintains state information regarding the infrastructure and was being used to store versioned artifacts of the AWS infrastructure state, facilitating easy rollbacks and deployments in the client’s pipeline.</p><p><strong><em>Cisco Configuration Challenges</em></strong></p><p>After we had the immutable artifact plan in place and in the client’s deployment pipeline, we needed to dial in the configuration changes required for the Cisco CSR 1000v for it to actually connect to the M2M VPN network. First thing we needed to do was create the new terraform configurations for the AWS infrastructure components the Cisco CSR depended on listed below:</p><ul><li>The VPC</li><li>The VPG . Which in this case is the Cisco CSR instead of the usual on-premises Cisco ISR.</li><li>The <a href="http://docs.aws.amazon.com/autoscaling/latest/userguide/LaunchConfiguration.html">Launch Configurations and Autoscaling Group</a> which will maintain the desired number of Healthy Cisco CSR instances available. If one fails a new one will be spawned from the saved immutable AMI in the appropriate availability zone.</li><li>The <a href="http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpn-connections.html">VPN Tunnels to the VPG</a> redundant active/active connections from the Cisco CSR to the AWS VPC of backend service nodes.</li><li>The <a href="http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_ACLs.html">Security Groups/Network ACLs</a>, <a href="http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_DHCP_Options.html">DHCP Options</a>, <a href="http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Internet_Gateway.html">Internet Gateway</a> and other VPC related resources for the Cisco CSRs.</li></ul><p><strong><em>Overview of Planned Infrastructure:</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*pvjDy7bp8vaLPWqvT8nHzg.png" /></figure><p>In a follow-up post, I will go into detail regarding the AWS infrastructure deployment and Terraform configurations used to deploy it, but want to first jump ahead to the Cisco configuration details and caveats we encountered. Let’s just assume the entire AWS infrastructure is all setup and was codified with Terraform. The next thing we had to do was get VPN information for the Cisco CSR configuration. The configuration files for the VPN connections needed to be downloaded in <a href="http://docs.aws.amazon.com/AmazonVPC/latest/NetworkAdminGuide/Cisco.html">Cisco ISR 12 format from AWS Web UI</a>. The corresponding VPN files would contain the needed values for connectivity from each CSR to the VPG. Once the VPN configurations were downloaded from AWS, all future deployments would be completely automated since the values for those connections would remain static.</p><p>Since the Cisco CSR would be behind an Internet Gateway in its VPC it would have no interface with its static <a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html">EIP (Elastic IP)</a> so the interface name must be used instead. When the CSR static Elastic IP is referenced inside of the AWS VPN configuration file, it would instead be replaced by “GigabitEthernet1”. This was reflected in the cisco-config.conf where {AWSLocalAddress} and {M2MTunnelSource} were used. In order to keep the Primary Cisco CSR as the preferred path for BGP, the ASN would be prepended but only on the Secondary CSR. To facilitate this, the route-map for the prepend was excluded from the key value pairs in the cisco-userdata.json file.</p><p>There were a couple filters that needed to be added to the Cisco CSR BGP configurations to avoid announcing unneeded networks to the Backend Services VPC and to the M2M wireless network. Both VPN connections used the same BGP ASN so they would pass all routes in both directions. To avoid BGP selecting the M2M tunnel as its best path to the M2M tunnel interface we needed to prevent the Cisco CSR from announcing its default route using a prefix-list. Additionally, the M2M connection announced several networks via BGP that were not needed in the Backend Services VPC routes. To avoid unwanted networks being propagated up to the Backend Services VPC, another prefix list was added. The additional prefix list permitted only the required networks for the Backend services VPC to communicate with the clients on the M2M private wireless network. Below are snippets from the cisco-config.conf where this was applied.</p><p><strong>prefix-list usage</strong></p><pre>address-family ipv4 unicast<br>  ! add each of the lan ips on m2m as /16s<br>   network 10.0.0.0 mask 255.255.0.0 <br>  ! add each of the aws neighbors again<br>  ! aws 1<br>   neighbor {AWSVPGPInsideIP1} activate<br>   neighbor {AWSVPGPInsideIP1} soft-reconfiguration inbound<br>   neighbor {AWSVPGPInsideIP1} prefix-list deny-default in<br>   neighbor {AWSVPGPInsideIP1} prefix-list route-filter out<br>  ! aws 2<br>   neighbor {AWSVPGPInsideIP2} activate<br>   neighbor {AWSVPGPInsideIP2} soft-reconfiguration inbound<br>   neighbor {AWSVPGPInsideIP2} prefix-list deny-default in<br>   neighbor {AWSVPGPInsideIP2} prefix-list route-filter out<br>  ! add the m2m again<br>   neighbor {M2MTunnelRemoteIp} activate<br>   neighbor {M2MTunnelRemoteIp} {M2MTunnelDefaultOriginate}<br>   neighbor {M2MTunnelRemoteIp} prefix-list deny-default in<br> exit<br> exit</pre><p><strong>prefix-list declarations</strong></p><pre>! create prefix lists to prevent default route from m2m and tunnel destinations<br> ip prefix-list deny-default seq 5 deny 0.0.0.0/0<br> ip prefix-list deny-default seq 6 deny {AWSVPGPOutsideIP1}/32<br> ip prefix-list deny-default seq 7 deny {AWSVPGPOutsideIP2}/32<br> ip prefix-list deny-default seq 8 deny {M2MEndPointIP}/32<br> ip prefix-list deny-default seq 10 permit 0.0.0.0/0 le 32<br> ! create prefix lists to prevent un-needed routes from getting to aws<br> ip prefix-list route-filter seq 5 permit 10.0.0.0/16</pre><p>Since the deployment was automated, the DHCP address assigned to the CSR instances would be unknown and was the only interface available on the routers. The problem with this was that we needed to specify a static default route and could not use the interface name since it wasn’t a point to point interface. To specify the default route in the absence of a known interface IP address we used dhcp as the route.</p><pre>ip route 0.0.0.0 0.0.0.0 dhcp</pre><p>An access-list was created to restrict the M2M Crypto map to just the subnet assigned to the Cisco DHCP interface.</p><p><strong>crypto-map match address</strong></p><pre>crypto map {M2MCryptoMapName} 10 ipsec-isakmp<br>  set peer {M2MEndPointIP}<br>  set transform-set {M2MTransformSetName}<br>  match address {M2MGREAclName}</pre><p>Since there were no other networks, an access-list would be specified to simply “permit any” but only be applied when sent to the M2M VPN end point address.</p><p><strong>access-list definition</strong></p><pre>access-list {M2MGREAclName} permit gre any host {M2MEndPointIP}</pre><p><strong>applied to GigabitEthernet1 interface</strong></p><pre>! set the crypto map for the main wan interface<br> interface {M2MTunnelSource}<br>! set the MTU size to 9216 for jumbo frames<br>  mtu 9216<br>  ip nat outside<br>  crypto map {M2MCryptoMapName}</pre><p>So that the M2M private network clients were able to also reach networks outside of the AWS VPC, Network Address Translations were needed. The outside NAT declaration is shown in the above snippet.</p><p>nat inside on m2m tunnel interface</p><pre>! create the tunnel interface for m2m<br> interface {M2MTunnelInterface}<br>  ip address {M2MTunnelLocalIp} {M2MTunnelLocalIpMask}<br>  ip nat inside<br>  tunnel source {M2MTunnelSource}<br>  tunnel destination {M2MEndPointIP}<br>  no shutdown<br> exit</pre><p>nat access-list</p><pre>ip nat inside source list 90 interface {M2MTunnelSource} overload</pre><p>To allow for use of the IOS RestAPI a user should be created and the scp server enabled as well.</p><pre>! turn on scp<br>ip scp server enable<br>! now lets create the restapi user just in case<br>username m2mrapi privilege 15 password {RestAPIUserPass}</pre><p>For monitoring we needed to integrate the CSR instances with the client’s <a href="https://logentries.com/">Logentries</a> service. At the time of this writing, Logentries documentation indicated the <a href="https://logentries.com/doc/cisco/">Cisco Configuration</a> requires the use of separate port numbers for each client with no security or user verification for logs. To work around this limitation and utilize the <a href="https://logentries.com/doc/input-token/">Token Based Input</a>, the token was specified inside of a session-id string on the Cisco instances. This caused the token to be present in the string which is all that was required according to the Logentries documentation.</p><p><strong>logging to logentries using token string verified work around:</strong></p><pre>! set the syslog server connection settings<br> logging trap {SysLogServerTrapLevel}<br> logging facility {SysLogServerFacilityType}<br> logging host {SysLogServerHost} transport {SysLogServerProtocol} port \<br> {SysLogServerProtocolPort} session-id string {SysLogServerTokenString} \<br> sequence-num-session</pre><h4>Autoscaling and Deployment Automation</h4><p>To keep the Cisco instance stack flexible it was placed inside a separate VPC, allowing/requiring it to be connected to the Backend Services stack via VPN Gateway. Since each instance had a static elastic IP, it could be connected to any AWS VPC regardless of region. The Cisco stack Autoscaling group was configured to deliver an SNS notification when they are spawned that would be handled by a Lambda function stack. The Ciscos Autoscaling group was configured to ensure the Primary and Secondary Cisco instances were never on the same Availability Zone. At the time of writing, there were four availability zones in us-east-1 A,C,D,E the Primary and Secondary Cisco instances were restricted to two of the four availability zones respectively. With two availability zones for each Cisco instance we achieved fault tolerance against instance health and availability zone outages.</p><h4>Part 1 — Recap</h4><p>At this point, we have tested the configuration and initial deployment of Cisco CSR 1000V. The configuration has been kept as immutable as possible and codified for automated deployment using Packer and Terraform storing snapshots of the configured CSR’s as AMI Artifacts.</p><p>The CSR 1000V configuration and deployment was only one part of the project. I covered <em>the gotchas</em> but left the Packer and Terraform details for a follow up.</p><p><strong><em>Here is a list of the planned follow-ups to this post:</em></strong></p><p><strong>Cisco CSR 1000V Part 1 </strong>— Configuration Overview &amp; Creation of an Immutable Artifact</p><p>Automated configuration of a pair of Cisco CSR 1000V AMIs for VPN connectivity between AWS VPCS and a Private Network using GRE/IPSEC/BGP. Creating an immutable artifact and incorporating into an existing deployment pipeline.</p><p><strong>Cisco CSR 1000V Part 2 </strong>— Terraform, Packer and Atlas</p><p>Detailing the immutable deployment strategy, configuration, and framework used for automation and high availability.</p><p><strong>Conclusion Part 3 </strong>— Tying it all together</p><p>Tying together the immutable framework solution used for automated deployment.</p><h4>References</h4><p><a href="http://unif.io/"><strong>Unif.io</strong></a><strong> </strong><a href="https://github.com/unifio/?utf8=%E2%9C%93&amp;query=terraform-aws"><strong>Opensource AWS Terraform Modules</strong></a></p><ul><li><a href="https://github.com/unifio/terraform-aws-vpc">terraform-aws-vpc</a> Module stack that supports full AWS VPC deployment. Users can provision a basic VPC with optional support for Availability Zone (AV) provisioning w/configurable subnet and NAT configuration, DHCP Options Set and Virtual Private Gateway creation.</li><li><a href="https://github.com/unifio/terraform-aws-asg">terraform-aws-asg</a> Module stack supporting multiple deployment scenarios of an Auto Scaling Group to an AWS VPC. Each of the generic <a href="https://github.com/unifio/?utf8=%E2%9C%93&amp;query=terraform-aws">Unif.io Terraform modules</a> were <a href="https://www.terraform.io/docs/modules/create.html">nested</a> inside of the projects stack modules as applicable.</li></ul><p><a href="https://www.hashicorp.com/"><strong>HashiCorp Tools</strong></a></p><ul><li><a href="https://aws.amazon.com/marketplace/pp/B00EV8VXG2/">Cisco CSR 1000v</a></li><li><a href="http://www.cisco.com/c/en/us/td/docs/routers/csr1000/software/aws/csraws/awsinstall.html#34024">User Data</a></li><li><a href="https://www.consul.io/">Consul</a></li><li><a href="https://www.vaultproject.io/">Vault</a></li><li><a href="https://github.com/hashicorp/consul-template">consul-template</a></li><li><a href="https://www.vaultproject.io/?utm_source=Consul+Template">Vault with consul-template</a></li><li><a href="https://logentries.com/doc/cisco/">Logentries Cisco Configuration Documentation</a></li><li><a href="https://logentries.com/doc/input-token/">Token Based Input</a></li><li><a href="https://www.hashicorp.com/index.html#products">HashiCorp Tools</a></li><li><a href="https://www.terraform.io/docs/modules/index.html">Terraform Modules</a></li><li><a href="https://www.hashicorp.com/index.html#terraform">Terraform</a></li><li><a href="https://www.hashicorp.com/atlas.html">Atlas</a></li><li><a href="https://www.hashicorp.com/index.html#packer">Packer</a></li><li><a href="https://www.vagrantup.com/">Vagrant</a></li></ul><p><strong>CI Tools and Services</strong></p><ul><li><a href="https://www.atlassian.com/software/bamboo">Bamboo</a></li><li><a href="https://bitbucket.org/">Bitbucket</a></li><li><a href="https://stedolan.github.io/jq/">jq</a></li><li><a href="https://rubygems.org/gems/serverspec/versions/2.30.0">serverspec</a></li></ul><p><strong>Monitoring Tools Services</strong></p><ul><li><a href="https://logentries.com/">Logentries</a></li><li><a href="http://newrelic.com/">New Relic Server Monitoring</a></li><li><a href="https://aws.amazon.com/about-aws/whats-new/2014/07/10/introducing-amazon-cloudwatch-logs/">New Relic AWS Cloudwatch Logs Agent</a></li><li><a href="https://aws.amazon.com/about-aws/whats-new/2014/07/10/introducing-amazon-cloudwatch-logs/">AWS Cloudwatch Logs</a></li></ul><p>Daniel Isaac, Senior Consultant<br>Unif.io, Inc</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/135/1*UmGa1f3KUKQlW9gHNLxtYw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dd18c7646aaa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/unif-io/cisco-csr-1000v-part-1-configuration-overview-creation-of-an-immutable-artifact-dd18c7646aaa">Cisco CSR 1000V Part 1 — Configuration Overview &amp; Creation of an Immutable Artifact</a> was originally published in <a href="https://medium.com/unif-io">Unif.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Migrating to Bamboo Server: Getting the Context Right]]></title>
            <link>https://medium.com/unif-io/migrating-to-bamboo-server-getting-the-context-right-f25b13df0031?source=rss----85dcac172423---4</link>
            <guid isPermaLink="false">https://medium.com/p/f25b13df0031</guid>
            <category><![CDATA[atlassian]]></category>
            <category><![CDATA[build]]></category>
            <category><![CDATA[bamboo]]></category>
            <category><![CDATA[pipeline]]></category>
            <dc:creator><![CDATA[Unif.io]]></dc:creator>
            <pubDate>Tue, 20 Dec 2016 23:07:56 GMT</pubDate>
            <atom:updated>2016-12-20T23:21:14.952Z</atom:updated>
            <content:encoded><![CDATA[<p>As Bamboo Cloud service is nearing end-of-life (Atlassian is <a href="https://confluence.atlassian.com/bamboocloud/bamboo-cloud-eol-827125716.html">discontinuing their Bamboo Cloud</a> offering on January 31, 2017) , Unif.io is converting a customer’s Bamboo Cloud instance to a managed Bamboo Server and build farm at AWS. As we transitioned the server, we came across an issue that we didn’t find a quick solution for online. I’m writing this blog in case anyone else runs into a similar situation.</p><p>We would like to continue having a similar URL in our Bamboo Server instance as we did with Bamboo Cloud which included the ‘builds’ context. The Bamboo URL we want to use is: <a href="https://www.mycompany.com/builds">https://www.mycompany.com/builds</a></p><p>We set this up inside the Host element in the main conf/server.xml file. Here’s how we set it up:</p><pre>&lt;Engine name=”Catalina” defaultHost=”localhost”&gt;</pre><pre>&lt;Host name=”localhost” appBase=”webapps” unpackWARs=”true” autoDeploy=”true”&gt;</pre><pre>&lt;Context path=”<strong>/builds</strong>” docBase=”${catalina.home}/atlassian-bamboo” reloadable=”false” useHttpOnly=”true”&gt;</pre><p>This worked perfectly when we set up a new Bamboo server instance. The site was responsive at <a href="https://www.mycompany.com/builds">https://www.mycompany.com/builds</a>. However, when we created a new instance and imported our data from Bamboo Cloud (see <a href="https://confluence.atlassian.com/migration/bamboo-server">https://confluence.atlassian.com/migration/bamboo-server</a> for the procedure), the site no longer worked. When we went to our URL, we were redirected to: <a href="http://localhost:8085/userlogin!doDefault.action?os_destination=">http://localhost:8085/userlogin!doDefault.action?os_destination=</a></p><p>The issue is that the data that is brought over from Bamboo Cloud is set up to use a Base URL of <a href="http://localhost:8085/">http://localhost:8085</a>. We were setting the context in the applications server.xml file, but the data folder contains the localhost address. This needed to be changed to match that of the URL we want. This can be set within the UI in the Bamboo Administration Page:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*-gcDMpytUjheV1gcrlF8Ag.png" /></figure><p>However, since we cannot log into the Bamboo UI, this needed to be changed in the configuration files before the service is started.</p><p><strong>To update the context of the Bamboo server:</strong></p><ol><li>Modify the &lt;data dir&gt;/xml-data/configuration/administration.xml file.</li><li>Update myBaseUrl to the URL desired for your server. Example: myBaseUrl&gt;https://www.mycompany.com/builds&lt;/myBaseUrl&gt;</li><li>Restart Bamboo service.</li></ol><p>Now you should be able to reach your URL including context: <a href="https://www.mycompany.com/builds">https://www.mycompany.com/builds</a></p><p>Next, you should verify that the server’s address URL is correct in the Administration page under General Configuration:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/952/1*GeCogqZBs928erWdRYxrNQ.png" /></figure><p>That is it. <em>Happy building…</em></p><p>Kathy Jonick, Senior Consultant<br>Unif.io</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/135/1*8n5VTd58Mtx6UINlcePgdw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f25b13df0031" width="1" height="1" alt=""><hr><p><a href="https://medium.com/unif-io/migrating-to-bamboo-server-getting-the-context-right-f25b13df0031">Migrating to Bamboo Server: Getting the Context Right</a> was originally published in <a href="https://medium.com/unif-io">Unif.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Test Driven Development of Infrastructure Code]]></title>
            <link>https://medium.com/unif-io/test-driven-development-of-infrastructure-code-9146d3d6c780?source=rss----85dcac172423---4</link>
            <guid isPermaLink="false">https://medium.com/p/9146d3d6c780</guid>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-testing]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[test-driven-development]]></category>
            <dc:creator><![CDATA[Unif.io]]></dc:creator>
            <pubDate>Tue, 13 Sep 2016 22:00:14 GMT</pubDate>
            <atom:updated>2016-10-22T05:51:27.641Z</atom:updated>
            <content:encoded><![CDATA[<p>Test Driven Development is a concept that has been around software development for quite some time now. Test Driven Development (TDD) is the practice of writing software requirements as test cases. Software is then created to satisfy the tests. Each new requirement is written as a new test, then software is improved to pass these new tests. Kent Beck, who wrote <a href="https://www.amazon.com/Test-Driven-Development-Kent-Beck/dp/0321146530/ref=sr_1_1?ie=UTF8&amp;qid=1472600140&amp;sr=8-1">Test Driven Development: By Example</a>, proposes that this encourages simple designs and inspires confidence.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/461/1*CQPqZEX5xD9MtYnpwdiWbg.png" /></figure><p>But what about Infrastructure Code? This blog will discuss creating a TDD framework for infrastructure code and how it can be implemented using Packer and Serverspec.</p><p>The Massachusetts Institute of Technology says companies need to perform Continuous Innovation to be successful in the current business environment. One way to do this is to reduce the cost of basic operating ingredients. Companies need to adopt rapid provisioning methodologies. IT resources need to be introduced in a matter of minutes, not days or weeks. To do this, organizations need to treat infrastructure as they do software. Infrastructure as Code (IaC) is the concept of codifying your infrastructure via templates and config files. The benefits of doing this is that it is allowing companies to automate building up their IT infrastructure and benefit from software development processes such as requirement definition, version control, continuous integration, and automated testing.</p><p>One tool that companies can utilize in codifying their environments is HashiCorp’s <a href="https://www.packer.io/">Packer</a>. Packer is an open source tool that enables companies to create immutable infrastructure by generating machine images from a configuration file.</p><p>The benefits of using Packer to generate immutable infrastructure are as follows:</p><ol><li>Build once, deploy many times — The generated machine images contain all the software needed to run the application. The same images can be deployed to the development, test, and production environments. Environment specific configuration should be injected when the image is deployed.</li><li>Predictability — As the same image is used in all environments, there is a guarantee that no un-planned changes are introduced into the artifact. Aside from differences in context, the application will be identical.</li><li>Scalability — Since all the software is pre-baked into an image, there are no dependencies when a new instance is deployed. This allows for fast scaling of environments.</li><li>Automatic recovery — By keeping machine images in a versioned repository, it is easy to roll back in the event the application is not working as expected.</li></ol><p>The typical Packer process is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*U1j0udIxDXAUZnO4r8JseA.png" /></figure><ul><li>The Builder phase sets up the machine responsible for yielding the image artifact. There are several platforms available to use — AWS EC2, Vmware, Virtualbox, etc.</li><li>The Provisioners phase encompasses the necessary steps to install and configure software on the builder machine.</li><li>The Post-Provisioners phase encompasses any additional steps done to the image produced by the builder. An example would be the generation and upload of a Vagrant BOX file.</li></ul><p>As previously stated, infrastructure code should follow the same practices as other software projects:</p><ul><li>Requirements for infrastructure updates should be made prior to any source code changes.</li><li>Infrastructure code should be maintained in source control and can follow the same branching strategy as the rest of the organization.</li><li>Continuous Integration should be implemented to build a new machine image when changes are committed to source control.</li><li>Automated testing should be implemented along with the continuous integration build. If following the TDD paradigm, requirements should be written as test cases.</li></ul><p>So what is the best method for testing infrastructure code? At Unif.io, we like to use <a href="http://serverspec.org/">Serverspec</a> for validating server configuration. Serverspec is a Ruby gem that allows you to test the state of a server using Rspec tests. Serverspec does not require any agents to be on the server, which makes it ideal when testing machine images.</p><p>The following sample Serverspec test checks if Apache’s httpd package is installed on the host:</p><pre>require &#39;spec_helper&#39;<br>describe package(&#39;httpd&#39;) do<br>  it { should be_installed }<br>end</pre><p>The earlier in the process that issues can be identified, the cheaper they are to resolve. A strategy of immutability has many advantages, but can also be very time consuming. We wanted to move our testing to the earliest point in the pipeline possible; the image creation phase. To do this, we created a Packer provisioner (<a href="https://github.com/unifio/packer-provisioner-serverspec">Packer Serverspec Provisioner</a>) to integrate Serverspec into the build process. This allows us to run our Serverspec tests during the provisioners phase and prior to image creation. If any of the tests fail, the Packer build will not generate the machine image.</p><p>The Packer process now looks as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*EKjxd2OADcla0pIHOEslUA.png" /></figure><p>An additional provisioners step is added to run the Serverspec tests.</p><pre>{<br>  &quot;provisioners&quot;: [{<br>    &quot;type&quot;: &quot;shell&quot;,<br>    &quot;inline&quot;: [&quot;echo foo&quot;]<br>  },<br>  {<br>    &quot;type&quot;: &quot;serverspec&quot;,<br>    &quot;rake_file&quot;: &#39;Rakefile&#39;,<br>    &quot;rake_task&quot;: &quot;serverspec:{{ user `serverspec` }}&quot;,<br>    &quot;rake_env_vars&quot;: &#39;$BUNDLE_GEMFILE=Gemfile&#39;<br>  }]<br>}</pre><p>During the Packer build, tests are run on the builder machine prior to generating the machine image.</p><p>Say you need to add additional configuration to your image. You would first update the tests with the new requirements.</p><p>For example:</p><pre>require &#39;spec_helper&#39;<br>describe package(&#39;httpd&#39;) do<br>  it { should be_installed}<br>end<br>describe port(80) do<br>  it { should be_listening }<br>end</pre><p>Then re-run the Packer build making configuration updates until all the tests pass. Now repeat…</p><p>By utilizing Packer with Unif.io’s Serverspec plugin, the process of generating and testing machine images can be sped up and lead companies on the path to continuous innovation.</p><p>Unif.io links of interest:</p><ul><li><a href="https://github.com/unifio/packer-provisioner-serverspec">Packer-Provisioner-Serverspec on GitHub</a></li><li><a href="https://circleci.com/gh/unifio/packer-provisioner-serverspec/26#artifacts">Latest Packer-Provisioner-Serverspec binary in CircleCI</a></li><li><a href="https://hub.docker.com/r/unifio/packer/">Docker Container with Packer and Packer-Provisioner-Serverspec on DockerHub</a></li></ul><p><a href="http://unif.io/">Unif.io</a> offers consulting services and DevOps enablement services through our team of expert developers, architects and engineers. If you need additional guidance or want to find out more about our services, contact us at <a href="/service/mailto:contact@unif.io">contact@unif.io</a> or visit <a href="http://unif.io/services">unif.io/services</a>.</p><p>Kathy Jonick, Senior Consultant<br>Unif.io, Inc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/135/1*8n5VTd58Mtx6UINlcePgdw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9146d3d6c780" width="1" height="1" alt=""><hr><p><a href="https://medium.com/unif-io/test-driven-development-of-infrastructure-code-9146d3d6c780">Test Driven Development of Infrastructure Code</a> was originally published in <a href="https://medium.com/unif-io">Unif.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying Consul With ECS]]></title>
            <link>https://medium.com/unif-io/deploying-consul-with-ecs-2c4ca7ab2981?source=rss----85dcac172423---4</link>
            <guid isPermaLink="false">https://medium.com/p/2c4ca7ab2981</guid>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[terraform]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Unif.io]]></dc:creator>
            <pubDate>Fri, 19 Aug 2016 19:22:43 GMT</pubDate>
            <atom:updated>2017-02-06T21:59:22.438Z</atom:updated>
            <content:encoded><![CDATA[<p>The purpose of this post is to expand on some existing information in the community regarding the topic of using HashiCorp’s Consul with Amazon’s Elastic Container Service (ECS). (I continue the series on this topic in <a href="https://blog.unif.io/deploying-consul-with-ecs-part-2-38de98a56611">Deploying Consul with ECS — Part 2</a>)</p><p>If you’ve ever looked into this topic before, you’ve likely come across this article by Matt McClean &amp; Chris Barclay: <a href="https://aws.amazon.com/blogs/compute/service-discovery-via-consul-with-amazon-ecs/">https://aws.amazon.com/blogs/compute/service-discovery-via-consul-with-amazon-ecs/</a></p><p>The article does a nice job of setting the stage for what service discovery is and why you might want it as a supporting service for your ECS based workloads. Additionally, the article includes good sample code for deploying the example scenario described. If you’ve not read it and reviewed the sample code, I would recommend this as a starting point in understanding the architecture and components you will need to configure and deploy.</p><p>Having gone through this exercise recently, there are a few areas that are worth highlighting that will hopefully help save some of you time in getting things deployed in your own environment.</p><h3><strong>The Consul Container</strong></h3><p>Since the article was published, HashiCorp has released an official Docker image that is available on Docker Hub: <a href="https://hub.docker.com/r/hashicorp/consul/">https://hub.docker.com/r/hashicorp/consul/</a></p><p>While an excellent image to simply pull in and start using right away, it additionally serves as an excellent resource on how to build minimal containers and how to manage Consul in a containerized environment. The documentation is very well done and definitely worth the read.</p><p>Some points of distinction for the official Docker image are as follows:</p><ul><li>The image is based on Alpine Linux. If you are unfamiliar with Alpine, it is a very minimal Linux distribution that is ideal for containers due to its small footprint (~ 2 MB). As Consul is written in Go and has no external dependencies, Alpine is an ideal pairing keeping the final image to just 10 MB.</li><li>The image utilizes dumb-init to run as PID 1 in the container to better manage sub-processes.</li><li>The image utilizes gosu for running the Consul process as a non-root user.</li><li>The image has a well featured entry point script for easing configuration at runtime.</li></ul><h3><strong>Consul on ECS</strong></h3><p>While the documentation provided with the official image is fairly comprehensive, it is geared towards environments where setting the container networking to the host mode is possible, which at present is not supported by ECS.</p><p>When running the Consul container on the default bridge network, an additional configuration parameter is required to enable host-to-host gossip between Consul agents. The parameter in question is the <strong>advertise</strong> parameter. It is intended for scenarios where the routable IP to the agent is not discoverable and needs to be manually configured. In the case of the container, we need the IP of the ECS cluster host instead of the container IP on the hosts’ bridge network.</p><p>This step is actually covered in the original article’s sample code, however you need to dig for it a little bit and the requirement is not actually discussed in the article itself.</p><p>The step is captured in the CloudFormation template that deploys the cluster: <a href="https://github.com/awslabs/service-discovery-ecs-consul/blob/master/service-discovery-blog-template">https://github.com/awslabs/service-discovery-ecs-consul/blob/master/service-discovery-blog-template</a></p><pre>&quot;StartContainers&quot;: {<br>    &quot;commands&quot;: {<br>        &quot;01_start_consul_docker_container&quot;: {<br>            &quot;command&quot;: {<br>                &quot;Fn::Join&quot;: [<br>                    &quot; &quot;,<br>                    [<br>                        &quot;docker run -d --restart=always -p 8300:8300 -p 8301:8301 -p 8301:8301/udp&quot;,<br>                        &quot;-p 8302:8302 -p 8302:8302/udp -p 8400:8400 -p 8500:8500 -p 53:53/udp&quot;,<br>                        &quot;-v /opt/consul:/data&quot;,<br>                        <strong>&quot;-h $(curl -s </strong><a href="http://169.254.169.254/latest/meta-data/instance-id"><strong>http://169.254.169.254/latest/meta-data/instance-id</strong></a><strong>)&quot;</strong>,<br>                        &quot;--name consul-server progrium/consul -server -bootstrap&quot;,<br>                        &quot;-dc&quot;,<br>                        {<br>                            &quot;Fn::FindInMap&quot;: [<br>                                &quot;DcMap&quot;,<br>                                {<br>                                    &quot;Ref&quot;: &quot;AWS::Region&quot;<br>                                },<br>                                &quot;Value&quot;<br>                            ]<br>                        },<br>                        <strong>&quot;-advertise $(curl -s </strong><a href="http://169.254.169.254/latest/meta-data/local-ipv4"><strong>http://169.254.169.254/latest/meta-data/local-ipv4</strong></a><strong>)&quot;</strong>,<br>                        &quot;-ui-dir /ui&quot;<br>                    ]<br>                ]<br>            }<br>        }<br>    }<br>}</pre><p>While a valid approach to deploying default services on your cluster hosts, these containers are neither managed nor properly accounted for by the ECS scheduler. This is a problem for centrally managing workloads across the cluster, but more importantly results in inaccurate reporting of resource availability per host.</p><p>A superior approach in my opinion is detailed in the official ECS documentation:</p><p><a href="http://docs.aws.amazon.com/AmazonECS/latest/developerguide/start_task_at_launch.html">http://docs.aws.amazon.com/AmazonECS/latest/developerguide/start_task_at_launch.html</a></p><p>Following this approach, a Consul task is defined in ECS. That task would then be instantiated at boot time of the cluster host using an Upstart service unit (assumes AWS Linux). This does solve the aforementioned problems inherent to running the container on the host directly, but it also introduces a new challenge.</p><p>Unfortunately, the ECS task definition does not support in-line scripting. Primarily this has to do with being agnostic to the configuration of the hosts’ system, but it is also an important security precaution. As a general statement, getting information about the cluster hosts within the containers that are scheduled to run on them can be quite difficult. Ironically, this is exactly the type of scenario one could use Consul to solve.</p><p>While not a universal solution to this obstacle, there is a method of acquiring the required metadata that is unique to the EC2 service. The same mechanism was actually used in the original example above, even though it was not a requirement in that scenario.</p><p>Amazon has their own service registry that in many ways is comparable to Consul. When an EC2 instance is launched, metadata about that instance and its associated resources are registered in this catalog. That metadata can then be leveraged from the host using tools like curl, as demonstrated in the sample code. The only thing that needs to change in the ECS scenario, is that this information needs to be sourced from within the container. As the metadata is contextually specific to the host the container is running on, the logic itself can be generic.</p><p>In order to introduce this capability in to the container, I forked the official container and added some additional logic to the entry point script.</p><pre># Set advertisement and node name for use with AWS ECS<br>if [ &quot;$DEPLOY_TYPE&quot; = &quot;ecs&quot; ]; then<br>  <strong>ADVERTISE_IP=$(wget -qO- 169.254.169.254/latest/meta-data/local-ipv4)<br>  NODE_ID=$(wget -qO- 169.254.169.254/latest/meta-data/instance-id)</strong></pre><pre><strong>CONSUL_AD=&quot;-advertise=$ADVERTISE_IP&quot;</strong><br>  echo &quot;==&gt; Found address &#39;$ADVERTISE_IP&#39; for use with ECS&quot;</pre><pre><strong>CONSUL_NODE=&quot;-node=$NODE_ID&quot;</strong><br>  echo &quot;==&gt; Found name &#39;$NODE_ID&#39; for use with ECS&quot;<br>fi</pre><pre>.<br>.<br>.</pre><pre># Look for Consul subcommands.<br>if [ &quot;$1&quot; = &#39;agent&#39; ]; then<br>    shift<br>    set -- consul agent \<br>        -data-dir=&quot;$CONSUL_DATA_DIR&quot; \<br>        -config-dir=&quot;$CONSUL_CONFIG_DIR&quot; \<br>        $CONSUL_BIND \<br>        $CONSUL_CLIENT \<br>       <strong> $CONSUL_NODE \<br>        $CONSUL_AD \</strong><br>        &quot;$@&quot;</pre><p>As shown above, the DEPLOY_TYPE environment variables needs to be set to a value of <strong>ecs</strong> in the task definition to trigger this logic.</p><p>My modified image can be found at the following location: <a href="https://hub.docker.com/r/unifio/consul/">https://hub.docker.com/r/unifio/consul/</a> (<a href="https://github.com/unifio/docker-consul">https://github.com/unifio/docker-consul</a>)</p><p>The Upstart service unit can be added to the cluster host in several ways depending on your infrastructure strategy. The ECS documentation demonstrates how to inject the logic at instance runtime using user_data.</p><p>I will continue to expand on this topic in the following upcoming posts:</p><ul><li>Consul server deployment with ECS</li><li>ECS immutable AMI build using HashiCorp Packer</li><li>ECS cluster deployment using Terraform</li></ul><p>If you need additional guidance or want to find out more about our services, contact us at at <a href="/service/mailto:contact@unif.io">contact@unif.io</a> or visit <a href="http://unif.io/services">unif.io/services</a>. Unif.io offers consulting services to supplement your team and DevOps enablement services through our team of expert developers, architects and engineers.</p><p>Wilson Carey, CTO<br>Unif.io, Inc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/135/1*MEccfaZNHwzMtvjba8gG3g.jpeg" /><figcaption>Wilson Carey</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2c4ca7ab2981" width="1" height="1" alt=""><hr><p><a href="https://medium.com/unif-io/deploying-consul-with-ecs-2c4ca7ab2981">Deploying Consul With ECS</a> was originally published in <a href="https://medium.com/unif-io">Unif.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Continuous Delivery and Immutable Infrastructure at Whistle Labs]]></title>
            <link>https://medium.com/unif-io/continuous-delivery-and-immutable-infrastructure-at-whistle-labs-23dc32dd0bf9?source=rss----85dcac172423---4</link>
            <guid isPermaLink="false">https://medium.com/p/23dc32dd0bf9</guid>
            <category><![CDATA[atlas]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[immutable-infrastructure]]></category>
            <dc:creator><![CDATA[Unif.io]]></dc:creator>
            <pubDate>Fri, 24 Jun 2016 20:42:09 GMT</pubDate>
            <atom:updated>2016-10-22T05:48:53.894Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>The Challenge: </strong>Whistle, an “Internet of Things” company, acquired Snaptracs in 2015. This acquisition created a more complex ecosystem with multiple devices, applications and infrastructures. They needed a new strategy for maintaining their development agility and the reliability of their services.</p><p><strong>The Solution: </strong>To build a strategy of immutable, codified infrastructure with full deployment automation. This required Unif.io to treat the infrastructure like an application and a variety of technology and services were used to accomplish this.</p><ul><li>After evaluation of our options, we chose a technology for modeling the deployment pipelines of the various services: Bamboo Cloud service</li><li>To manage the immutable datacenter with speed and auditability, we implemented the HashiCorp suite of tools, integrated by the Atlas service.</li><li>The HashiCorp Packer tool was selected for the creation of immutable artifacts. This choice leveraged existing configuration management investments.</li><li>Terraform was selected to provision and maintain the environments as well as deploy immutable artifacts.</li><li>To handle context management and separate data from code, HashiCorp’s Consul product was used as the environment management framework.</li></ul><p>With all the components in place, Whistle was able to establish the pipeline for their environment. The development workflow for all components, infrastructure and applications, was now consistent. The new framework facilitates continuous improvement and experimentation while ensuring the highest quality and reliability of their services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X9QHbRm4Zc0DRPd3FyygkA.png" /></figure><p>View our full case study on <a href="https://static1.squarespace.com/static/5557b5a3e4b07b61460119c5/t/576d8e7ab3db2b92065053d8/1466797690519/Unifio_Whistle+Case+Study_LR.pdf"><strong>Continuous Delivery and Immutable Infrastructure at Whistle Labs</strong></a><strong>.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/110/1*tMr2JvqXT2jHiqgkZA1F5w.png" /><figcaption>Whistle Case Study</figcaption></figure><p>Daniel Isaac, Senior Consultant<br>Unif.io, Inc</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/135/1*UmGa1f3KUKQlW9gHNLxtYw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=23dc32dd0bf9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/unif-io/continuous-delivery-and-immutable-infrastructure-at-whistle-labs-23dc32dd0bf9">Continuous Delivery and Immutable Infrastructure at Whistle Labs</a> was originally published in <a href="https://medium.com/unif-io">Unif.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Becoming a DevOps High-Performer]]></title>
            <link>https://medium.com/unif-io/becoming-a-devops-high-performer-7a2005e86afb?source=rss----85dcac172423---4</link>
            <guid isPermaLink="false">https://medium.com/p/7a2005e86afb</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Unif.io]]></dc:creator>
            <pubDate>Thu, 16 Jun 2016 06:09:11 GMT</pubDate>
            <atom:updated>2016-06-16T06:08:11.806Z</atom:updated>
            <content:encoded><![CDATA[<p>DevOps allows companies to move faster. Faster to push new features into production. Faster to measure customer reactions. Faster to respond. It is no longer the big fish that swallows the small fish. It is the fast fish that eats the slow fish. To paraphrase Jeff Immelt, CEO of GE, “Our biggest fear is being disintermediated by software”. Luckily, large companies can improve their speed and maintain their size advantages. They just need to become DevOps high-performers to match their smaller competitors.</p><p>In business terms, moving faster increases net profit, increases return on investment, and increases cash flow. DevOps is not about hiring more people or acquiring more resources; it is about investing in culture, processes, and automation that help you move faster.</p><p>The most recent <a href="https://puppet.com/resources/white-paper/2015-state-of-devops-report">version</a> of a leading DevOps survey showed that DevOps high-performers share a common set of characteristics including the following:</p><ul><li>High-performers are doing 30x more deployments than their lesser performing peers with 200x shorter deployment lead times.</li><li>They have the ability to create Production environment replicas from source control, a.k.a. Infrastructure-as-Code.</li><li>They are more likely to use a Microservice architecture.</li></ul><p>The results for those who have mastered Continuous Deployment (CD) are more frequent deployment with shorter lead times. CD depends on a deployment pipeline that moves changes from code-commit to code-deploy in the minimal amount of time necessary to validate the stability of those changes. This goes back to the issue of speed to market. Companies that can go from idea to production in a short amount of time can get their latest features to their customers faster. When customers react to those features, for better or worse, the company can respond quickly by pushing new changes through the pipeline to deployment. This feedback loop is key to optimizing your product for your customer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/386/0*Fv_IlbnTATpAJuOH." /><figcaption>Deployment Lifecycle</figcaption></figure><p>Deploying 30x more often than your peers requires the right development culture. You need to be comfortable with deploying to production daily. Manual steps in the pipeline between code-commit and code-deploy need to be eliminated or at least minimized to the point where performing them multiple times per day is not an issue. Reviews and approvals of feature implementation or design need to occur upstream on feature branches before being committed to the main trunk. Organizing your teams to produce product-worthy changes at a regular rate is also part of the required culture, but that is a topic for another time.</p><p>A common fear that comes with adopting CD is that of stability. Changing your production environment more often feels like an additional risk. The survey report, as well as many blog posts from high-performers, indicate the opposite. Increased deployment frequency has a high correlation with deployment success rate and reduced failure recovery time. When you deploy more often you are dealing with smaller change-sets which are easier to debug. You also have a fast pipeline for deploying fixes, and you should have a rollback mechanism to remove the troubled deployment when necessary.</p><p>A successful CD pipeline includes deployment testing in an environment that replicates production. This might be called a Staging environment, or a QA environment, or you may have purposes for both. Other pre-production environments may include one for performance testing. To reduce surprises when deploying to Production, the pre-production environments should be configured exactly as Production. This may sound obvious, but it is surprising the number of deployments where Production is managed differently than the rest. The best method for achieving consistency is by defining your environments in source-control. Each environment is created from code that is versioned in source-control just like your applications. Popular tools such as Terraform and CloudFormation are commonly used today for just this purpose. These tools also give you the ability to create new environments with the push of a button. Developers can pre-validate significant code changes in Development environments that they spin-up for testing. Ops can use this as a disaster recovery tool if environments are compromised or destroyed. It is not surprising that DevOps high-performers use this capability.</p><p>Software architecture can enhance your DevOps capabilities. Architect with testability, deployability, and supportability in mind. Minimizing the friction to test, deploy, and support an application or service optimizes the Continuous Deployment pipeline. This is the reason Microservice architectures are popular with high-performers. Designing your application as a set of microservices means breaking it up into a suite of individually running processes that communicate with each other to satisfy the requirements of the application. This is in stark contrast to the monolithic design where the application is a single process that does everything. The DevOps advantage is that each microservice can be deployed and scaled independently. Code-commits only require a redeployment of a piece of the application — the microservices that were affected. Deploying and validating one or more microservices is faster and less risky than deploying the whole application. It is also easier to rollback when problems do arise.</p><p>Containers are my favorite tool for developing microservices and optimizing the CD pipeline. Containers have been popularized by Docker, and their platform is still the dominant player in the space. Microservice architectures are a perfect fit for containers because containers isolate the process and all of its binary dependencies from the rest of the system. Container interaction is typically through a lightweight protocol system such as HTTP or a shared file storage. This allows the microservices to be deployed independently and scaled independently which is perfect for Continuous Delivery.</p><p>Another significant advantage of containers is the ability to maintain consistency between the developers’ environments and the deployment environments. No more deployment surprises because the Java version used on the production Linux VMs is different than what the developers were using on their PCs, or the developer forgot to tell Ops to add a needed library. The container can be built and verified to work on any platform, and it encapsulates all the binary dependencies required to run the microservice process. Developers are expected to have verified the container build and functionality locally before committing their code. Any additional libraries needed would be included in the container definition as part of the code-commit. This “pushing-left” or “pushing-upstream” of responsibility keeps both developers and Ops happy as well as greasing the wheels of the CD pipeline.</p><p>Keep your customers happy and hold your competitors at bay by continually delivering value to your products at a fast rate. Proper implementation of DevOps practices has been proven to improve speed of delivery which is a major factor in customer retention. Investing in culture, architecture, process, and automation is the path to get there.</p><p>Are you ready to invest in culture, processes and automation to help your company move faster? We’d be happy to talk to you about transforming your company’s culture into a DevOps high-performer. Unif.io has worked with companies large and small to improve their development processes, automate their infrastructure deployments and convert their applications to containers.</p><p>Kevin Jones, Senior Consultant<br>Unif.io, Inc</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/135/1*KiEWELmGHpvFj7IMEwDMzw.jpeg" /><figcaption>Kevin Jones</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a2005e86afb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/unif-io/becoming-a-devops-high-performer-7a2005e86afb">Becoming a DevOps High-Performer</a> was originally published in <a href="https://medium.com/unif-io">Unif.io</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>