<?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[Dockbit - Medium]]></title>
        <description><![CDATA[Stories and product updates from the people behind Dockbit. Deploy together, fearlessly with https://dockbit.com - Medium]]></description>
        <link>https://medium.com/dockbit?source=rss----8c6338a67a8f---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Dockbit - Medium</title>
            <link>https://medium.com/dockbit?source=rss----8c6338a67a8f---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 19:40:30 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/dockbit" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[New in Dockbit: Powered up Docker Provider]]></title>
            <link>https://medium.com/dockbit/new-in-dockbit-powered-up-docker-provider-9b70b009389c?source=rss----8c6338a67a8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/9b70b009389c</guid>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[product]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <dc:creator><![CDATA[Ahmed ElGamil]]></dc:creator>
            <pubDate>Tue, 28 Nov 2017 16:01:02 GMT</pubDate>
            <atom:updated>2017-11-28T16:01:01.809Z</atom:updated>
            <content:encoded><![CDATA[<p>The latest and greatest Docker things to improve your Dockbit pipeline</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FfFaraIU7rcMVm8w_LIBmg.png" /></figure><p>One of the essentials in any DevOps toolbox nowadays is a Docker builder. Ever since we <a href="https://blog.dockbit.com/public-beta-docker-builds-eacfade4a410">released</a> the Docker Provider on Dockbit a few months ago, we’ve had superb feedback on how we can improve the builder for your workflows. Recently, we pushed out support for Docker’s <a href="https://blog.dockbit.com/making-use-of-docker-build-arguments-68792d751f3">Build-time arguments</a>. Today, we’d like to introduce some shiny new additions.</p><h4>Upgraded Docker Daemon</h4><p>We strive to use the latest stable version of the CE (Community Edition) of Docker. At the time of writing, <strong>17.06</strong> is the latest and it comes with <a href="https://blog.docker.com/2017/06/announcing-docker-17-06-community-edition-ce/">a bunch of great features</a> such as multi-stage builds. Whenever you add a Docker stage to your Dockbit pipeline, the image building process starts in an isolated VM supported by Docker daemon 17.06.</p><h4>Multi-tag support for images</h4><p>Image tags are a great way to give human-friendly names to your Docker images and differentiate between them. Teams can use it for naming images after their application version, commit SHA or even the deployment environment. Consider the scenario where you’re building the latest version of your app, here’s how tagging the same image with <a href="https://github.com/moby/moby/pull/15780">multiple tags</a> can come in handy:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9ea86e04d54407329f912d65ff5786e0/href">https://medium.com/media/9ea86e04d54407329f912d65ff5786e0/href</a></iframe><p>In this example, we’re pushing a tag of master as well as updating the latest tag of the Docker image to point to the same image.</p><p>In order to use multiple tags in Dockbit, simply separate the tags with a comma , as a delimiter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JFcB0Iq20YTfdV_TMPOWFw.png" /></figure><h4>Multi-stage builds</h4><p>Along with the introduction of version <strong>17.06</strong> of the Docker daemon, comes <a href="https://blog.docker.com/2017/07/multi-stage-builds/">multi-stage</a> <a href="https://docs.docker.com/engine/userguide/eng-image/multistage-build/">builds</a>.</p><blockquote>One of the most challenging things about building images is keeping the image size down. Each instruction in the Dockerfile adds a layer to the image, and you need to remember to clean up any artifacts you don’t need before moving on to the next layer.</blockquote><blockquote>With multi-stage builds, you use multiple FROM statements in your Dockerfile. Each FROM instruction can use a different base, and each of them begins a new stage of the build. You can selectively copy artifacts from one stage to another, leaving behind everything you don’t want in the final image.</blockquote><p>We wrote a comparison earlier on how we Dockerize <a href="https://github.com/Dockbit/hacher">hacher</a> (A simple CLI tool to cache project artifacts) using both methods. Check it out <a href="https://blog.dockbit.com/making-use-of-docker-build-arguments-68792d751f3">here</a>.</p><h4>Bonus tip: Setting tags dynamically</h4><p>Naturally, every deployment you trigger on Dockbit has unique metadata. Be it the deployment number, Git commit SHA, Git reference, etc. Naming your Docker image tags after one (or a combination) of these metadata can make life a lot easier when tracking software deployments.</p><p>In order to do so, you can simply supply any of <a href="https://docs.dockbit.com/using-dockbit/variables/">Dockbit’s built-in variables</a> as the image tag in the Docker stage configuration. Here’s an example setting an image tag after Git reference (Git tag or branch name):</p><p>dockbit/hacher:${DOCKBIT_DEPLOYMENT_REF}</p><p>Interested in implementing those exciting new things in your pipeline? Don’t forget to check the documentation for the <a href="https://docs.dockbit.com/integrations/docker/">Docker Provider</a>.</p><p><em>Dockbit turns your complex software deployments into simple, manageable workflows. </em><a href="https://dockbit.com/"><em>Sign up now</em></a><em> to get your 2 pipelines for free, connect </em><a href="https://docs.dockbit.com/integrations"><em>dozens of services</em></a><em> together, and kick-off deployments with a single Slack command. </em>🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b70b009389c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dockbit/new-in-dockbit-powered-up-docker-provider-9b70b009389c">New in Dockbit: Powered up Docker Provider</a> was originally published in <a href="https://medium.com/dockbit">Dockbit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploying Elixir applications with Docker]]></title>
            <link>https://medium.com/dockbit/deploying-elixir-applications-with-docker-1e1dd5b39ab9?source=rss----8c6338a67a8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/1e1dd5b39ab9</guid>
            <category><![CDATA[product]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[elixir]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Dockbit]]></dc:creator>
            <pubDate>Thu, 16 Nov 2017 17:25:30 GMT</pubDate>
            <atom:updated>2017-11-17T17:08:46.845Z</atom:updated>
            <content:encoded><![CDATA[<h4>or How to set up a Continuous Delivery pipeline for Elixir</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*id_n1PU4B0Nd2_OKblgBhw.png" /></figure><p><a href="https://elixir-lang.org/">Elixir</a> has been gaining a huge popularity among developers in the past couple of years, pushing it to the 7th most loved language according to <a href="https://insights.stackoverflow.com/survey/2017">StackOverflow</a>. Leveraging the battle-tested <a href="http://www.erlang.org/">Erlang</a> VM, this modern and functional programming language is designed for building highly-performant applications running across multiple cores.</p><p>There are <a href="https://elixir-lang.org/learning.html">plenty of resources</a> to help you learn Elixir, but perhaps, one of the most uncovered (yet not strongly opinionated) topics in the community is how to deploy Elixir applications. Hence, in this post, we want to introduce you the tools used to deploy Elixir applications with <a href="https://www.docker.com/">Docker</a> and how you can set up an automated Continuous Delivery (CD) pipeline.</p><h4>Building releases</h4><p>We’ll be using a basic Phoenix application, which you can <a href="https://github.com/DockbitExamples/phoenix">find on GitHub</a>, however things should be pretty similar for any other Elixir app. The simplest way to run it is to install dependencies with mix deps.get and execute mix phx.server. That’s great while developing, however the most common approach to deploy Elixir applications is to build a release package.</p><p>The release is a precompiled, stripped down and compressed package with everything needed to run in production. So, you don’t need to worry about dependencies and you can deploy it anywhere, as long as the target operating system and architecture match the machine where the release was compiled. Isn’t it handy?!</p><p>There are a number of projects available for packaging and releasing Elixir applications, such as Exrm and <a href="https://github.com/edeliver/edeliver">Edeliver</a>. Exrm has been replaced by <a href="https://github.com/bitwalker/distillery">Distillery</a> and is the preferred way to release Elixir applications today, so that’s the tool we’ll be using here.</p><p>To set it up, just add distillery to your mix.exs and run mix deps.get. You’ll need to have Elixir 1.3+ and Erlang 18+ installed for Distillery to work.</p><pre>defp deps do<br>  [{:distillery, &quot;~&gt; 1.5&quot;, runtime: false}]<br>end</pre><p>Now that we have it installed, we’ll need to configure the release. By simply running mix release.init, Distillery generates the <a href="https://hexdocs.pm/distillery/configuration.html">release configuration</a> file rel/config.exs that defines environments, whether to include system libraries and what version to use.</p><p>Finally, to build the release all we need is to run mix release and we should find dockbit_phoenix_example.tar.gz created under _build/dev/rel/dockbit_phoenix_example/releases/0.0.1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/843/1*M04sLezJINnk9qJp-8Bm8A.png" /></figure><p>Notice though, the default release environment is dev which is good for development, but really we’re building a deployment pipeline for production, aren’t we?</p><p>To build a production release for our example Phoenix app, we’ve introduced config/prod.secret.exs that pulls database configuration from environment variables (see it in <a href="https://github.com/DockbitExamples/phoenix/blob/master/config/prod.secret.exs#L17-L20">this GitHub commit</a>). It’s a good practice to store configs in the environment variables, aka <a href="https://12factor.net/">The Twelve-Factor App</a>. Also, be aware that environment variables need to be present during compile time, as described in the excellent <a href="http://blog.plataformatec.com.br/2016/05/how-to-config-environment-variables-with-elixir-and-exrm/">post by the folks at Plataformatec</a>.</p><p>So, now we can finally build a production release with MIX_ENV=prod mix release. Cool, we have the production release package under _build/prod/rel/dockbit_phoenix_example/releases/0.0.1 and ready to move on.</p><h4>Storing releases</h4><p>In order to deploy a release, inside a Docker container or in any other server environment, we would need to download it from artifcat repository. There are a number of options available: <a href="https://help.github.com/articles/creating-releases/">Github releases</a>, <a href="https://aws.amazon.com/s3/">AWS S3</a>, or hosting them ourselves.</p><p>Since AWS provides a cheap and fast storage with the tooling required to manipulate files, we will be using it with their provided <a href="https://aws.amazon.com/cli/">AWS CLI</a>.</p><p>Assuming you have the AWS CLI properly configured, to upload an Elixir release we can use an aws s3 cp command:</p><pre>aws s3 cp --acl public-read _build/prod/rel/dockbit_phoenix_example/releases/0.0.1/dockbit_phoenix_example.tar.gz s3://dockbitexamples-elixir-phoenix/releases/0.0.1.tar.gz</pre><p>We’ve created a separate dockbitexamples-elixir-phoenix S3 bucket for our releases to be able to fetch them easily with a curl later. Note, we’ve set it to public-read for the sake of simplicity — ideally, you would keep them private and configure AWS credentials as environment variables.</p><h4><strong>Running inside Docker</strong></h4><p>As we have our releases stored in the <em>cloud</em>, we could download them and run on any server, without needing to install any Erlang/Elixir dependencies. The package is self-contained and ready to be deployed.</p><p>To make things ready for a scalable production environment with <a href="https://kubernetes.io/">Kubernetes</a> or Docker Swarm, we will build a Docker image and push it to <a href="https://hub.docker.com/">Docker Hub</a>. Luckily, Docker makes it really easy as we only need a Dockerfile:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fd3237c7a6a2d4af6c217637e8eb996a/href">https://medium.com/media/fd3237c7a6a2d4af6c217637e8eb996a/href</a></iframe><ul><li>Lines 6-12: Sets environment variables such as the port to run and Elixir production environment.</li><li>Line 16: Downloads release from S3 and extracts it.</li><li>Line 25: Launches Elixir app in foreground.</li></ul><p>We could test that our Docker build works with:</p><pre>docker build --no-cache -t dockbit_phoenix_example:latest --build-arg RELEASE=1.0.0 .</pre><p>Notice how we’re using <a href="https://blog.dockbit.com/making-use-of-docker-build-arguments-68792d751f3">Docker build-arg</a> to pass the version of the release we want to run.</p><h4>Setting up a CD pipeline</h4><p>Sounds great, we’ve managed to build our Elixir app release, upload it to AWS S3 and build a Docker image. But hold on, do the architectures of the build and target machines match? Assuming you’ve been using your development machine and it isn’t Debian as defined in the Dockerfile, this Elixir application won’t be able to run. To fix this we’d need a similar build environment.</p><p>Luckily, <a href="https://dockbit.com/">Dockbit</a> (our simple continuous delivery platform for the teams) has <a href="https://docs.dockbit.com/integrations/elixir/">Elixir</a>, <a href="https://docs.dockbit.com/integrations/aws-cli/">AWS CLI</a> and <a href="https://docs.dockbit.com/integrations/docker/">Docker</a> integrations, necessary to set up such an automated pipeline. Let’s see how!</p><p>We’ve created a Dockbit pipeline of 3 stages, where we:</p><ul><li>Compile application, build assets and production release.</li><li>Set version with <a href="https://git-scm.com/docs/git-describe">Git describe</a> and upload it to S3.</li><li>Build Docker image with custom tags and upload them to <a href="https://hub.docker.com/">Docker Hub</a>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8R2cj5eBEOrYarjPK4Dmyg.png" /><figcaption>Dockbit Pipeline for Elixir application</figcaption></figure><p>And here are the corresponding stage configs in Dockbit:</p><p><strong>Compile</strong></p><pre>npm install -g brunch<br>mix compile<br>brunch build --production<br>mix phx.digest<br>mix release --env=prod</pre><p><strong>Upload release</strong></p><pre>VERSION=`git describe --always --tags | cut -c 2-`</pre><pre>aws s3 cp --quiet --acl public-read _build/prod/rel/dockbit_phoenix_example/releases/${VERSION}/dockbit_phoenix_example.tar.gz s3://dockbitexamples-elixir-phoenix/releases/v${VERSION}.tar.gz</pre><pre>echo &quot;Uploaded release to <a href="https://s3.amazonaws.com/dockbitexamples-elixir-phoenix/releases/v$%7BVERSION%7D.tar.gz">https://s3.amazonaws.com/dockbitexamples-elixir-phoenix/releases/v${VERSION}.tar.gz</a>&quot;</pre><p>We’ve also checked <em>Don’t clean</em> for this Dockbit stage, so that it retains artifacts built from the previous step.</p><p><em>You might think, how did Distillery release use the version from Git instead of the default hard-coded one, introduced by the Phoenix app generator. Well, we’ve followed the similar pattern and extracted it from Git describe, which you can see implemented in </em><a href="https://github.com/DockbitExamples/phoenix/commit/4f54c9c6cf10034370b68586cdf5ae5de34a7848"><em>this GitHub commit</em></a><em>.</em></p><p><strong>Build image</strong></p><ul><li>Image: dockbit/dockbit_phoenix_example:$DOCKBIT_DEPLOYMENT_REF,dockbit/dockbit_phoenix_example:latest</li><li>Build arguments: RELEASE=$DOCKBIT_DEPLOYMENT_REF</li></ul><p><em>Notice how our Docker integration can tag an image with dynamic variables available to Dockbit, and have multiple of them separated by a comma.</em></p><p>Additionally, we’ve configured <a href="https://docs.dockbit.com/using-dockbit/variables/">Dockbit environment variables</a> to set <a href="https://hexdocs.pm/mix/Mix.html#module-environments">Mix environment</a> and database credentials we’ve discussed earlier:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QLB-u0g-fk0hA5rgrV8lQg.png" /><figcaption>Dockbit Pipeline environment variables for Elixir application</figcaption></figure><p>Awesome! Now that the Elixir application deployment is ready for production and completely automated, we can safely kick-off our deployments <a href="https://docs.dockbit.com/chats/slack/">from Slack with a Dockbit provided chat bot</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a7ZeSR4mvQ6nrdtqox0cGQ.gif" /><figcaption>Deploying entire CD pipeline from Slack with Dockbit</figcaption></figure><h4>What’s next?</h4><p>You’ve now seen how easy it is to set up a fully-automated Continuous Delivery pipeline with Distillery and Docker, and then power it up with Dockbit’s Slack-first™ deployments. You could even take it to the next level by enabling some of the advanced<a href="https://dockbit.com/features"> Dockbit’s features</a>, such as <a href="https://blog.dockbit.com/smarter-auto-deploys-cccb18a73c65">auto-deployments</a>, <a href="https://blog.dockbit.com/locking-pipelines-with-deploy-locks-794094108cb2">locking</a>, and <a href="https://blog.dockbit.com/reviewing-and-confirming-deployments-cace05d18706">manual confirmations</a>, in order to have a full control over your team’s release process.</p><p>What we’re really missing from this setup, is getting the Docker image from the Hub and pushing it to the Cloud, via some scheduler like Kubernetes, and that’s exactly what will be doing in our future post. For now, keep shipping! 💪</p><p><em>Dockbit turns your complex software deployments into simple, manageable workflows. </em><a href="https://dockbit.com/"><em>Sign up now</em></a><em> to get your 2 pipelines for free, connect </em><a href="https://docs.dockbit.com/integrations"><em>dozens of services</em></a><em>together, and kick-off deployments with a single Slack command. </em>🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1e1dd5b39ab9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dockbit/deploying-elixir-applications-with-docker-1e1dd5b39ab9">Deploying Elixir applications with Docker</a> was originally published in <a href="https://medium.com/dockbit">Dockbit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Canary deployments  for mere mortals]]></title>
            <link>https://medium.com/dockbit/kubernetes-canary-deployments-for-mere-mortals-6696910a52b2?source=rss----8c6338a67a8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/6696910a52b2</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Ahmed ElGamil]]></dc:creator>
            <pubDate>Thu, 12 Oct 2017 16:01:02 GMT</pubDate>
            <atom:updated>2017-10-12T16:01:01.744Z</atom:updated>
            <content:encoded><![CDATA[<h4>And how to rollout software releases safely and surely</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8p-jLv62-RSIrRzkN8M3uA.png" /></figure><p>Canary deployment is a pattern for reducing risk involved with releasing new software versions. The history behind the <a href="https://en.wikipedia.org/wiki/Domestic_canary#Miner.27s_canary">name</a> ain’t really pretty. But in software, releasing canaries can be a strategic tactic for teams adopting continuous delivery practices.</p><p>The idea is that you’ll rollout a new release incrementally to a small subset of servers side by side with its Stable version. Once you test the waters, you can then rollout the changes to the rest of the infrastructure.</p><p>This effectively exposes new versions to a small set of users, which acts as an early indicator for failures that might happen. Canaries are very handy for avoiding problematic deployments and angry users! If one canary deployment fails, the rest of your servers aren’t affected and you can simply ditch it and fix the root cause.</p><p>Historically, implementing Canary deployments was a painful thing to do, especially for small companies. Teams even had to implement techniques such as <a href="https://martinfowler.com/bliki/FeatureToggle.html">Features Toggles</a> in the core of their apps to achieve similar behavior.</p><p>Technologies such as Docker containers 🐳 took us a step forward but we still lacked higher-level tooling for implementing advanced deployment techniques.</p><p><strong>Enter Container Orchestrators and Schedulers</strong> 🚀</p><p>Schedulers and Orchestrators are generally used when you start having a need to distribute your containers beyond a single machine, so it’s yet another management layer on top of sorts. But that’s <a href="https://medium.com/@copyconstruct/schedulers-kubernetes-and-nomad-b0f2e14a896">not necessarily</a> the only <a href="https://jvns.ca/blog/2017/10/05/reasons-kubernetes-is-cool/">reason</a> why you should adopt them.</p><p>Just to name a few, here are some benefits you get “for free” by simply adopting a Scheduler for your containers: Self-healing, horizontal scaling, service discovery, load distribution, deployment management and a ton more.</p><p>This is a huge win already. If you’re shipping software in Docker images today, one of the features that will be immensely helpful in your daily workflow is the management of container deployments. Gone are the days where you have to manually orchestrate pulling new versions of Docker images on different nodes and restarting services. An orchestrator can distill that to a one-liner for you.</p><p>While there is a plethora of options in the market: <a href="https://docs.docker.com/engine/swarm/">Docker Swarm</a>, <a href="https://www.nomadproject.io/">Hasicorp Nomad</a>, <a href="https://mesosphere.github.io/marathon/">Marathon</a>; one Scheduler that truly focuses on making Docker container deployments repeatable and streamlined is <a href="http://kubernetes.io/">Kubernetes</a>.</p><p>Kubernetes (k8s for short) awesomesauce lies in the fact that it provides advanced deployment techniques off the shelf. Lots of scenarios are supported with no or minimal hacking. Now yes, you do have to encapsulate your software inside Docker images and setup your Kubernetes objects (Pods, ReplicaSets, Deployments, etc..), but you get so much back for your investment.</p><h3>brendandburns on Twitter</h3><p>@copyconstruct strongest argument is making it easier to repeatedly and reliably deploy your software. that&#39;s a scale independent need.</p><h3>brendandburns on Twitter</h3><p>@copyconstruct those ops folks will have to much of the same work to implement safe rollout and reliable software that k8s provides 4 free</p><p>Seeing Canary deployments in action is way more exciting than talking about them, so let’s get our hands dirty and dig into an example setup on top of k8s.</p><h3>Overview</h3><p>So here’s the master plan: First of all, we need a k8s cluster to work with. A Kubernetes cluster is composed of a dozen or so <a href="https://kubernetes.io/docs/concepts/overview/components/">components</a>. In order to bootstrap things quickly, we’ll focus on automation tools for creating the cluster instead of creating it <a href="https://github.com/kelseyhightower/kubernetes-the-hard-way">the hard way</a>.</p><p><a href="https://github.com/kubernetes/minikube">Minikube</a> shall serve you extremely well for local testing. To get a more realistic setup, we’ll be working with <a href="https://cloud.google.com/container-engine/">Google Container Engine</a> (GKE) which is powered by k8s. It’ll take care of setting up instances on <a href="https://cloud.google.com/">GCP</a>, installing all of the k8s components as well as handle initial configuration.</p><p>Deployment to k8s requires that our apps are packaged in container format. For this walkthrough, we’ll be using the <a href="https://www.docker.com/">Docker</a> runtime. Both versions of the sample app (Stable and Canary) will be packaged up in Docker images with distinct versions as <a href="https://docs.docker.com/engine/reference/commandline/tag/">Docker image tags</a>.</p><p>We’ll start first with a simple setup for the rollout of a Canary release on k8s then upgrade it to use more tricks.</p><h3>Phase 0: Prepping the Environment</h3><p>Here’s what you need to get started with k8s on GCP:</p><ul><li><a href="https://console.cloud.google.com/cloud-resource-manager">Select or create</a> a project. This separates all of the resources used so that it’s easier to clean things up later.</li><li><a href="https://support.google.com/cloud/answer/6293499#enable-billing">Enable billing</a> for the project.</li><li><a href="https://console.cloud.google.com/flows/enableapi?apiid=compute_component,container">Enable APIs</a> for Compute Engine and Container Engine. Those shall allow us to access the resources needed using the <a href="https://cloud.google.com/sdk/gcloud/">gcloud</a> CLI tool.</li><li>If you haven’t already, install the latest version of <a href="https://cloud.google.com/sdk/docs/#install_the_latest_cloud_tools_version_cloudsdk_current_version">gcloud</a>. Alternatively, you can use <a href="https://console.cloud.google.com/?cloudshell=true">Cloud Shell</a>.</li><li>Finally, install kubectl by executing gcloud components install kubectl.</li></ul><p>Next, we can proceed by creating a <a href="https://cloud.google.com/container-engine/docs/concepts/cluster-architecture">Container Engine Cluster</a>. The cluster consists of at least one master and multiple worker machines, which will be created for us automagically.</p><ul><li>Grab the <a href="https://support.google.com/cloud/answer/6158840?hl=en">Project ID</a> and store it in a variable: export PROJECT_ID=&lt;ID&gt;.</li><li>Set the Project to use: gcloud config set project $PROJECT_ID.</li><li>Set the default Compute Engine zone, for example: gcloud config set compute/zone us-east1-d.</li><li>At last, create the Container Cluster, we’re calling it canary here: gcloud container clusters create canary.</li></ul><p>If things go according to the plan, you’ll be able to get the k8s components endpoints by executing: kubectl cluster-info.</p><p>The code/configuration used in the upcoming material is available in a GitHub repository:</p><p><a href="https://github.com/DockbitExamples/kubernetes">DockbitExamples/kubernetes</a></p><h3>Phase 1: The App</h3><p>First of all, we need an app to deploy! For the sake of this post, we created a simple Go app. Go programs compile into self-sufficient portable binaries, so they are perfect for baking inside a Docker image.</p><p>The same approach will work with any other tech stack that can be packaged in a Docker container. Be it a language that needs compilation such as <a href="https://elixir-lang.org/">Elixir</a> or even interpreted languages such as <a href="http://ruby-lang.org/">Ruby</a> or <a href="https://www.python.org/">Python</a>. Just that you need to include the code itself rather than the artifact in the latter case.</p><p>The app prints out the version deployed as well as some operational requirements:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d34ad81569c3cc110d933e32e7b13473/href">https://medium.com/media/d34ad81569c3cc110d933e32e7b13473/href</a></iframe><p>Lines 8–10: Stores the version of the application in a constant named version and prints it out via Go’s <a href="https://golang.org/pkg/net/http/">http package</a>. Notice that version is set to 1.0, which shall be the first “stable” version we’ll bake inside the Docker image later.</p><p>Lines 14–15,24: Acts as a health check, if a request hits /health, the app will respond with HTTP 200.</p><p>Lines 18–20,25: Exposes an endpoint at /version which returns the version of the application currently deployed. This will make it easier later to confirm which version of the app is running on k8s.</p><p>Line 26: Finally, we listen on port 8080 for any incoming HTTP requests.</p><p>Now we can proceed to compile the app by building the binary:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/32ab3cf955c26f7c625b8d49115ae39e/href">https://medium.com/media/32ab3cf955c26f7c625b8d49115ae39e/href</a></iframe><p>You’ll notice that the netgo build tag is used. This helps to produce a static binary by substituting system’s libc for Go’s netgo library.</p><p>In case you don’t have Go’s build setup locally, you can use the pre-built binaries located <a href="https://github.com/DockbitExamples/kubernetes/tree/master/source">here</a>. A downloadable version of version 1.0 is available via <a href="https://github.com/DockbitExamples/kubernetes/blob/master/source/1.0/app?raw=true">this link</a>.</p><p>Moving forward, we’ll need to encapsulate the Go binary into a Docker image that we can later deploy to k8s.</p><h3>Phase 2: The Docker Image 🐳</h3><p>Wrapping up the Go artifact in a Docker image is straightforward. It’s just about copying the binary into the image.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ab10494ff08d78e7e305c4edecca1f2c/href">https://medium.com/media/ab10494ff08d78e7e305c4edecca1f2c/href</a></iframe><p>You’ll notice that we are using Docker <a href="https://blog.dockbit.com/making-use-of-docker-build-arguments-68792d751f3">build-time arguments</a> to specify which version of the app to package inside the image.</p><p>Since our k8s setup is on top of <a href="https://cloud.google.com/">GCP</a>, we can utilize <a href="https://cloud.google.com/container-registry/">Google Container Registry</a> (GCR for short) for storing the images. The URLs change based on the <a href="https://support.google.com/cloud/answer/6158840?hl=en">project ID</a> we set earlier.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/40d4a0e1cb98b042ce16fe27681cda6b/href">https://medium.com/media/40d4a0e1cb98b042ce16fe27681cda6b/href</a></iframe><p>One of the great things about Container Engine is that it’ll automatically pre-configure the Docker registry credentials on the k8s worker nodes. So k8s will have access to the images in GCR out of the box.</p><p>By this point, we have an app that is properly packaged in a Docker image that k8s can consume and deploy. Time to dive headfirst into some Kubernetes.</p><h3>Phase 3: Deploying Stable to k8s</h3><p>There are some k8s terms that we need to be familiar with before we dig into the code. First and foremost: <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/">Pods</a>.</p><blockquote>A Pod is the basic building block of Kubernetes–the smallest and simplest unit in the Kubernetes object model that you create or deploy. A Pod represents a running process on your cluster.</blockquote><blockquote>A pod (as in a pod of whales or pea pod) is a group of one or more containers (such as Docker containers), with shared storage/network, and a specification for how to run the containers. A pod’s contents are always co-located and co-scheduled, and run in a shared context</blockquote><p>In practice, you mostly care about defining the ‘specs’ of your Pods. Those can include which container image to use, health checks, what command to run inside the Pod, which port to expose, etc. For most workloads, you’ll have multiple instances of the same Pod where the workload will be distributed across them using some form of load balancing, which brings us to the concept of ReplicaSets.</p><p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/">ReplicaSets</a> (RS for short) ensures that a specific number of pod replicas are running at any one time. You simply tell k8s that you need an x number of replicas of some Pod and it’ll make sure that the exact same number is always alive according to the Pod’s <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/">lifecycle</a>.</p><p>When it comes to writing k8s configuration though, you rarely have to define ReplicaSets but rather use <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/">Deployments</a>.</p><blockquote>A Deployment is a higher-level concept that manages ReplicaSets and provides declarative updates to pods along with a lot of other useful features</blockquote><blockquote>You describe a <em>desired state</em> in a Deployment object, and the Deployment controller changes the actual state to the desired state at a controlled rate. You can define Deployments to create new ReplicaSets, or to remove existing Deployments and adopt all their resources with new Deployments.</blockquote><p>Here’s an example of defining a k8s Deployment that uses the Docker image we’ve built earlier:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6137d18885e607b4e79995590234bdbe/href">https://medium.com/media/6137d18885e607b4e79995590234bdbe/href</a></iframe><p>Lines 1–2: The kind of Kubernetes <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/">Object</a> we want to create and which API version to use for creation.</p><p>Lines 3–4: Metadata to uniquely identify the Object.</p><p>Lines 5–12: Represents the beginning of a <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/#pod-templates">Pod Template</a>.</p><blockquote>Pod templates are pod specifications which are included in other objects.</blockquote><blockquote>Rather than specifying the current desired state of all replicas, pod templates are like cookie cutters. Once a cookie has been cut, the cookie has no relationship to the cutter.</blockquote><p>In this example, we are configuring a template to have 3 copies/replicas of the same container, as well as attaching some <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/">Labels</a> that can be used to reference the Deployment object. One important label in this setup is app: kubeapp. By setting the application name to be attached to the Pods, we can then point to the Pods later from a load balancer for instance.</p><blockquote><em>Labels</em> are key/value pairs that are attached to objects, such as pods. Labels can be used to organize and to select subsets of objects.</blockquote><p>Lines 13–25: Defines the specs of the containers that k8s will run in Pods as part of the ReplicaSet.</p><ul><li>The containers are based off the Docker image gcr.io/PROJECT_ID/app:1.0 which is stored in GCR. Where PROJECT_ID shall be evaluated as demonstrated below.</li><li>imagePullPolicy tells k8s to always pull the image from the Docker registry in case a newer image was pushed with the same tag.</li><li>readinessProbe defines a health check to run against the Pod (calling /health on port 8080 in this case).</li><li>command sets the command to run in the container once it launches. Here we point to the location of the Go binary at /app.</li><li>ports open port 8080 so that the container can accept and send traffic.</li></ul><p>Before we proceed to execute the Deployment, we need to parse PROJECT_ID, we can use good old sed for that:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/52d244591012e8e146a203845e555a77/href">https://medium.com/media/52d244591012e8e146a203845e555a77/href</a></iframe><p>It’s also a good idea to create a k8s <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/">Namespace</a> for the Deployment to reside in. Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces.</p><p>One example where Namespaces fits very nicely is deployment environments. So you can end up with a Namespace for production and another one for staging in the exact same k8s cluster. Here’s how to create a Namespace:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/177d42e2c179274bdcc5439929862db2/href">https://medium.com/media/177d42e2c179274bdcc5439929862db2/href</a></iframe><p>Now we can finally proceed by rolling out the Deployment 🚀</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4c5d42fb56ca9498eb5dafa64b3b88e3/href">https://medium.com/media/4c5d42fb56ca9498eb5dafa64b3b88e3/href</a></iframe><p>Notice how we need to specify which Namespace to use. All k8s resources created via the Deployment will reside in the production Namespace. So in order to access them, we need to always add the--namespace argument. We can check the progress of the rollout via the rollout status command:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/77a8f9b9c5a0ebc1f99c45041b7d447b/href">https://medium.com/media/77a8f9b9c5a0ebc1f99c45041b7d447b/href</a></iframe><p>Yay! 😁</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*uTbW1iR_rMyH422AXvYCgg.gif" /><figcaption>Chuck-approved deployment!</figcaption></figure><p>The get command can be used to pull information about all k8s Objects. To get the list of Pods created as a result of the Deployment, we can run:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/1817806c079b858aa4bc515a51228964/href">https://medium.com/media/1817806c079b858aa4bc515a51228964/href</a></iframe><p>Looking closely, you’ll find that k8s distributed the Pods across 3 worker <a href="https://kubernetes.io/docs/concepts/architecture/nodes/">Nodes</a>.</p><p>Another command that can also be very useful is get events. This extracts a stream of events from k8s controllers which can be handy for troubleshooting and seeing what happens under the hood.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/3e57b1000bafd848b10f7513252d70a0/href">https://medium.com/media/3e57b1000bafd848b10f7513252d70a0/href</a></iframe><p>By this point, 3 copies of the application are up and listening on port 8080 for incoming connections. But we are missing the final component to complete the setup which will allow us to access the app: A load balancer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QZMJoE5e7sooxAa2KhrI8g.png" /></figure><p>k8s has support for creating cloud-native load balancers (LB for short). It does so by creating a load balancer (think <a href="https://cloud.google.com/load-balancing/">GCP LB</a> or <a href="https://aws.amazon.com/elasticloadbalancing/">AWS ELB</a>) as a <a href="https://kubernetes.io/docs/concepts/services-networking/service/">Service</a>. In practice, Services can mean different things. The main difference between Pods and Services is that Pods are mortal (so if they respawn, network addressing can change), Services on the other hand, can be identified by attaching <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/">Labels</a> to them for later reference with no worries about addressing.</p><p>Here’s how to define a load balancer as a Service that points to the Pods created earlier:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/05db7c0cec5bb2e3e4851caf1de922f3/href">https://medium.com/media/05db7c0cec5bb2e3e4851caf1de922f3/href</a></iframe><p>Lines 1–4: Specifies that we are creating a k8s <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/">Object</a> of type Service, using k8s API version 1 along with metadata.</p><p>Line 6: Sets the <a href="https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services---service-types">ServiceType</a> to be a load balancer. This exposes the service externally using the cloud provider’s load balancer. In our case, that will create <a href="https://cloud.google.com/load-balancing/">GCP Load Balancer</a> and automagically create all routing necessary to connect the workloads running inside the Pods to the external world via LB.</p><p>Lines 7–11: Represents LB configuration. In this case, LB is listening on port 80 directing the requests to TCP port of 8080 on the backend.</p><p>Lines 12–13: Introduces us to yet another important k8s concept: <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/">Selectors</a>. They work in conjunction with Labels to identify and group k8s Objects. Earlier, we assigned the label of app: kubeapp to our Pods. In the LB definition, we can simply use a selector on the very same label so that the LB can auto-discover which Pods it can direct traffic for.</p><p>Creating the LB uses the same apply command that we used earlier for creating the Deployment:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/dc437ae7aba4441a50bef87205a77ec6/href">https://medium.com/media/dc437ae7aba4441a50bef87205a77ec6/href</a></iframe><p>Cloud LBs are created asynchronously, once it is done, you can grab the public IP addresses of the LB using the get command:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9233fa5044cc974f4998a25be4c2f753/href">https://medium.com/media/9233fa5044cc974f4998a25be4c2f753/href</a></iframe><p>We can also extract the IP address of the LB using this one-liner 👉</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/bc3c4743e80ec3708b301d801986c675/href">https://medium.com/media/bc3c4743e80ec3708b301d801986c675/href</a></iframe><p>Awesome! Version 1.0 (stable) of our app has been deployed 🙌. Two k8s config files and a handful of commands took our Docker image, deployed 3 distributed containers, created a LB and connected things together, not bad at all!</p><h3>Phase 4: Deploying Canary to k8s 🐤</h3><p>Now that we have the stable version deployed to the cluster, we can dig into deploying a Canary release. Let’s name it 2.0, we’ll be following a similar flow. The difference between 1.0 and 2.0 will only be the value of the Go <a href="https://github.com/DockbitExamples/kubernetes/blob/master/source/2.0/app.go#L8">constant</a>.</p><ul><li>Build Go binary for 2.0 (or download a pre-built binary <a href="https://github.com/DockbitExamples/kubernetes/blob/master/source/2.0/app?raw=true">here</a>).</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/32ab3cf955c26f7c625b8d49115ae39e/href">https://medium.com/media/32ab3cf955c26f7c625b8d49115ae39e/href</a></iframe><ul><li>Build and push Docker image for 2.0.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/93b93ac75585b574fb201bb3d7af084f/href">https://medium.com/media/93b93ac75585b574fb201bb3d7af084f/href</a></iframe><ul><li>Rollout the Canary release by applying a slightly different k8s configuration than the one we had for Stable:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/353c4d74f01b911767f68f2e3e1ad019/href">https://medium.com/media/353c4d74f01b911767f68f2e3e1ad019/href</a></iframe><p>Let’s highlight the differences:</p><p>Lines 4, 12: Unique metadata to distinguish the Canary Deployment from Stable. Notice how the label named env is different but both Stable and Canary share the same value of kubeapp for the app label.</p><p>Line 6: Sets the numbers of replicas we want for the Canary release. This is important since it controls the ratio/percentage of how much of our users are going to hit the Canary release. In this case, we have a <a href="https://github.com/DockbitExamples/kubernetes/blob/master/k8s/lb/app-production.yml#L6">3</a>:<a href="https://github.com/DockbitExamples/kubernetes/blob/master/k8s/lb/app-canary.yml#L6">1</a> ratio for stable:canary, so 25% of requests hitting the load balancer will get the Canary release.</p><p>We don’t need to do any changes to the LB since it already has a <a href="https://github.com/DockbitExamples/kubernetes/blob/master/k8s/lb/app-lb.yml#L12-L13">selector</a> applied to the label app: kubeapp which spans across both deployments (Stable and Canary). So Pods launched via the Canary Deployment will auto-join the LB.</p><p>It’s time to release the Canary 🐤</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b8bf2d2fb1d50cf969f9dcb7e6c1722b/href">https://medium.com/media/b8bf2d2fb1d50cf969f9dcb7e6c1722b/href</a></iframe><p>We can simulate users hitting the app by executing curl in for loop over the previously set SERVICE_IP:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d9b3197c6289034d713465d73ad9d6a5/href">https://medium.com/media/d9b3197c6289034d713465d73ad9d6a5/href</a></iframe><p>Once 2.0 is tested and approved, we can proceed by switching the Docker image used in <a href="https://github.com/DockbitExamples/kubernetes/blob/master/k8s/lb/app-production.yml#L16">app-production.yml</a> to 2.0 and then simply re-apply the configuration. Another route would be to save the image used directly to the k8s API:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cd36d46dcf1f887017a52f418da12535/href">https://medium.com/media/cd36d46dcf1f887017a52f418da12535/href</a></iframe><p>This will instruct k8s to launch new pods while terminating the old ones. By this point, you don’t really need the Canary deployment. You can go ahead and delete it by executing kubectl --namespace=production delete deployment/kubeapp-canary.</p><p>Once you start testing the Canary release, one problem you’ll bump into pretty fast is that the LB might start switching your session between both versions, making it pretty hard to test 2.0 separately. Also, implementing operational requirements like SSL termination or routing rules isn’t really feasible with the LBs that k8s offers.</p><p>Enter <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#what-is-ingress">Ingress resources</a>.</p><h3>Phase 5: Using Ingress resources to access Canary Deployments</h3><blockquote>An Ingress is a collection of rules that allow inbound connections to reach the cluster services.</blockquote><blockquote>It can be configured to give services externally-reachable URLs, load balance traffic, terminate SSL, offer name based virtual hosting, and more.</blockquote><p>Ingress resources are provided in k8s by an <a href="https://github.com/kubernetes/ingress-gce#what-is-an-ingress-controller">Ingress Controller</a>. Those controllers abstract away the inner workings of the backend software used for implementing advanced load balancing (could even be <a href="https://github.com/kubernetes/ingress-nginx">nginx</a>, <a href="https://github.com/kubernetes/ingress-gce">GCE LB</a>, HAProxy, etc) and let us focus on the routing rules.</p><p>The Ingress Controller is not usually created automatically in the initial cluster creation, though the cool thing is that they can be deployed as k8s Pods. As for the <a href="https://cloud.google.com/container-engine/">GKE</a> setup we have in place, it is actually <a href="https://github.com/kubernetes/ingress-nginx/blob/master/docs/faq/gce.md">already there</a>, so we can jump right into how to use Ingress resources.</p><p>Our goal with Ingress resources would be to split the traffic of the Canary deployment to be accessible on a subdomain. This will make it way easier to test the Canary release separately from the Stable copy.</p><p>Let’s assume that the Stable version is accessible at http://foo.bar and the Canary deployment is at http://canary.foo.bar. You’ll need to add records for those domains in your local resolver (a.k.a: /etc/hosts), directing traffic to the public IP of the Ingress resource.</p><blockquote>Before you execute the commands in the next section, you might need to delete the resources created earlier. Ditching the Namespace and recreating it could be achieved by this task: kubectl delete namespace production &amp;&amp; kubectl create namespace production</blockquote><p>Let’s start by exploring what changes we need to do in the Deployment itself:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/12e7dbea4d4e45ebaeec4c39eaf05858/href">https://medium.com/media/12e7dbea4d4e45ebaeec4c39eaf05858/href</a></iframe><p>The Deployment object is as is, nothing new here. New config lies in the 2nd section (Starting line 27). Here we are basically publishing the Pods created by the Deployment via a k8s Service of type NodePort.</p><blockquote>Kubernetes master will allocate a port from a flag-configured range (default: 30000–32767), and each Node will proxy that port (the same port number on every Node) into your Service.</blockquote><p>Our Deployment is exposing port 8080, so the Service points to that port and exposes port 80 on the Nodes themselves. Ingress resources can’t talk to the Deployment object directly, but rather need a Service to publish the Deployment first.</p><p>Similarly to what we did previously, here goes the flow for rolling out the Deployment + Service combo:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e07b9aaa101096112b0823f9f8d7a305/href">https://medium.com/media/e07b9aaa101096112b0823f9f8d7a305/href</a></iframe><p>Querying the k8s API shall show us that Pods are collectively exposed as a Service that listens on an internal IP address. This is also done by the means of a <a href="https://github.com/DockbitExamples/kubernetes/blob/master/k8s/ingress/app-production.yml#L39-L41">Selector</a> that points to the Label used in the Pods <a href="https://github.com/DockbitExamples/kubernetes/blob/master/k8s/ingress/app-production.yml#L10-L12">template</a>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ec907f4be5c95f316e070b2c3384eca6/href">https://medium.com/media/ec907f4be5c95f316e070b2c3384eca6/href</a></iframe><p>Once the Service is published, we can start creating our Ingress resources. Below we are defining a minimal resource:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a337b816b0b2c5c5240bf36ea77fde35/href">https://medium.com/media/a337b816b0b2c5c5240bf36ea77fde35/href</a></iframe><p>As with all other k8s Objects, type is set to Ingress along with metadata. Ingress resources need to be aware of which backends to route requests to, we only have one backend here pointing to the Service defined earlier.</p><p>In this situation we are not listing any routes which mean that this will represent the <em>default backend</em>, all requests shall go to this backend. Once the healthchecks on the backend starts reporting HEALTHY, we can hit the Ingress address and start testing our setup.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7a208cb58d8b78703edf68f19103094e/href">https://medium.com/media/7a208cb58d8b78703edf68f19103094e/href</a></iframe><p>Take note of line 16, we need to wait for the backends to report <strong>HEALTHY</strong> before we’re able to access the Ingress resource IP address.</p><p>The Canary release is very similar to Stable. The only difference would be the number of <a href="https://github.com/DockbitExamples/kubernetes/blob/master/k8s/ingress/app-canary.yml#L6">replicas</a>, the Docker image to use (<a href="https://github.com/DockbitExamples/kubernetes/blob/master/k8s/ingress/app-canary.yml#L16">2.0</a> in our case) and related metadata. Rolling the deployment can be done using the usual flow:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/95a47bd9f07ea08672861728dff9c133/href">https://medium.com/media/95a47bd9f07ea08672861728dff9c133/href</a></iframe><p>For us to be able to access the Canary release on a separate subdomain, we need to add some Ingress routes that point to the Canary <a href="https://github.com/DockbitExamples/kubernetes/blob/master/k8s/ingress/app-canary.yml#L27-L41">Service</a>. The approach we’re using here is name-based virtual hosting, where the Ingress resource will check the <a href="https://tools.ietf.org/html/rfc7230#section-5.4">host header</a> and judge which service it should send the traffic to.</p><pre><strong>foo.bar        --|                 |-&gt; kubeapp-production-service 80<br>                 |   Ingress IP    |<br>canary.foo.bar --|                 |-&gt; kubeapp-canary-service     80</strong></pre><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/22c6c8b414bb1e093121f38bd76080a7/href">https://medium.com/media/22c6c8b414bb1e093121f38bd76080a7/href</a></iframe><p>Lines 6–8: Sets a default backend. This will match any requests that lands on the IP address of the Ingress with no host headers set, directing it to the production Service that containers the production Pods.</p><p>Line 9: Starts a section for the Ingress resource rules.</p><p>Lines 10–15: Matches the domain canary.foo.bar and directs the traffic to the k8s Service named <a href="https://github.com/DockbitExamples/kubernetes/blob/master/k8s/ingress/app-canary.yml#L27-L41">kubeapp-canary-service</a> on port 80.</p><p>Lines 16–21: Does the same for the main domain we’re using for our Service foo.bar.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/50ecb7bc9908a26c35bbdfacbf13651d/href">https://medium.com/media/50ecb7bc9908a26c35bbdfacbf13651d/href</a></iframe><p>This technique is very useful for testing a Canary release in production environments without affecting the Stable version being consumed by your users. The same Ingress routes can be modified to work on different URL paths on the same domain instead of using vhosts (a.k.a <a href="https://kubernetes.io/docs/concepts/services-networking/ingress/#simple-fanout">fanout</a>).</p><p>Promoting the Canary version to production can be executed using the same flow discussed earlier: Either use set image or modify the Docker image to use in the <a href="https://github.com/DockbitExamples/kubernetes/blob/master/k8s/ingress/app-production.yml#L16">production config</a>.</p><p>So here you go, putting a Canary deployment setup on top of k8s isn’t that hard after all. Things can even be further developed with <a href="http://blog.kubernetes.io/2017/04/multi-stage-canary-deployments-with-kubernetes-in-the-cloud-onprem.html">Multi-stage Canary deployments</a> and more refined control of <a href="https://istio.io/blog/canary-deployments-using-istio.html">traffic weight</a>.</p><h3>Conclusion</h3><p>Kubernetes is a gigantic project that allows companies of all shapes and sizes to adopt the infrastructure fabric that used to be only available to large corps (k8s is inspired by <a href="http://blog.kubernetes.io/2015/04/borg-predecessor-to-kubernetes.html">borg</a> after all). Best of all, the effort needed to implement similar setups is relatively easy compared to other systems.</p><p>This post just scratched the surface of one use case. k8s has something for everyone, dig through the <a href="https://kubernetes.io/docs/concepts/">concepts</a> and see where it can fit for you!</p><p>Keep ‘em flying! 🐤 🚀</p><p>In the upcoming weeks, we’ll be releasing Dockbit Providers for tighter integration with Kubernetes-based Continuous Delivery pipelines. Add a Dockbit Manual stage to get a Slack interactive message for <a href="https://blog.dockbit.com/reviewing-and-confirming-deployments-cace05d18706">confirming the deployment</a> and you’ve got a pretty cool setup! 😎</p><p><em>Dockbit turns your complex software deployments into simple, manageable workflows. </em><a href="https://dockbit.com/"><em>Sign up now</em></a><em> to get your 2 pipelines for free, connect </em><a href="https://docs.dockbit.com/integrations"><em>dozens of services</em></a><em> together, and kick-off deployments with a single Slack command. </em>🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6696910a52b2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dockbit/kubernetes-canary-deployments-for-mere-mortals-6696910a52b2">Kubernetes Canary deployments 🐤 for mere mortals</a> was originally published in <a href="https://medium.com/dockbit">Dockbit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sharing status of your project with Badges]]></title>
            <link>https://medium.com/dockbit/sharing-status-of-your-project-with-badges-5072f91615a1?source=rss----8c6338a67a8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/5072f91615a1</guid>
            <category><![CDATA[documentation]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[product]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Tair Asim]]></dc:creator>
            <pubDate>Tue, 03 Oct 2017 16:09:17 GMT</pubDate>
            <atom:updated>2017-10-03T16:09:17.413Z</atom:updated>
            <content:encoded><![CDATA[<p>If you have been following open-source projects, chances are you’ve seen the <em>Badges</em>. Whether it’s a passing build, the number of downloads, or the license used, badges have been the easiest way to show the status of the project.</p><p>For those who don’t know what a badge is, the idea is really simple. <strong>Badge is a tiny image that holds the quality metadata of the project.</strong> The image is auto-generated based on the provided parameters (such as project name) and can be embedded in sites, wikis, or pretty much anywhere it’d make sense to communicate a project status to other people.</p><p>Initially started for open-source projects, badges are gaining popularity not only in the open-source world but also within the teams working on proprietary projects.</p><p>So we thought, wouldn’t it be awesome to see the latest deployment status of your CD (continuous delivery) pipeline in the docs? Or maybe, show the quality metrics for a project? Enter Dockbit Badges.</p><p>When you open <em>settings</em> of a Dockbit Pipeline, you’ll notice a new Token field. This token gives you access to the latest deployment information of the pipeline. Copy the token and craft your badge URL in the following format:</p><p>https://img.shields.io/dockbit/ORGANIZATION_NAME/PIPELINE_NAME.svg?token=PIPELINE_TOKEN&amp;logo=dockbit&amp;style=STYLE</p><p>Where STYLE can be one of the following:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z1grZVTo8EWaHl3etD_5WA.png" /><figcaption>Dockbit Badge styles</figcaption></figure><p>As you might have noticed, we’re using <a href="https://shields.io/">Shields.io</a>, which generates open standard, pixel-perfect, no-tracking, and consistent badges.</p><p>Dockbit badges are not only for sharing the deployment status of your projects. You could easily connect together things like code quality, security checks, package version querying or any other utility (via available <a href="https://docs.dockbit.com/integrations/">Dockbit integrations</a>), combine it together with <a href="https://blog.dockbit.com/smarter-auto-deploys-cccb18a73c65">Dockbit Auto-deploys</a> and have an easy way to share dynamic status of your projects.</p><p>Give it a try and let us know what you think!</p><p><em>Dockbit turns your complex software deployments into simple, manageable workflows. </em><a href="https://dockbit.com/"><em>Sign up now</em></a><em> to get your 2 pipelines for free, connect </em><a href="https://docs.dockbit.com/integrations"><em>dozens of services</em></a><em>together, and kick-off deployments with a single Slack command. </em>🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5072f91615a1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dockbit/sharing-status-of-your-project-with-badges-5072f91615a1">Sharing status of your project with Badges</a> was originally published in <a href="https://medium.com/dockbit">Dockbit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Yarn 1.0 is here!]]></title>
            <link>https://medium.com/dockbit/yarn-1-0-is-here-d118b26a14cf?source=rss----8c6338a67a8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/d118b26a14cf</guid>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[product]]></category>
            <category><![CDATA[yarn]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Tair Asim]]></dc:creator>
            <pubDate>Thu, 21 Sep 2017 16:11:01 GMT</pubDate>
            <atom:updated>2017-09-21T16:11:00.980Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kShNXWYvksbAAf4CHYu6pg.png" /></figure><p>Facebook has recently announced <a href="https://code.facebook.com/posts/274518539716230">the 1.0 release</a> of the awesome <a href="https://yarnpkg.com/en/">Yarn</a> JavaScript package manager. It’s been one of the most popular and fastest growing open-source tools, with over 175K projects on GitHub and 3B downloads, after its first announcement just less than a year ago!</p><p>From day one, <a href="https://blog.dockbit.com/announcing-yarn-support-fa9338e15481">we’ve supported Yarn at Dockbit</a>. So, we wanted to let you know that <strong>Yarn 1.x is now comes pre-installed</strong> in all of our <a href="https://github.com/Dockbit/library">Docker Node images</a>.</p><p>Since Dockbit knows the kind of integration you’re using — Node.js — it automatically caches all of your application dependencies for faster builds. Underneath, we’re using this tiny tool we’ve created called <em>Hacher</em> and it’s <a href="https://github.com/Dockbit/hacher">available on GitHub</a>.</p><p>Perhaps one of the features that I am most excited about is the <a href="https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/">Yarn Workspaces</a>. Dealing with monorepos (multi-package repositories) can be hard, so Workspaces definitely makes this process easier; it allows you to install dependencies from multiple package.json files in the same repository. Combine it with our recently announced <a href="https://blog.dockbit.com/smarter-auto-deploys-cccb18a73c65">improvements to Auto deployment</a> of monorepos and you’re good to go.</p><p>If you’ve been with npm, maybe now is the good time to bring in your yarn.lockand get the benefits of the latest Yarn release: Workspaces, Auto-merging of lockfiles, and Selective version resolutions.</p><p>Give it a try and keep shipping!</p><p><em>Dockbit turns your complex software deployments into simple, manageable workflows. </em><a href="https://dockbit.com/"><em>Sign up now</em></a><em> to get your 2 pipelines for free, connect </em><a href="https://docs.dockbit.com/integrations"><em>dozens of services</em></a><em> together, and kick-off deployments with a single Slack command. </em>🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d118b26a14cf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dockbit/yarn-1-0-is-here-d118b26a14cf">Yarn 1.0 is here!</a> was originally published in <a href="https://medium.com/dockbit">Dockbit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making use of Docker build arguments]]></title>
            <link>https://medium.com/dockbit/making-use-of-docker-build-arguments-68792d751f3?source=rss----8c6338a67a8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/68792d751f3</guid>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Ahmed ElGamil]]></dc:creator>
            <pubDate>Tue, 19 Sep 2017 16:01:02 GMT</pubDate>
            <atom:updated>2017-09-21T20:24:16.153Z</atom:updated>
            <content:encoded><![CDATA[<h4>And how to use arguments in your Dockbit pipelines</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*23eMNO79Y_g0hBjU76g3iA.jpeg" /></figure><p>One of the great things about Docker builder is that it allows you to pass arguments that can be consumed in the context of the Dockerfile. The values of those arguments are only available during build-time, so they don’t reflect in the resulting Docker image.</p><p><a href="https://docs.docker.com/engine/reference/builder/#arg">Build-time arguments</a> are defined in Dockerfile using the ARG instruction. There are other useful instructions that help with dynamicity of Dockerfiles, you can get a glimpse of some use cases <a href="https://blog.dockbit.com/templating-your-dockerfile-like-a-boss-2a84a67d28e9">here</a>.</p><p>Arguments are especially helpful when it comes to designing CI/CD (Continuous Integration and Delivery) pipelines.</p><p>Let’s assume the following scenario: You are a building a Docker image that packages your <a href="https://golang.org/">Go</a> app (a <a href="https://blog.golang.org/docker">common</a> <a href="https://blog.docker.com/2016/09/docker-golang/">pattern</a> in the Docker/Go community). The commit to be deployed is tagged in Git as v0.1.0 along with a GitHub <a href="https://help.github.com/articles/about-releases/">release</a>.</p><p>To give an example, we are going to use <a href="https://github.com/Dockbit/hacher">hacher</a> (A simple Go-based CLI tool for caching project artifacts), it should fit the bill. Now you can use build-time arguments as such:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/789c2ff639707a5152538115a56818a8/href">https://medium.com/media/789c2ff639707a5152538115a56818a8/href</a></iframe><p>This Dockerfile uses a build-time argument named RELEASE which has a default value of master. Arguments can be used as environment variables in subsequent RUN instructions. So for instance, if we set RELEASE to v0.1.0, the instructions will:</p><ol><li>Download version v0.1.0 from <a href="https://github.com/Dockbit/hacher/releases">GitHub releases</a> page of hacher and unpack.</li><li>Compile the Go binary.</li><li>Copy the resulting artifact to /hacher.</li></ol><p>During the image build, we can supply the argument via the --build-arg flag:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/44c444c156c37fff514cf463d51d12d0/href">https://medium.com/media/44c444c156c37fff514cf463d51d12d0/href</a></iframe><p>If you are using a recent version of the Docker daemon (17.06+), you can also use <a href="https://blog.docker.com/2017/07/multi-stage-builds/">multi-stage builds</a> for minimizing the size of the final image. Effectively, packaging only the Go binary without needing to bring the entire Go build environment for the ride. Here’s how to adjust the Dockerfile above to use multi-stage builds:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4933c9477240ff73e44659e80b408326/href">https://medium.com/media/4933c9477240ff73e44659e80b408326/href</a></iframe><p>As you may notice, the difference is that on line 13, we’re using yet another FROM instruction to create a separate light-weight Docker image based on <a href="https://www.alpinelinux.org/">Alpine</a>. This happens as a new <em>stage</em>, then simply we copy over the hacherbinary from the previous stage.</p><p>The last missing link would be to dynamically fill the value of which release to deploy as part of the deployment. This is possible by grabbing the value of the Git tag or commit SHA via CI/CD systems, so you can pass that directly into the Docker build command.</p><p>We recently added a <a href="https://blog.dockbit.com/public-beta-docker-builds-eacfade4a410">Docker provider</a> to the list of natively-supported <a href="https://docs.dockbit.com/integrations/">integrations</a> on the platform. Today, we’d like to take it one step further by adding support for Docker build-time arguments. This allows modeling setups like the one mentioned earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/483/1*R4m2Ky3_Y1Vf8pgV4jNypA@2x.png" /></figure><p>For this stage, we are setting the value of the RELEASE build argument dynamically to a Dockbit <a href="https://docs.dockbit.com/using-dockbit/variables/">built-in variable</a>. Dockbit will automatically translateDOCKBIT_DEPLOYMENT_REF to v0.1.0. You can also use DOCKBIT_DEPLOYMENT_SHA for filling in the value of the git commit SHA.</p><p>Supplying multiple arguments is possible by using comma as a delimiter between the argument-value pairs.</p><p>All-in-all, such setup takes your Slack (a.k.a ChatOps) command you execute by typing/dockbit deploy hacher/v0.1.0 in Slack and turns it into a Docker image via a Dockbit continuous delivery pipeline. Later stages in the pipeline can be about deployment to container schedulers such as <a href="https://kubernetes.io/">Kubernetes</a>.</p><p>Stay tuned for more exciting news about all things Docker 🐳</p><p><em>Dockbit turns your complex software deployments into simple, manageable workflows. </em><a href="https://dockbit.com/"><em>Sign up now</em></a><em> to get your 2 pipelines for free, connect </em><a href="https://docs.dockbit.com/integrations"><em>dozens of services</em></a><em>together, and kick-off deployments with a single Slack command. </em>🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=68792d751f3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dockbit/making-use-of-docker-build-arguments-68792d751f3">Making use of Docker build arguments</a> was originally published in <a href="https://medium.com/dockbit">Dockbit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Smarter auto-deploys]]></title>
            <link>https://medium.com/dockbit/smarter-auto-deploys-cccb18a73c65?source=rss----8c6338a67a8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/cccb18a73c65</guid>
            <category><![CDATA[continuous-deployment]]></category>
            <category><![CDATA[product]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[code]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Tair Asim]]></dc:creator>
            <pubDate>Wed, 06 Sep 2017 15:11:00 GMT</pubDate>
            <atom:updated>2017-09-09T05:43:45.764Z</atom:updated>
            <content:encoded><![CDATA[<h4>And making auto deployments work with monorepos</h4><p>Last year we introduced <a href="https://blog.dockbit.com/dockbit-1-0-new-features-new-infrastructure-new-pricing-c2f15dfdf374">Auto-deployments</a> — a feature that enabled teams to automatically deploy changes on any matching Git branch. It really helped our users to ship code faster, in a truly continuous deployment manner. So far, Auto-deployments has been one of the most widely used features in Dockbit, resulting to nearly 25% of all the deployments made on our platform.</p><p>From day one, Dockbit was designed to follow a service-per-repository approach, where every Dockbit pipeline (backed by a GitHub repository) would be dedicated for one single purpose, with all its respective deployment steps.</p><p>As the usage grew and more kind of workflows started to emerge, we realized that Auto-deployment feature was limiting. For example, say you have a <a href="https://trunkbaseddevelopment.com/monorepos/">monolithic repo</a> with your front-end code under /client directory and backend under /api. Now, what if you wanted to create two separate pipelines and auto-deploy them differently based on their paths in the repository? Or maybe, you’ve got the /docs folder along with your main application for serving GitHub pages and don’t want to trigger auto-deployments for your application when documentation changes? Or having your <a href="https://serverless.com/">Serverless</a> functions running a completely different set of deployment commands? You get the idea.</p><p>Today, we’d love to introduce an improvement to Auto-deployments that would greatly help you build <strong>smarter auto-deployment workflows</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OdFFQlv8BzdmzEEVf24vzQ.png" /><figcaption>Dockbit Auto-deploys with matching branches and/or paths</figcaption></figure><p>As you’ll notice, you can now trigger deployments on matching <em>paths</em>, in addition to <em>branches</em>. The paths are Git additions and modifications from the <a href="https://developer.github.com/v3/activity/events/types/#pushevent">GitHub push event</a> that we receive on every change to your repository. Together with the provided <em>Regex</em> match, you can go really creative with your workflows.</p><p>Additionally, you are now able to choose whether to <strong>Match any</strong> (default) or<strong> Match all </strong>conditions, basically giving you logical <em>OR</em> and <em>AND</em> operators over your auto-deployments. Oh, and because it’s no longer just about “Branches”, we’ve renamed the entire feature to “Auto-deploys”, makes sense?! 😜</p><p>Give this feature a spin and let us know what you think in the comments below, or by tweeting us at <a href="http://twitter.com/dockbit">@dockbit</a>. Enjoy!</p><p><em>Dockbit turns your complex software deployments into simple, manageable workflows. </em><a href="https://dockbit.com/"><em>Sign up now</em></a><em> to get your 2 pipelines for free, connect </em><a href="https://docs.dockbit.com/integrations"><em>dozens of services</em></a><em> together, and kick-off deployments with a single Slack command. </em>🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cccb18a73c65" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dockbit/smarter-auto-deploys-cccb18a73c65">Smarter auto-deploys</a> was originally published in <a href="https://medium.com/dockbit">Dockbit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Public beta: Docker builds]]></title>
            <link>https://medium.com/dockbit/public-beta-docker-builds-eacfade4a410?source=rss----8c6338a67a8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/eacfade4a410</guid>
            <category><![CDATA[product]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Ahmed ElGamil]]></dc:creator>
            <pubDate>Tue, 04 Jul 2017 16:01:01 GMT</pubDate>
            <atom:updated>2017-07-04T16:01:00.839Z</atom:updated>
            <content:encoded><![CDATA[<h4>And why you shouldn’t be building Docker images in CI</h4><p>Up until recently, Dockbit had no native support for building Docker images. We’ve had numerous feedback for adding support for building images. Most users ended up with ugly workarounds such as building inside CI systems of their use (and later included the CI Provider in the pipeline) or even by executing a build on a remote machine over SSH. Today, we’d like to change that.</p><p>If you think about building Docker images (or any other artifact generation process for that matter), generation in Continuous Integration phase isn’t really ideal. CI builds should be about testing and integrating code, and they need to be fast in doing so.</p><p>Building Docker images as part of a CI build won’t help you make things faster here. Moreover, this complicates your CI process and can affect build times, which leads to reporting inaccurate durations of the tests execution.</p><p>A better approach is to move Docker builds to the Continuous Delivery pipeline which can then seamlessly use the generated image in later stages of the container’s lifecycle (deployment to container schedulers, etc). This approach also correlates the docker image to the deployment rather than the CI build which makes more sense from a release management perspective.</p><p>Starting today, you can add the <a href="https://medium.com/product-hunt/27-must-have-apps-you-probably-dont-know-about-3d75aa97dd92">Docker provider</a> to your Dockbit pipelines for building images and pushing them to registries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*lMIl2ZB-yLs4At85eGJT0g@2x.png" /></figure><p>As you may notice, the Provider is Docker registry agnostic, so you are not limited to only push to the <a href="https://hub.docker.com/">Docker hub</a>, but also any public/private registry of your choice.</p><p>The <a href="https://medium.com/product-hunt/27-must-have-apps-you-probably-dont-know-about-3d75aa97dd92">Docker provider</a> is the first of its kind in Dockbit since it launches a dedicated virtual machine with its own Docker engine exclusively for your organization’s image building workloads. This not only ensures enhanced security and isolation, but also guaranteed performance. The specifications assigned to the VM are dependent on the <a href="http://dockbit.com/pricing">Dockbit plan</a> you have applied on your account:</p><ul><li>Free: 1 Docker-enabled pipeline with a small builder — 1 vCPU, 2GB RAM</li><li>Basic: 2 Docker-enabled pipelines with a medium builder — 2 vCPU, 4GB RAM</li><li>Plus: 5 Docker-enabled pipelines with a large builder — 2 vCPU, 8GB RAM</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u_gV2FnieoAcNfBTUCJjDw.png" /></figure><p>We are incredibly excited about what this Provider introduces to the platform. Not only have we planned improvements such as faster Docker builds with caching and tightly integrated container deployment orchestration via Dockbit pipelines, but it also opens the doors for hosted on-demand environments aka “branch boxes”. Stay tuned!</p><p><em>Dockbit turns your complex software deployments into simple, manageable workflows. </em><a href="https://dockbit.com/"><em>Sign up now</em></a><em> to get your 2 pipelines for free, connect </em><a href="https://docs.dockbit.com/integrations"><em>dozens of services</em></a><em> together, and kick-off deployments with a single Slack command. </em>🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eacfade4a410" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dockbit/public-beta-docker-builds-eacfade4a410">Public beta: Docker builds</a> was originally published in <a href="https://medium.com/dockbit">Dockbit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Locking pipelines with Deploy Locks]]></title>
            <link>https://medium.com/dockbit/locking-pipelines-with-deploy-locks-794094108cb2?source=rss----8c6338a67a8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/794094108cb2</guid>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[product]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[continuous-delivery]]></category>
            <dc:creator><![CDATA[Tair Asim]]></dc:creator>
            <pubDate>Thu, 25 May 2017 16:01:02 GMT</pubDate>
            <atom:updated>2017-05-25T16:01:02.070Z</atom:updated>
            <content:encoded><![CDATA[<h4>Prevent others from accidentally deploying to a shared environment</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ykzp5cTgiOFYiUl8M1GwyA.jpeg" /><figcaption>Photo by Ishan @seefromthesky</figcaption></figure><p>Sometimes writing software in a team feels like car traffic on the streets. You just need certain controls to coordinate the flow of new features, especially when it comes to shared environments — whether it’s a staging box you use to verify new features or your glorious Production.</p><p>I bet we’ve all had this moment when we wanted to prevent others from accidentally deploying to a shared environment while testing our branches. Or maybe completely lock the environment during outages and other emergency situations, while the problem is being investigated by the ops team.</p><p>Well, today you can do just that — lock pipelines to prevent any new deployments. The workflow is really simple, all you have to do is to trigger/dockbit lock PIPELINE: Your message command with an optional <em>lock message</em> in Slack or click on <em>Lock</em> button in the web app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V4fVgtopte44-ndUOOWZSw.gif" /><figcaption>Lock Pipeline from Slack</figcaption></figure><p>Listing pipelines and querying for latest deployment status in Slack or viewing Pipeline in the web app, would nicely show the lock status:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QfmQPffo2fqBFZosAEovdg.png" /><figcaption>Lock status in the Pipeline Board</figcaption></figure><p>Now that you hold the lock, anybody else trying to deploy to this pipeline will be warned. Additionally, Dockbit <a href="https://docs.dockbit.com/chats/slack/">Slack bot</a> will prompt others if they want to <em>steal the lock</em>, which essentially just re-locks the pipeline under a new name and notifies other team members in Slack.</p><p><strong>Deployment Locks</strong> is available in our <a href="https://dockbit.com/pricing">Plus plan</a>, so give it a try. And we’ve only scratched the surface with this feature. Soon, we’ll be adding more handy improvements to this workflow, such as automatically locking pipeline when topic branches are deployed and releasing locks when they’re merged back.</p><p>Stay tuned! 🎁</p><p><em>Dockbit turns your complex software deployments into simple, manageable workflows. </em><a href="https://dockbit.com/"><em>Sign up now</em></a><em> to get your 2 pipelines for free, connect </em><a href="https://docs.dockbit.com/integrations"><em>dozens of services</em></a><em> together, and kick-off deployments with a single Slack command. </em>🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=794094108cb2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dockbit/locking-pipelines-with-deploy-locks-794094108cb2">Locking pipelines with Deploy Locks</a> was originally published in <a href="https://medium.com/dockbit">Dockbit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Reviewing and confirming deployments]]></title>
            <link>https://medium.com/dockbit/reviewing-and-confirming-deployments-cace05d18706?source=rss----8c6338a67a8f---4</link>
            <guid isPermaLink="false">https://medium.com/p/cace05d18706</guid>
            <category><![CDATA[continuous-delivery]]></category>
            <category><![CDATA[product]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Tair Asim]]></dc:creator>
            <pubDate>Fri, 12 May 2017 21:12:06 GMT</pubDate>
            <atom:updated>2017-05-15T19:58:04.459Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“Deploying software is a balancing act: you want your product to quickly improve, but not at the expense of stability.” — <a href="https://zachholman.com/">Zach Holman</a></blockquote><p>It’s one of those quotes from Zach that we couldn’t agree more. There are just too many things to juggle and asking your teammates to review a deployed feature is one of them.</p><p>Say you wanted to pause your deployment and get a confirmation from your QA engineer, teammate, or a product manager. Usually, you’d have to manually coordinate this process and pass around any deployment-related information. However, that’s time-consuming and not fun at all.</p><p>So, today we’d like to introduce our latest feature that improves the process of reviewing and confirming deployments. Here is how it works.</p><p>Open any of your existing pipelines and add our new <strong>Manual step</strong>. In our example, we have an <a href="https://github.com/ember-cli-deploy/ember-cli-deploy">Ember CLI deploy</a> based project, where we deploy a new revision, request a confirmation from <em>Developers</em> team, and once it’s approved, activate revision in <em>Production</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dspSXn1ICjQptNE6Q11YAQ.jpeg" /><figcaption>Ember CLI Deploy Pipeline with confirmations</figcaption></figure><p>Now, when you trigger a deployment and execution reaches a <em>Manual</em> stage, selected people will receive a confirmation notification right inside Slack. Approving or rejecting a deployment is as easy as clicking the interactive Slack button:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lT9JZFNXqb50UrS8foFQlQ.gif" /><figcaption>Confirm deployments from Slack</figcaption></figure><p>Once deployment is approved, execution continues. If it’s rejected though, the team is notified and deployment results in a <em>Rejected</em> state, which is clearly visible on the <em>Pipeline Board</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PIhmyUoO0tuX0LDrfrMjBg.jpeg" /><figcaption>Pipeline Board with rejected deployments</figcaption></figure><p><strong>Deployment Confirmations</strong> is available in our <a href="https://dockbit.com/pricing">Plus plan</a>, so give it a try. In the meanwhile, we’ll be extending this feature with more functionality and as always, we’d love to hear your feedback, which you can leave in the comments below, by tweeting us <a href="http://twitter.com/dockbit">@dockbit</a> or <a href="/service/mailto:team@dockbit.com">sending an email</a>.</p><p><em>Dockbit turns your complex software deployments into simple, manageable workflows. </em><a href="https://dockbit.com/"><em>Sign up now</em></a><em> to get your 2 pipelines for free, connect </em><a href="https://docs.dockbit.com/integrations"><em>dozens of services</em></a><em> together, and kick-off deployments with a single Slack command. </em>🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cace05d18706" width="1" height="1" alt=""><hr><p><a href="https://medium.com/dockbit/reviewing-and-confirming-deployments-cace05d18706">Reviewing and confirming deployments</a> was originally published in <a href="https://medium.com/dockbit">Dockbit</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>