<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Colin Walker on Medium]]></title>
        <description><![CDATA[Stories by Colin Walker on Medium]]></description>
        <link>https://medium.com/@colinjfw?source=rss-d3de2703b18a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*20E9jdlUN7iAB_gClWoB2g.jpeg</url>
            <title>Stories by Colin Walker on Medium</title>
            <link>https://medium.com/@colinjfw?source=rss-d3de2703b18a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 22:27:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@colinjfw/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Causal Consistency: A brief introduction]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">As developers most of us have heard of the basic consistency types like eventual consistency and strong consistency. There are, however, a&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@colinjfw/causal-consistency-a-brief-introduction-afe58646e3ca?source=rss-d3de2703b18a------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@colinjfw/causal-consistency-a-brief-introduction-afe58646e3ca?source=rss-d3de2703b18a------2</link>
            <guid isPermaLink="false">https://medium.com/p/afe58646e3ca</guid>
            <dc:creator><![CDATA[Colin Walker]]></dc:creator>
            <pubDate>Thu, 26 Mar 2020 05:28:02 GMT</pubDate>
            <atom:updated>2020-03-26T05:28:02.177Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Deliverybot: The road to a production release]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">Over the last few months hundreds of users have used Deliverybot to deploy code to a variety of platforms. From Kubernetes, Firebase to&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@colinjfw/deliverybot-the-road-to-a-production-release-c5d46ddcdd17?source=rss-d3de2703b18a------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@colinjfw/deliverybot-the-road-to-a-production-release-c5d46ddcdd17?source=rss-d3de2703b18a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5d46ddcdd17</guid>
            <category><![CDATA[continuous-integration]]></category>
            <dc:creator><![CDATA[Colin Walker]]></dc:creator>
            <pubDate>Wed, 20 Nov 2019 16:38:27 GMT</pubDate>
            <atom:updated>2019-11-20T16:38:27.273Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Are you tracking DevOps metrics? You should be]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@colinjfw/are-you-tracking-devops-metrics-you-should-be-db0eaa572ab3?source=rss-d3de2703b18a------2"><img src="https://cdn-images-1.medium.com/max/2600/1*hThcGlxFOknc_AY13jyAAg.jpeg" width="5575"></a></p><p class="medium-feed-snippet">Listen to the authors of the state of DevOps report on what makes for highly effective teams.</p><p class="medium-feed-link"><a href="https://medium.com/@colinjfw/are-you-tracking-devops-metrics-you-should-be-db0eaa572ab3?source=rss-d3de2703b18a------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@colinjfw/are-you-tracking-devops-metrics-you-should-be-db0eaa572ab3?source=rss-d3de2703b18a------2</link>
            <guid isPermaLink="false">https://medium.com/p/db0eaa572ab3</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Colin Walker]]></dc:creator>
            <pubDate>Fri, 08 Nov 2019 16:57:27 GMT</pubDate>
            <atom:updated>2019-11-08T16:57:27.711Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[What is the GitHub deployments API?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://itnext.io/what-is-the-github-deployments-api-638ce3088ed2?source=rss-d3de2703b18a------2"><img src="https://cdn-images-1.medium.com/max/2555/1*Cj8DKu1s-s3t-ouIOTsVcA.jpeg" width="2555"></a></p><p class="medium-feed-snippet">A lesser known tool to ship your code that&#x2019;s baked right in to GitHub.</p><p class="medium-feed-link"><a href="https://itnext.io/what-is-the-github-deployments-api-638ce3088ed2?source=rss-d3de2703b18a------2">Continue reading on ITNEXT »</a></p></div>]]></description>
            <link>https://itnext.io/what-is-the-github-deployments-api-638ce3088ed2?source=rss-d3de2703b18a------2</link>
            <guid isPermaLink="false">https://medium.com/p/638ce3088ed2</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[deployment-automation]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Colin Walker]]></dc:creator>
            <pubDate>Tue, 01 Oct 2019 14:59:47 GMT</pubDate>
            <atom:updated>2019-10-01T19:13:22.618Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Deploying to Kubernetes with Helm and GitHub Actions]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/swlh/deploying-to-kubernetes-with-helm-and-github-actions-14825e6df1f2?source=rss-d3de2703b18a------2"><img src="https://cdn-images-1.medium.com/max/2600/1*_RZTgwEYPAAeXURs1-6KWg.jpeg" width="3541"></a></p><p class="medium-feed-snippet">This tutorial will go through the basics of GitHub actions as well as deploying to Kubernetes using a pre-built Helm action</p><p class="medium-feed-link"><a href="https://medium.com/swlh/deploying-to-kubernetes-with-helm-and-github-actions-14825e6df1f2?source=rss-d3de2703b18a------2">Continue reading on The Startup »</a></p></div>]]></description>
            <link>https://medium.com/swlh/deploying-to-kubernetes-with-helm-and-github-actions-14825e6df1f2?source=rss-d3de2703b18a------2</link>
            <guid isPermaLink="false">https://medium.com/p/14825e6df1f2</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[api]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Colin Walker]]></dc:creator>
            <pubDate>Sun, 15 Sep 2019 16:14:29 GMT</pubDate>
            <atom:updated>2019-09-16T15:56:22.246Z</atom:updated>
            <cc:license>http://creativecommons.org/licenses/by/4.0/</cc:license>
        </item>
        <item>
            <title><![CDATA[Safe and automation friendly canary deployments with Helm]]></title>
            <link>https://itnext.io/safe-and-automation-friendly-canary-deployments-with-helm-669394d2c48a?source=rss-d3de2703b18a------2</link>
            <guid isPermaLink="false">https://medium.com/p/669394d2c48a</guid>
            <category><![CDATA[helm-chart]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Colin Walker]]></dc:creator>
            <pubDate>Sat, 14 Sep 2019 16:15:12 GMT</pubDate>
            <atom:updated>2019-09-19T06:45:44.515Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TMARUhBRvsX-YBgklquqkQ.jpeg" /></figure><p><em>This is part of a series on pragmatic, safe and repeatable ways of deploying to Kubernetes. These posts are built as part of building </em><a href="http://deliverybot.github.io/"><em>Deliverybot</em></a><em>, the missing link between deploying to Kubernetes from GitHub.</em></p><p>Canary deployments are a very effective way of testing new code on a subset of a user base. They significantly reduces the blast radius of a deployment that may be tricky to roll out by only exposing it to a subset of traffic. This post will dive into how to achieve this within Kubernetes but also in a deployment automation friendly way. This post assumes some knowledge of Helm charts and Kubernetes resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*tk_mHDWNGDdHTT53usv4Lg.png" /><figcaption>Canary deployment</figcaption></figure><p>A simple canary deployment with Kubernetes involves two key resources: The service and the deployment resource. A canary deployment works by having a single service resource with two different deployment resources serving this traffic. One of the deployment resources will be a canary version while the other will be the stable version. We can keep the replica count of the canary version lower to only serve a smaller percentage of the traffic. If you like to think in Yaml, it roughly looks like the below Kubernetes resources:</p><pre>kind: Deployment<br>metadata:<br>  name: app-canary<br>  labels:<br>    app: app<br>spec:<br>  replicas: 1<br>  ...<br>    image: myapp:canary<br>---<br>kind: Deployment<br>metadata:<br>  name: app<br>  labels:<br>    app: app<br>spec:<br>  replicas: 5<br>  ...<br>    image: myapp:stable<br>---<br>kind: Service<br>selector:<br>  app: app # Selector will route traffic to both deployments.</pre><p>This is simple to imagine just using kubectl, there is even a great guide on this in the <a href="https://kubernetes.io/docs/concepts/cluster-administration/manage-deployment/#canary-deployments">Kubernetes documentation</a>. The question for this post is how we’re going to automate this and additionally how to do this with Helm.</p><h4><strong>Automating the canary</strong></h4><p>First of all, we need a basic Helm chart that holds the resources that we discussed above. The Helm chart should look something like this:</p><pre>~/charts/app<br>├── Chart.yaml<br>├── README.md<br>├── templates<br>│   ├── NOTES.txt<br>│   ├── _helpers.tpl<br>│   ├── deployment.yaml<br>│   └── service.yaml<br>└── values.yaml</pre><p>The core concept with Helm is to manage multiple releases. A stable release is our main release track with the stable version of our code. We can then deploy a canary Helm release with our canary code. The piece that joins these is that the stable release must route traffic to the canary release. We’re going to manage this by using a specific selector on the service:</p><pre>selector:<br>  app.kubernetes.io/name: myapp</pre><p>Our deployment resources, both canary and stable, will specify this label on the pods. As long as we set this up correctly when we deploy the canary version of our Helm chart we will see that traffic will be routed to the pods that are deployed.</p><p>Let’s release the stable version of our chart. This will look like the following command:</p><pre>helm upgrade<br>  --install myapp \<br>  --namespace default \<br>  --set app.name=myapp \      # Goes into app.kubernetes.io/name<br>  --set app.version=v1 \      # Goes into app.kubernetes.io/version<br>  --set image.tag=stable \<br>  --set replicaCount=5</pre><p>Now let’s test out our new canary. To roll out a canary deployment we only need to differ two things. The release name needs to be different so that we don’t actually end up just upgrading our current stable release. The version and image tag needs to also differ so that we’re deploying different code and we can identify this code difference in the deployment resource labels.</p><pre>helm upgrade<br>  --install <strong>myapp-canary</strong> \<br>  --namespace default \<br>  --set app.name=myapp \      # Goes into app.kubernetes.io/name<br>  --set <strong>app.version=v2</strong> \      # Goes into app.kubernetes.io/version<br>  --set <strong>image.tag=canary</strong> \<br>  --set replicaCount=1</pre><p>That’s it! If you ping the service you should be able to see the canary application being routed traffic only part of the time.</p><p>If you are looking for deployment automation that wraps this logic up take a look at <a href="https://deliverybot.github.io/">Deliverybot</a> and specifically the <a href="https://github.com/deliverybot/helm">Helm GitHub automation</a>. The chart used to test and implement these ideas is located at <a href="https://github.com/deliverybot/helm/tree/master/charts/app">github.com/deliverybot/helm/charts</a>. This was a theoretical overview on how to do automated canary deployments but these tools bring that into practice with examples and concrete concepts.</p><p>Other posts:</p><ul><li><a href="https://medium.com/@colinjfw/kustomize-deploying-applications-using-the-new-kubernetes-templating-system-43f26706069">Kustomize: Deploying applications using the new Kubernetes templating system</a>.</li><li><a href="https://medium.com/@colinjfw/best-practices-for-deploying-to-kubernetes-using-helm-73be1f3040d2">Best practices for deploying to Kubernetes using Helm</a>.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=669394d2c48a" width="1" height="1" alt=""><hr><p><a href="https://itnext.io/safe-and-automation-friendly-canary-deployments-with-helm-669394d2c48a">Safe and automation friendly canary deployments with Helm</a> was originally published in <a href="https://itnext.io/">ITNEXT</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best practices for deploying to Kubernetes using Helm]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://itnext.io/best-practices-for-deploying-to-kubernetes-using-helm-73be1f3040d2?source=rss-d3de2703b18a------2"><img src="https://cdn-images-1.medium.com/max/2600/1*ZSKTdmyUh3XnWVld1-tPMA.jpeg" width="6000"></a></p><p class="medium-feed-snippet">Best practices, guides and advice to keep your Kubernetes deployments on track.</p><p class="medium-feed-link"><a href="https://itnext.io/best-practices-for-deploying-to-kubernetes-using-helm-73be1f3040d2?source=rss-d3de2703b18a------2">Continue reading on ITNEXT »</a></p></div>]]></description>
            <link>https://itnext.io/best-practices-for-deploying-to-kubernetes-using-helm-73be1f3040d2?source=rss-d3de2703b18a------2</link>
            <guid isPermaLink="false">https://medium.com/p/73be1f3040d2</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Colin Walker]]></dc:creator>
            <pubDate>Fri, 06 Sep 2019 03:00:10 GMT</pubDate>
            <atom:updated>2019-09-06T15:26:08.606Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Kustomize: Deploying applications using the new Kubernetes templating system]]></title>
            <link>https://medium.com/@colinjfw/kustomize-deploying-applications-using-the-new-kubernetes-templating-system-43f26706069?source=rss-d3de2703b18a------2</link>
            <guid isPermaLink="false">https://medium.com/p/43f26706069</guid>
            <category><![CDATA[golang]]></category>
            <category><![CDATA[helm]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[engineering]]></category>
            <dc:creator><![CDATA[Colin Walker]]></dc:creator>
            <pubDate>Mon, 02 Sep 2019 19:32:20 GMT</pubDate>
            <atom:updated>2019-09-02T19:32:20.850Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jLkzCoXB_B5jORBEdq9vqg.jpeg" /></figure><p><em>This is part of a series on pragmatic, safe and repeatable ways of deploying to Kubernetes. These posts are built as part of building </em><a href="http://deliverybot.github.io/"><em>Deliverybot</em></a><em>, the missing link between deploying to Kubernetes from GitHub.</em></p><p>I recently went to survey some of the Kubernetes landscape in deployment automation to find out what’s been newly developed in the community. I quickly came across a new templating system Kustomize. It’s not strictly a templating system in the way we think about it — a better way to describe it is “customization for your Kubernetes yaml files” — but achieves the same goal for most of us.</p><p>First, what is this Kustomize thing? Effectively, Kustomize is an overlay system that let’s you override values in your Kubernetes manifests. It gives us a directory structure that looks something like the following:</p><pre>~/app<br>├── base<br>│   ├── deployment.yaml<br>│   └── kustomization.yaml<br>└── overlays<br>    ├── development<br>    │   ├── deployment.yaml<br>    │   ├── kustomization.yaml<br>    └── production<br>        ├── deployment.yaml<br>        └── kustomization.yaml</pre><p>Overlays provide the mechanism to change values across your core Kubernetes manifests. One of the main differences with something like Helm is that the overrides are specified in regular Kubernetes yaml syntax. This is the key innovation with Kustomize. I may have a very simple “base” Kubernetes manifest that looks like this (some yaml omitted for brevity):</p><pre><em># ~/app/base/deployment.yaml</em><br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: app<br>spec:<br>  replicas: 1<br>  ...</pre><p>Now, in my environment specific override files, I can include an override that bumps replicas for a specific environment. For example:</p><pre><em># ~/app/overlays/production/deployment.yaml</em><br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: app<br>spec:<br>  replicas: 3<br>  ...</pre><p>Now, when I apply my manifests into Kubernetes I can select the production overlay. Kustomize figures out the differences and merges the configuration together. This results in 3 replicas of my deployment resource running in production. On my staging server, I may specify only a single replica or vary labels or names of resources.</p><p>This is the first powerful feature of Kustomize that is probably the most useful. The overlays feature allows working with bare Kubernetes yaml but changing values between environments.</p><h4>Applying Kustomize configurations</h4><p>The Kustomization files in the tree shown above are relatively simple. They simply describe the manifests that they are responsible for. The base Kustomize file looks like:</p><pre><em># ~/app/base/</em><em>kustomization.yaml</em><br>resources:<br>- ./deployment.yaml</pre><p>And the overlay file simply specifies the base:</p><pre><em># ~/app/base/</em><em>kustomization.yaml<br></em>resources:<br>- deployment.yaml<br>bases:<br>- ../../base</pre><p>Actually applying these files is simple:</p><pre>kubectl apply -k overlays/production</pre><p>Kustomize comes as a separate CLI that you can work with. Here, with the latest version of kubectl, we can use this simply as a flag to trigger the new behaviour. At this stage we’ve successfully applied manifests into Kubernetes with slight differences between production and staging using only Kubernetes manifests and tooling built into kubectl.</p><h4>More complex transformations</h4><p>Let’s explore a few more powerful features of Kustomize. One of the core ideas behind Kustomize is the concept of a “transformer.” This is code built in to Kustomize that transforms your Kubernetes manifests given a declarative and simple set of rules. You can customize these transformer’s but some of the built in ones are incredibly useful. Below is an example of some of the most common transformations available:</p><pre><em># kustomization.yaml</em><br>namespace: production<br>namePrefix: production-<br>nameSuffix: -v1</pre><p>For every resource we load we can prefix and suffix the name of that resource with the string provided. This is very useful for deploying the same group of manifests within the same namespace. We can also apply a namespace to all resources, simply by specifying the namespace parameter.</p><p>Probably one of the most useful transformations for every day is the image transformer. This changes image tags that exist in Kubernetes manifests to new versions:</p><pre><em># kustomization.yaml<br></em>images:<br>- name: nginx<br>  newTag: v1</pre><p>If we have a deployment that specifies the nginx image, after Kustomize has completed it’s work, this new image will now have the tag “v1” applied. This is a very useful transformation to apply in a CI pipeline right before deployment. The <a href="https://github.com/kubernetes-sigs/kustomize">Kustomize CLI</a> has edit commands that can add statements like this to your Kustomization file on the fly.</p><h3>Why use Kustomize?</h3><p>For a lot of companies, working with Kubernetes means diving into helm charts. Helm charts have become somewhat of a defacto standard for shipping applications on top of Kubernetes. For a lot of use cases Helm has some unneeded complexity. Some of the common problems with helm:</p><ul><li>Server side tiller component has too much power inside the Kubernetes cluster.</li><li>The way helm applies resources sometimes leads to a difference between desired and actual states.</li></ul><p>It’s common for smaller Kubernetes deployments to move towards a deployment system just using helm as a templating language, with deployment steps that look like this:</p><pre>helm template ./charts/my-chart | kubectl apply -f -</pre><p>This is very similar to the goals of Kustomize. If you need to simply replace variables and overlay simple values in your Kubernetes manifests then Kustomize may offer better flexibility in this area.</p><h4>Some of the problems</h4><p>One of the first roadblocks I hit with Kustomize was a lack of literal variables. If you are looking to do something similar to this:</p><pre>apiVersion: extensions/v1beta1<br>kind: Ingress<br>metadata:<br>  name: app<br>spec:<br>  rules:<br>  - host: &quot;{{ host }}&quot;</pre><p>You are pretty much out of luck with Kustomize. The recommended way of doing this is to manage these with JSON patch, inside the configuration file this would look like:</p><pre>- op: replace<br>  path: /spec/rules/0/host<br>  value: foo.bar.io</pre><p>Unfortunately I think that for a lot of teams this method of maintaining configuration will get unwieldy quite quickly. It can actually be a very serious configuration issue if you have an undefined host variable. The official recommendation from the Kustomize team is to use something like envsubst or another templating language alongside your Kustomize configurations.</p><h3>Summary</h3><p>In essence, Kustomize is a useful addition to your Kubernetes toolkit. It can wire up some of the more tedious templating issues that you may face but it’s definitely not the full answer. For teams looking to ship applications, Helm is probably going to be the simplest and most tried and tested solution at this point.</p><p><a href="https://gist.github.com/colinjfw/58ec321708b761b79c0fd9c33eec8716">I put together a few scripts for deploying using Kustomize</a> that I may use down the road for deploying to Kubernetes. Check them out and feel free to comment on your improvements.</p><p><em>Stay tuned for the next story in the series exploring different options for pragmatic, safe and repeatable ways of deploying to Kubernetes.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=43f26706069" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Learning to build an Express API for Battlesnake]]></title>
            <link>https://medium.com/battlesnake/learning-to-build-an-express-api-for-battlesnake-34e642975e39?source=rss-d3de2703b18a------2</link>
            <guid isPermaLink="false">https://medium.com/p/34e642975e39</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[battlesnake]]></category>
            <category><![CDATA[programming-competition]]></category>
            <dc:creator><![CDATA[Colin Walker]]></dc:creator>
            <pubDate>Sun, 17 Mar 2019 03:55:08 GMT</pubDate>
            <atom:updated>2019-03-17T06:14:28.170Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CSQ1RZppRk867Ov5zcZ37g.png" /></figure><p>Building an API is an important skill for any software developer. In this tutorial we want to build a basic HTTP server that controls a snake like you see in the game board below. All of the snakes in the game have been programmed by individuals like you and run autonomously using <a href="https://play.battlesnake.io/">play.battlesnake.io</a>.</p><p>Battlesnake is a version of the Snake game you found on old cellphones, and MS-DOS computers before that. It’s very much the same game, except multiple snakes are on the same board at once and each snake is controlled by a live web server. Snake servers implement commands receiving board information for every turn and responding with “up”, “down”, “left”, or “right” to control their snake. You can begin Battlesnake using simple algorithms, and build up to more and more complex solutions over time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/222/1*EPJNR1Lb-DtAgrlwdzQFZw.gif" /></figure><p>This tutorial will help you get started building your own Battlesnake and help you learn some of the tools and fundamentals of API design.</p><h3>Before we begin…</h3><p>You should have some beginner JavaScript knowledge and have a general idea of what Node.js is.</p><p>You will need the following installed:</p><ul><li>Node.js® — a JavaScript runtime built on Chrome’s V8 JavaScript engine</li><li>npm — a popular package manager, used for JavaScript projects</li><li>Git — a popular version control system</li><li>Your favourite text editor</li><li>A terminal shell</li><li>A text editor for writing code</li></ul><h3>Let’s get started!</h3><p>First, let’s open our terminal and get a new npm project started:</p><pre>mkdir battlesnake-api<br>cd battlesnake-api<br>touch index.js</pre><p>We just created a directory for our snake server and an empty file inside it (index.js) which will hold our snake logic. Next, initialize npm so that we can install any necessary packages. It will prompt you for some information about your project, but the defaults will work for now.</p><pre>npm init</pre><p>For this tutorial we’ll be using Express, one of the most widely-used server-side HTTP JavaScript libraries. Because of it’s amazing documentation and ease-of-use, it’s a great starting point! Run the below command to install Express into our project.</p><pre>npm add express --save</pre><p>Now that we’ve added Express, let’s begin using it in our index.js file:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5d37c33d01f0d36c0571a2f35f1825ff/href">https://medium.com/media/5d37c33d01f0d36c0571a2f35f1825ff/href</a></iframe><p>The above is a basic Express server. We can run this server by executing `node index.js`. This should print out the message “Listening on port 3000” in your terminal window if it was successful.</p><p>Now, to test our server, start a new terminal instance and execute the following command:</p><pre>curl <a href="http://localhost:3000/">http://localhost:3000</a></pre><p>This command should print out “Cannot GET /” in the terminal window. This means that the server is running and working correctly! Curl is a utility used often for interacting with HTTP servers and can be used for debugging issues with them. We will use it throughout this tutorial for testing the endpoints in our server’s API.</p><h3>Deploying</h3><p>Before we go any further, deploying our snake API to the internet is a key part of getting started. It’s much better to figure out how to deploy early, so we can test our snake easily as we go. You can deploy Battlesnake servers to any cloud platform, but for the sake of simplicity and ease-of-use we will use <a href="https://www.heroku.com/">Heroku</a>. Heroku is a platform that will run your code inside their infrastructure and give you a URL to access it. Setting up an account is easy and free to get started!</p><p>To deploy to Heroku, install their <a href="https://devcenter.heroku.com/articles/heroku-cli#download-and-install">CLI</a> tool and run the following commands:</p><pre>heroku create<br>git push heroku master<br>heroku open</pre><h3>Adding Battlesnake API Endpoints</h3><p>Now that we’ve deployed our code, let’s add the necessary endpoints to our API . Snakes need to implement four endpoints to play the game: /start, /move, /end, and /ping:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a512ca87b1cafe94713bc9b38e97e528/href">https://medium.com/media/a512ca87b1cafe94713bc9b38e97e528/href</a></iframe><p>Each endpoint represents a command used to control our snake using code (like in the image above). Of the four commands, the most important is the /move command. In the above app we’ve built a snake that only moves right on a game board (you can see “right” on line 10). The next step is to start programming logic to control which direction the snake should go. Can we make it turn up when it gets near a wall? I think we can, but let’s save that for another post!</p><h3>Signing up</h3><p>Now that we’ve built and deployed a basic node snake server, head over to <a href="https://play.battlesnake.io/">play.battlesnake.io</a> and register your snake to play against other developers!</p><h3>Looking for more?</h3><p>Here are some simple links to get you started:</p><ul><li>Documentation with “zero to snake” instructions:<a href="https://docs.battlesnake.io/"> docs.battlesnake.io</a></li><li>Node starter snake:<a href="https://github.com/battlesnakeio/starter-snake-node"> github.com/battlesnakeio/starter-snake-node</a></li><li>You can find the rest of the starter snakes for various languages here: <a href="https://github.com/battlesnakeio/community/blob/master/starter-snakes.md">https://github.com/battlesnakeio/community/blob/master/starter-snakes.md</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=34e642975e39" width="1" height="1" alt=""><hr><p><a href="https://medium.com/battlesnake/learning-to-build-an-express-api-for-battlesnake-34e642975e39">Learning to build an Express API for Battlesnake</a> was originally published in <a href="https://medium.com/battlesnake">Battlesnake</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Where is Serverless Going?]]></title>
            <link>https://medium.com/@colinjfw/where-is-serverless-going-bd99dd8a1a52?source=rss-d3de2703b18a------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd99dd8a1a52</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[development]]></category>
            <dc:creator><![CDATA[Colin Walker]]></dc:creator>
            <pubDate>Thu, 04 Oct 2018 13:22:09 GMT</pubDate>
            <atom:updated>2018-10-04T13:22:09.590Z</atom:updated>
            <content:encoded><![CDATA[<p>Serverless as an idea has an incredible amount of hype and a huge amount of tools around it right now. But where is Serverless going? How will it evolve over the next 5 to 10 years?</p><p>My interest in this stems from a developers perspective — what will change over the next period of my career because of Serverless. How significantly will it change the way we develop applications or the way in which we package and ship them. In it’s current form, I find Serverless incredibly fun and interesting, but it doesn’t feel like it’s matured fully. We are still at the bottom of a long hill that it will work it’s way up on.</p><p>I’ve spent some time collecting patterns and changes that I believe will become prevalent over the next 5 to 10 years with Serverless architectures.</p><h3>1. Event driven application architectures will become normal and easier</h3><p>Event driven application architectures are effective for developing generic and composable applications. They fit well in distributed systems and with Serverless functions. These applications will have better tooling and more support overall.</p><p>Currently, to build a distributed event driven application using Serverless tech takes a lot of planning and some complex architectural decisions. Events are currently not standardized across platforms like AWS and Google cloud. It will take some Devops effort to build these applications. This will continue to get easier and patterns will emerge much more.</p><p>CQRS and event sourcing are application architectures that fit nicely in a Serverless world. They model data and applications as separate interdependent components that work together. They also model communication as a flow of information. These architectures will become more common and popular in a Serverless world as they fit better with some of the constructs.</p><h3>2. Function composition components will emerge</h3><p>With more applications rushing in the direction of Serverless and functions being developed, there is a missing middle section. I have a function that reacts to events to perform some sort of action, imagine a translation function that will translate values into another language. To use this function my data storage layer needs to emit an event so that I can modify the document to add my new translations. Wiring this all up will require new configurations and paradigms.</p><p>AWS has jumped on this with step functions. I currently find them very cryptic to use but the kind of service that focuses on composing many disparate Serverless functions I think will emerge. You may be able to build an entire application out of using a composition or workflow service to wire together pre-built functions.</p><p>These may even be in the form of new languages. The <a href="https://ballerina.io/">ballerina</a> programming language is a language specifically designed as a sort of event bus programming language. It has constructs built in to more easily interact with API’s and other event sources. It is the glue code between functions built into a new language.</p><h3>3. Kubernetes will probably stay but be heavily hidden</h3><p>Kubernetes is too complex for most developers. With the emergence of opinionated event driven application architectures developers will be insulated from the complexity of all of the Kubernetes yaml files. This is a good thing. Kubernetes as a platform may drive most of the Serverless frameworks that will emerge but developers will work with more code and less config.</p><h3>4. Lambda will lose out in favour of Fargate</h3><p>Lambda and Fargate are two AWS Serverless compute solutions. One runs containers and one runs code inside specified runtimes. The lambda based solution is cost effective but limited, functions are required to run in under 3 minutes and are limited in terms of CPU and memory. These types of runtimes will begin to merge over time. A solution like Fargate which runs a generic application package will begin to become cheaper over time and more synonymous with Serverless.</p><p>A container, after all, is really just a packaging format for application code. It may contain more overhead than needed but it’s an incredibly useful format. The ability to run functions with any runtime or set of dependencies will eventually win out over the restricted versions that we see in Lambda today.</p><h3>5. Shipping an application will look more like wiring up functions</h3><p>Shipping a new application that performs common CRUD operations on a set of resources will look more like wiring up a set of functions. Developers will be able to deploy their favourite “Auth” function from a marketplace and wire this up using gateways or workflow engines. I think that overall once the concept of Serverless matures the benefit it gives to businesses is that developers can select from an incredibly diverse pool of modules to wire together to create their application. This will make development faster and easier.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd99dd8a1a52" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>