<?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 Jay Gorrell on Medium]]></title>
        <description><![CDATA[Stories by Jay Gorrell on Medium]]></description>
        <link>https://medium.com/@jaygorrell?source=rss-427d71b38415------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*qAoXQKnUTxsYIV7oQyjeSA.jpeg</url>
            <title>Stories by Jay Gorrell on Medium</title>
            <link>https://medium.com/@jaygorrell?source=rss-427d71b38415------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 14:42:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jaygorrell/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[Topps MLB NFT Distribution Concerns]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://jaygorrell.medium.com/topps-mlb-nft-distribution-concerns-2d8fc329c3a?source=rss-427d71b38415------2"><img src="https://cdn-images-1.medium.com/max/1024/0*n3vFpoOBUiYhTa6g" width="1024"></a></p><p class="medium-feed-snippet">Many concerns have been raised over the distribution of cards in the new Topps MLB packs and it seems they are completely valid.</p><p class="medium-feed-link"><a href="https://jaygorrell.medium.com/topps-mlb-nft-distribution-concerns-2d8fc329c3a?source=rss-427d71b38415------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://jaygorrell.medium.com/topps-mlb-nft-distribution-concerns-2d8fc329c3a?source=rss-427d71b38415------2</link>
            <guid isPermaLink="false">https://medium.com/p/2d8fc329c3a</guid>
            <category><![CDATA[nft]]></category>
            <category><![CDATA[nft-collectibles]]></category>
            <category><![CDATA[mlb]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Jay Gorrell]]></dc:creator>
            <pubDate>Thu, 22 Apr 2021 17:38:53 GMT</pubDate>
            <atom:updated>2021-04-27T01:51:28.132Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Orchestrating Deployments Across a Pool of Resources With Magic]]></title>
            <link>https://medium.com/upside-engineering/orchestrating-deployments-across-a-pool-of-resources-with-magic-f9e075c91200?source=rss-427d71b38415------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9e075c91200</guid>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[container-orchestration]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Jay Gorrell]]></dc:creator>
            <pubDate>Wed, 06 Dec 2017 14:44:54 GMT</pubDate>
            <atom:updated>2017-12-06T14:46:22.698Z</atom:updated>
            <content:encoded><![CDATA[<p>As mentioned in <a href="https://medium.com/@philarmour_/75d08307d572">an earlier post</a>, we decided to invest heavily in our CI/CD processes upfront at <a href="https://web.upside.com/?utm_source=blog&amp;utm_medium=medium-blog&amp;utm_campaign=EngineeringBlog&amp;utm_content=JayGMagic&amp;utm_promo=0">Upside</a>. The initial versions of this revolved around using CircleCI and Packer to build deliverable artifacts. We would then take these images and deploy them to our environments using Terraform and an internal orchestration tool called Sisyphus. You can read more about the history of this pipeline in a post from Upside’s CTO <a href="https://medium.com/u/f5573849e8d">Emily Dresner</a> <a href="https://engineering.upside.com/rolling-boulders-forever-uphill-devopsdays-dc-2017-summary-daebd764fdab">here</a>.</p><h3>The AMI Problem</h3><p>Using the strategy of an AMI-per-service was leading to unnecessary costs and inefficient deployments. Taking the smallest realistic size for a production deployment in AWS (t2.micro) and applying it to 80+ microservices over 3 availability zones, you are looking at a fairly sizable AWS bill on EC2 costs alone! Then consider:</p><ul><li>Some services demand much more than a t2.micro can handle, while others are rarely invoked</li><li>Every server has overhead to run basic monitoring and log collection</li><li>Building an artifact and deploying it are two independently slow tasks</li></ul><p>Things really began to stack up against the scalability of this pattern.</p><h3>Where We Are Now</h3><p>Skipping ahead to the current iteration, we are still leveraging Terraform heavily for infrastructure management — as well as for lambda and front-end (CloudFront + S3) deployments. API services, however, have been fully relocated from Packer-based AMIs to Docker containers.</p><p>For those unfamiliar, Docker is a lightweight way to package an application (complete with dependencies) into a container so that it can be run alongside other applications that may otherwise introduce conflicts — think somewhere between Python virtual environments and Virtual Machines. The problem then, is how do you manage containers within a host? Of course you can use traditional configuration management systems, but we can achieve much better than that with proper tooling. That’s where container orchestration comes in — or more specifically, <a href="https://kubernetes.io/">Kubernetes</a> in our case.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*PIvC7x8WFJtJc6ZgHFAnjA.png" /></figure><p>Kubernetes allows you to add a layer of abstraction on top of a cluster of instances so that they can be visualized as a pool of resources for container deployments. There are some <em>really</em> nice benefits to this setup.</p><h4>Resource Management</h4><p>Without the need to manage instance sizing for individual deployments, we can instead set scheduling claims for each deployment and let Kubernetes find a suitable host with the requested resources available.</p><p>Doing this is as simple as adding something like the following into your deployment manifests:</p><pre>spec:<br>  containers:<br>    resources:<br>      requests:<br>        cpu: &quot;100m&quot;<br>        memory: &quot;128Mi&quot;</pre><p>By annotating each deployment with resource requests, we can easily visualize our consumed capacity on each node to get a visualization of our resource availability as a whole.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*LX-HYPxigQHAeeKhMdMl5g.png" /><figcaption>Kubernetes also allows for runtime limits but we are currently only making use of scheduling requests</figcaption></figure><p>Traditional autoscaling metrics don’t quite make sense in a containerized environment, but we can now leverage resource requests as an alternative since we now know when our cluster is reaching it’s capacity limits.</p><h4>Cost Reduction</h4><p>By packing many services into the usually-wasted space of our nodes, we are able to run the same fleet of 80+ services in production across 6x m4.xlarge instances, while still maintaining the same high availability. This yields significant savings over the previous model.</p><h4>Deployment Time</h4><p>This is more of a container benefit than Kubernetes itself, but build process overhead has went from upwards of 15 minutes down to 2 minutes in many cases. Similarly, deployment times have plummeted from 10 minutes to under 30 seconds.</p><h3>Challenges</h3><p>Of course, there are some interesting challenges introduced here:</p><ul><li>Application logs and metrics</li><li>IAM Permissions on a shared host</li><li>Fitting Kubernetes into Terraform</li><li>Heavy workload isolation</li></ul><h4>Application Monitoring</h4><p><a href="https://www.fluentd.org/">Fluentd</a> is a great starting point for Kubernetes logging. By leveraging <a href="https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/">DaemonSet</a> deployments, you can easily handle log collection on a per-host basis by mounting the host’s /var/lib/docker directory into the container. Since we were on SumoLogic at the time for our logging platform, we were able to leverage <a href="https://github.com/SumoLogic/fluentd-kubernetes-sumologic">an open source project</a> dedicated to exactly that. This deployment will collect logs from all Kubernetes-managed containers on your hosts, annotate them with metadata to identify the source, and ship them off to SumoLogic.</p><p>When we later switched logging platforms, it was a simple matter of changing to the HTTP requests that post the log data to a format expected by the new platform— a painless transition. Similar <a href="https://github.com/DataDog/docker-dd-agent">solutions exist</a> for getting StatsD data into monitoring tools like DataDog as well.</p><h4>Application Permissions</h4><p>With each application getting it’s own set of EC2 instances, you can also provide them with dedicated roles and fine-tuned permissions. When many different services are sharing a single host, you probably want to avoid granting it the superset of all permissions needed by the services it runs.</p><p>A clever but simple solution is to use a project called <a href="https://github.com/jtblin/kube2iam">kube2iam</a>. What this project does is allow you to annotate your Kubernetes deployments with an IAM role and it will handle proxying the request to the AWS API itself using sts:AssumeRole, preventing the need for the instance itself to have any more permissions than that.</p><h4>Terraform Integration</h4><p>One of my favorite projects in the Kubernetes space is <a href="https://github.com/kubernetes/kops">kops</a> (Kubernetes Operations). The kops project is a cluster lifecycle management tool for Kubernetes on AWS — and best of all, it supports Terraform-based environments.</p><p>This means we use the kops CLI to manage our cluster changes but instead of having it apply them directly against the AWS API, we simply run:</p><pre>kops update cluster --target=terraform --name=CLUSTERNAME <br>                    --out=/path/to/terraform/files/</pre><p>This instead drops changes into our Terraform code where it can be applied like any other infrastructure changes we would normally make.</p><h4>Process Isolation</h4><p>Finally, we have some very heavy processes and we don’t want to run alongside critical customer-facing services. This is another concern solved with the help of kops — using <a href="https://github.com/kubernetes/kops/blob/master/docs/instance_groups.md">Instance Groups</a>.</p><p>What Instance Groups allow us to do is create a labeled autoscaling group that can be targeted by Kubernetes deployments. In kops, these looks like:</p><pre>~&gt; kops get instancegroups<br>NAME              ROLE   MACHINETYPE MIN MAX<br>app               Node   m4.2xlarge  6   6<br>worker            Node   m4.xlarge   3   3<br>master-us-west-2a Master m4.xlarge   1   1</pre><p>Inside the spec for the app Instance Group (kops edit ig app), we can then create a label that can be targeted by deployments:</p><pre>spec:  <br>  nodeLabels:<br>    usage: app</pre><p>Then finally in our deployment manifests, we can specify a nodeSelector attribute targeting the Instance Group label:</p><pre>spec:<br>  nodeSelector:<br>    usage: app</pre><h3>Summary</h3><p>Though Upside as a company is less than two years old, we recently crossed the one-year mark for services on our Kubernetes clusters <em>in production!</em> It hasn’t been without issue but it has worked surprisingly well without too many surprises. With Kubernetes and Upside both evolving quickly, I’m excited to see what more fun can be had with these systems.</p><p>Whatever comes next, you can be sure we’ll write about it here.</p><p>If this post piqued your interest, check out our open engineering positions and start working with <a href="https://www.linkedin.com/in/gorrelljay/">Jay</a> at Upside today: <a href="http://upsd.io/2BEEDLN">http://upsd.io/2BEEDLN</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9e075c91200" width="1" height="1" alt=""><hr><p><a href="https://medium.com/upside-engineering/orchestrating-deployments-across-a-pool-of-resources-with-magic-f9e075c91200">Orchestrating Deployments Across a Pool of Resources With Magic</a> was originally published in <a href="https://medium.com/upside-engineering">Upside Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Delivering Immutable Applications]]></title>
            <link>https://medium.com/upside-engineering/delivering-immutable-applications-acbde07ff040?source=rss-427d71b38415------2</link>
            <guid isPermaLink="false">https://medium.com/p/acbde07ff040</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[immutable]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[deployment]]></category>
            <dc:creator><![CDATA[Jay Gorrell]]></dc:creator>
            <pubDate>Wed, 19 Jul 2017 19:38:01 GMT</pubDate>
            <atom:updated>2017-07-19T19:38:01.774Z</atom:updated>
            <content:encoded><![CDATA[<p>When working with consistent application deployment, the over-arching goal is to deliver an artifact bundled with its dependencies in a way that discourages modification. When performed in a manner that is quick and easily repeated, you can effectively increase development velocity through faster iterations. Consequently, you will put yourself on the right path to building and delivering a <a href="https://12factor.net/">Twelve-Factor</a> app!</p><p>In traditional methods of application deployment, we would provision servers with the necessary dependencies before shipping the application itself. In general, this works fine for a new server. However, what happens when we need to upgrade a dependency on that machine for a new version of the application? Problems arise as from our inability to guarantee that the upgrade will be compatible with the currently-deployed code, or that the upgrade will work with other applications running on the server. We can’t even be sure that we would be able to safely roll back the changes if something goes wrong!</p><h4>Configuration Management</h4><p>Thankfully, helpful tools such as <a href="https://www.ansible.com/">Ansible</a> or <a href="https://www.chef.io/">Chef</a> deliver a promising workaround to these issues, allowing one to provision new servers for each deployment. While this fosters the capability to achieve immutable deployments, it also requires a modicum of discipline. Even if the dependencies only require a tiny change, you must precisely follow the process to build a new server with the application code. In practice, this grants a number of benefits:</p><ul><li>The existing server and application version are still available, in case something goes wrong and the server requires a rollback.</li><li>A developer can conduct testing to validate the new server before putting it into service.</li><li>Changes are baked into the code that builds the server for effortless repetition. This is critical for horizontal scaling.</li><li>Immutable deployments vastly improve server security by removing the need for anyone to directly access the production servers.</li></ul><p>Unfortunately, this approach has one clear downside: Speed. In-place updates provide us with the means to rapidly roll out minor updates to the server. However, building a new image and swapping out the previous one can easily take an hour or more. Luckily, we can employ containers, with the assistance of Docker, to help elegantly solve this issue.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/269/1*hClfljxq29JkJrgiwR_v5g.png" /><figcaption>Docker</figcaption></figure><h4>Containerization</h4><p>Containers allow us to build a unit to house our application and all of its dependencies in an inherently immutable format. This provides us with a consistent deployment unit, capable of being injected into any server and behaving the exact same, regardless of its coded environment.</p><h4>Branching Strategy</h4><p>We now have a way to create an immutable artifact with no external dependencies but let’s talk about branching strategies and how they can relate to the topic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8-zDz1s5Atux_yNW_mXmfg.png" /><figcaption>Gitflow Branching Strategy</figcaption></figure><p>One popular option called <a href="https://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/">Gitflow</a> (left) suggests using separate branches to represent different environments. This promotes the idea that an artifact should be built from the develop branch for the development environment and from the master branch for the production environment (or something along those lines). Unfortunately this introduces a potential difference in the artifact builds. In our attempt for immutability, we should build an artifact only once in order to deliver it to our environments.</p><p>The most straightforward way to do this is to take the left half of Gitflow and throw out the rest. That is — continue to open feature branches off a common root branch (we use master) and build an artifact off that branch. This artifact is the one you will deliver to development, QA, production… everywhere!</p><h4>What About Hotfixes?</h4><p>Though it may hinder immutability when building artifacts, Gitflow can still be a valuable tool for making improvements to hotfixes. When your production environment has its own version control branch (usually master), it’s simple to create a commit to that branch with the hotfix, thereby alleviating any concerns over deploying it with untested features.</p><p>When we are building artifacts from a single location, this isn’t as straightforward. At Upside, one option that has served us well is to trigger your build process on a second arbitrary branch name — let’s call it hotfix. Once you have set up the process, it should become much more straightforward:</p><ol><li>Check out the version of code in master by it’s gitsha</li><li>Make the desired hotfix and push to the hotfix branch</li><li>Build a new artifact from the code in the hotfix branch</li><li>Deploy this artifact to a testing environment (ideally), then production</li><li>Merge the hotfix back into master so it gets included with the latest artifacts being built</li></ol><h4>Other Benefits</h4><p>We covered gains in delivery speed, but a few other key benefits include:</p><ul><li>Simplified server provisioning — only need packages that are necessary to run a Docker container, regardless of what you’re actually delivering.</li><li>Ability to run Docker images anywhere, including another cloud provider or even locally.</li><li>Better resource utilization using multiple, non-conflicting containers.</li></ul><p>The aspect of speed gains is worth revisiting again. Since we are strictly following the idea of immutable deployments, every little change will require a new build — even a trivial one-line change. Furthermore, when following the practice of leaving the live server untouched, we care deeply about how long it takes to build a new artifact and release it to production. Through the employment of Docker image caching layers, we can, in certain cases, build a new image and have it into production in mere minutes.</p><p>The first bullet point here is equally important. You may be on AWS and, understandably, you may not be considering a move from it anytime soon. However, for debugging purposes, we cannot overstate the value of being able to run the exact image being deployed in production on your local system.</p><p>At Upside, we have taken the idea of creating immutable deployments seriously. In future posts, we’ll take a deeper look into the implementation details of our deployment pipeline!</p><p>Want to talk immutable deployments with Jay? Check out our open engineering positions and start working with Jay at Upside today: <a href="http://upsd.io/2gLn8Ed">http://upsd.io/2gLn8Ed</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=acbde07ff040" width="1" height="1" alt=""><hr><p><a href="https://medium.com/upside-engineering/delivering-immutable-applications-acbde07ff040">Delivering Immutable Applications</a> was originally published in <a href="https://medium.com/upside-engineering">Upside Engineering Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kubernetes Ingress]]></title>
            <link>https://jaygorrell.medium.com/kubernetes-ingress-82aa960f658e?source=rss-427d71b38415------2</link>
            <guid isPermaLink="false">https://medium.com/p/82aa960f658e</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Jay Gorrell]]></dc:creator>
            <pubDate>Tue, 25 Oct 2016 12:30:52 GMT</pubDate>
            <atom:updated>2016-12-01T18:14:36.094Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*JREC1jafLAinXiGjQL9QEg.jpeg" /></figure><p>A lot of people seem confused about how Ingress works in Kubernetes and questions come up almost daily in Slack. It’s not their fault, either — unfortunately the Kubernetes documentation is pretty weak in this area. Updating the documentation itself is probably a better use of time than writing this, I just prefer this …<em>medium</em>. I’ll try to do both, though!</p><h4>What is Ingress?</h4><p>It’s probably worth a quick introduction to clear things up. Traditionally, you would create a LoadBalancer service for each public system you want to expose. This can get rather expensive. Ingress gives you a way to route requests to services based on the request host or path, centralizing a number of services into a single entrypoint.</p><h4>Ingress Resources</h4><p>Ingress is split up into two main pieces. The first is an Ingress resource, which defines how you want requests routed to the backing services.</p><p>For example, a definition that defines an Ingress to handle requests for www.mysite.com and forums.mysite.com and routes them to the Kubernetes services named website and forums respectively would look like:</p><pre>apiVersion: extensions/v1beta1<br>kind: Ingress<br>metadata:<br>  name: my-ingress<br>spec:<br>  rules:<br>  - host: www.mysite.com<br>    http:<br>      paths:<br>      - backend:<br>          serviceName: website<br>          servicePort: 80<br>  - host: forums.mysite.com<br>    http:<br>      paths:<br>      - path:<br>        backend:<br>          serviceName: forums<br>          servicePort: 80</pre><p>The documentation on the Ingress resource itself really isn’t bad. You can find official examples <a href="http://kubernetes.io/docs/user-guide/ingress/#types-of-ingress">here</a>.</p><p>Here is where things seem to get confusing, though. Ingress on it’s own does not really do anything. You need something to listen to the Kubernetes API for Ingress resources and then handle requests that match them. This is where the second piece to the puzzle comes in — the Ingress Controller.</p><p>Ingress Controllers can technically be any system capable of reverse proxying, but the most common is Nginx. A full example Nginx Ingress Controller (and LoadBalancer service) is as follows. Please note that if you are not on a provider that supports LoadBalancer services (ie. bare-metal), you can create a NodePort Service instead and point to your nodes with an alternative solution that fills that role — a reverse proxy capable of routing requests to the exposed NodePort for the Ingress Controller on each of your nodes.</p><pre>kind: Service<br>apiVersion: v1<br>metadata:<br>  name: ingress-nginx<br>spec:<br>  type: LoadBalancer<br>  selector:<br>    app: ingress-nginx<br>  ports:<br>  - name: http<br>    port: 80<br>    targetPort: http<br>  - name: https<br>    port: 443<br>    targetPort: https</pre><pre>---</pre><pre>kind: Deployment<br>apiVersion: extensions/v1beta1<br>metadata:<br>  name: ingress-nginx<br>spec:<br>  replicas: 1<br>  template:<br>    metadata:<br>      labels:<br>        app: ingress-nginx<br>    spec:<br>      terminationGracePeriodSeconds: 60<br>      containers:<br>      - image: gcr.io/google_containers/nginx-ingress-controller:0.8.3<br>        name: ingress-nginx<br>        imagePullPolicy: Always<br>        ports:<br>          - name: http<br>            containerPort: 80<br>            protocol: TCP<br>          - name: https<br>            containerPort: 443<br>            protocol: TCP<br>        livenessProbe:<br>          httpGet:<br>            path: /healthz<br>            port: 10254<br>            scheme: HTTP<br>          initialDelaySeconds: 30<br>          timeoutSeconds: 5<br>        env:<br>          - name: POD_NAME<br>            valueFrom:<br>              fieldRef:<br>                fieldPath: metadata.name<br>          - name: POD_NAMESPACE<br>            valueFrom:<br>              fieldRef:<br>                fieldPath: metadata.namespace<br>        args:<br>        - /nginx-ingress-controller<br>        - --default-backend-service=$(POD_NAMESPACE)/nginx-default-backend</pre><p>This is essentially an Nginx image that monitors Ingress resources for requested routes to serve. One callout you may have noticed is that it specifies a --default-backend-service as a startup argument, passing in nginx-default-backend. This is wanting a service that can simply handle returning a 404 response for requests that the Ingress Controller is unable to match to an Ingress rule. Let’s create that as well with the specified name.</p><pre>kind: Service<br>apiVersion: v1<br>metadata:<br>  name: nginx-default-backend<br>spec:<br>  ports:<br>  - port: 80<br>    targetPort: http<br>  selector:<br>    app: nginx-default-backend</pre><pre>---</pre><pre>kind: Deployment<br>apiVersion: extensions/v1beta1<br>metadata:<br>  name: nginx-default-backend<br>spec:<br>  replicas: 1<br>  template:<br>    metadata:<br>      labels:<br>        app: nginx-default-backend<br>    spec:<br>      terminationGracePeriodSeconds: 60<br>      containers:<br>      - name: default-http-backend<br>        image: gcr.io/google_containers/defaultbackend:1.0<br>        livenessProbe:<br>          httpGet:<br>            path: /healthz<br>            port: 8080<br>            scheme: HTTP<br>          initialDelaySeconds: 30<br>          timeoutSeconds: 5<br>        resources:<br>          limits:<br>            cpu: 10m<br>            memory: 20Mi<br>          requests:<br>            cpu: 10m<br>            memory: 20Mi<br>        ports:<br>        - name: http<br>          containerPort: 8080<br>          protocol: TCP</pre><p>I said Ingress is made up of two main components and we introduced three new things. This is because the default backend isn’t really a piece of Ingress itself, but rather is something that the Nginx Ingress Controller requires. Other Ingress Controllers won’t necessarily have this component.</p><h4>Wiring it Up</h4><p>Assuming you’ve created the Ingress Controller above with the dependent default backend, your Ingress resources should be handled by the LoadBalancer created with the Ingress Controller service. Of course, you would need services named website and forums to route to in the above example.</p><p>As a quick test, you can deploy the following instead.</p><pre>apiVersion: extensions/v1beta1<br>kind: Ingress<br>metadata:<br>  name: demo-ingress<br>spec:<br>  rules:<br>  - host: mysite.com<br>    http:<br>      paths:<br>      - backend:<br>          serviceName: nginx<br>          servicePort: 80</pre><pre>---</pre><pre>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: nginx<br>spec:<br>  ports:<br>  - port: 80<br>    targetPort: 80<br>  selector:<br>    app: nginx</pre><pre>---</pre><pre>apiVersion: extensions/v1beta1<br>kind: Deployment<br>metadata:<br>  name: nginx<br>spec:<br>  replicas: 1<br>  template:<br>    metadata:<br>      labels:<br>        app: nginx<br>    spec:<br>      containers:<br>      - name: echoserver<br>        image: nginx<br>        ports:<br>        - containerPort: 80</pre><p>To test things out, you need to get your Ingress Controller entrypoint.</p><p>For LoadBalancer services that will be:<br>kubectl get service ingress-nginx -owide</p><p>For NodePort services, you can find the exposed port with:<br>kubectl describe service ingress-nginx</p><p>You should then be able to test the Ingress Controller entrypoint to get the a 404 response from the default backend:<br>LoadBalancer: curl [ELB_DNS] <br>NodePort: curl [NODE_IP]:[NODE_PORT]</p><p>If you match the Ingress rules, you will receive a default Nginx response:<br>LoadBalancer: curl -H &#39;Host:mysite.com&#39; [ELB_DNS]<br>NodePort: curl -H &#39;Host:mysite.com&#39; [NODE_IP]:[NODE_PORT]</p><h4>Wrap Up</h4><p>Hopefully this sheds a little light on the confusing Ingress resources. Once you have the Ingress Controller set up and respecting Ingress requests, I highly recommend going back to the Ingress <a href="http://kubernetes.io/docs/user-guide/ingress/#types-of-ingress">documentation</a> with a fresh understanding to learn different ways to route requests. There is also a rather <a href="https://github.com/kubernetes/kops/blob/master/addons/ingress-nginx/v1.4.0.yaml">complete example</a> of Ingress in the <a href="https://github.com/kubernetes/kops">Kops</a> repository.</p><p>As an alternative to Nginx (and the default backend!) you can look at systems like <a href="http://traefik.io/">Traefik</a>, which has <a href="https://docs.traefik.io/toml/#kubernetes-ingress-backend">native support</a> for Ingress. For a writeup on how to integrate this properly with Kubernetes, I highly recommend reading <a href="https://medium.com/u/223983dd6b18">Patrick Easters</a> article <a href="https://medium.com/@patrickeasters/using-traefik-with-tls-on-kubernetes-cb67fb43a948#.sfbh1mg5p">Using Traefik with TLS on Kubernetes</a>. It’s an excellent writeup that follows Kubernetes best-practices.</p><p>Another option to solve this problem is to use a system like <a href="https://getkong.org/">Kong</a>. While Kong does not support Kubernetes Ingress, it solves the same problem — you deploy it as a LoadBalancer service and register mappings to services with it. Only instead of using Ingress, you use the Kong API.</p><h4>References</h4><p>Everything here can really be found in the official documentation for the most part — it’s just that it’s not organized properly yet. Here are some links to the pieces I used so you can reference the real docs rather than trust a random guy on Medium. ;)</p><ul><li><a href="http://kubernetes.io/docs/user-guide/ingress/">Official Ingress Documentation</a>: While not perfect, it’s still the official documentation and I expect it will improve greatly with so much interest in Ingress</li><li><a href="https://github.com/kubernetes/contrib/blob/master/ingress/controllers/nginx/examples/default/rc-default.yaml">Nginx Ingress Controller</a>: I’ve essentially taken this one and only updated it to be a Deployment instead of a ReplicationController.</li><li><a href="https://github.com/kubernetes/contrib/blob/master/ingress/controllers/nginx/examples/default-backend.yaml">Default HTTP Backend</a>: Again, I’ve essentially just updated this example to use a Deployment instead of a ReplicationController.</li><li><a href="https://github.com/kubernetes/kops/blob/master/addons/ingress-nginx/v1.4.0.yaml">Full Example</a>: This lives in the Kops repository and is actually based on my changes with some tweaks added by Justin, the primary maintainer.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=82aa960f658e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker Orchestration on AWS]]></title>
            <link>https://jaygorrell.medium.com/docker-orchestration-on-aws-8f0da2f4acd9?source=rss-427d71b38415------2</link>
            <guid isPermaLink="false">https://medium.com/p/8f0da2f4acd9</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Jay Gorrell]]></dc:creator>
            <pubDate>Sun, 16 Oct 2016 23:53:41 GMT</pubDate>
            <atom:updated>2016-10-17T00:02:33.209Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ro2GP6UpUPcCUA-oiojnxg.jpeg" /></figure><p>The purpose of this article is to take a quick look at some top options available as Docker orchestration solutions for an AWS environment. For me, personally, this is research for a business decision, but why not share the results?</p><p>I know, I know… just another comparison article. That’s completely fair, too. However, I often find myself searching for the latest articles like this when evaluating choices, so I figured it couldn’t hurt to get some recent analysis out there as well.</p><h3>The Options</h3><p>There are plenty of options in this space so we’ll need to pick a few promising options based on what we already know. Because this is a space that changes rapidly, I’m going to favor large communities that can truly keep up with the pace. For that reason alone, Docker’s Swarm Mode and Kubernetes will be included. I’ll also take a look at EC2 Container Service because it’d be silly not to since we’re on AWS, and finally Rancher because it takes a unique approach to solving these problems. Obviously there are many other great choices available but these interest me personally for one reason or another.</p><p><strong>Swarm Mode </strong>— Docker | <a href="https://docs.docker.com/engine/swarm/">https://docs.docker.com/engine/swarm/</a><br><strong>Kubernetes (K8S)</strong> — Google / CNCF | <a href="http://kubernetes.io/">http://kubernetes.io/</a><br><strong>EC2 Container Service (ECS) </strong>— Amazon | <a href="https://aws.amazon.com/ecs/">https://aws.amazon.com/ecs/</a><br><strong>Rancher</strong> — Rancher Labs | <a href="http://rancher.com/">http://rancher.com/</a></p><h3>A Quick Overview</h3><p>To hit a few high-level points that may or may not matter to you, here are a few items I decided to dive into that were important to me in some form or another. Medium doesn’t support tables, so bare with me here!</p><h4><strong>Installation</strong></h4><p>Swarm Mode: None — included with Docker binaries.<br>Kubernetes: Bash scripts and other specific utilities<br>ECS: Single Binary<br>Rancher: Docker Container</p><h4>Job Definitions</h4><p>Swarm Mode: Docker CLI<br>Kubernetes: YAML or JSON<br>ECS: JSON or Docker Compose <br>Rancher: Docker Compose + Rancher Compose</p><h4>Popularity (Github)</h4><p>Swarm Mode: 4,059 Stars (based on Docker Swarm)<br>Kubernetes: 17,604 Stars<br>ECS: 395 Stars (CLI Only, Not Open Source)<br>Rancher: 4,380 Stars</p><h3>A Deeper Dive</h3><p>With that out of the way, let’s take a deeper look into our options. The goal here is to evaluate the features of each option and determine what seems like a good fit for our use-case, and potential growth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r_6OBjwyCaeRUqn6QcuQEg.png" /></figure><h4>Swarm Mode</h4><p>Previously called Docker Swarm, Swarm Mode has since been pulled into the Docker executable itself. This means it is automatically shipped with every system listed on this article and requires no further software to install — it even uses nearly identical CLI commands to single-node Docker systems.</p><p>Being part of Docker itself makes this an interesting area — you have to imagine that it will be getting a lot more development focus going forward. With that said, Swarm Mode is quite far behind some other options today, lacking options such as:</p><ul><li>API gateway / URI routing</li><li>Autoscaling</li><li>Management or monitoring UI</li><li>Scheduled Jobs</li><li>Secrets Management</li></ul><p>That’s not to say Swarm Mode is barebones by any means. It has already solved problems like dynamic port mapping (ex. running multiple containers on a specific port on the same host, without application awareness) and it handles service discovery with load balancing just fine by itself. Past that though, there are no real extras you’ll find here. Right now, I’d only recommend this option for the most basic of deployments but this may very-well change in the near future.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L2jmdKyYnSgFukQDAb4gzA.png" /></figure><h4>Kubernetes</h4><p>Kubernetes is easily the most feature-rich in consideration here — it’s also the most complicated. Setting up a Kubernetes cluster alone can be quite the task with so many disconnected options: there’s always <a href="https://github.com/kubernetes/kubernetes/blob/master/cluster/kube-up.sh">kube-up.sh</a>, CoreOS’s <a href="https://coreos.com/kubernetes/docs/latest/kubernetes-on-aws.html">core-aws</a> option, or the latest option of <a href="https://github.com/kubernetes/kops">kops</a> which targets not only AWS cluster creation but also the ongoing management of it.</p><p>If getting Kubernetes up and running hasn’t scared you off, the set of features it provides is rather incredible. In addition to solving the basics you’ll find in any orchestrator, it also provides enough to help solve nearly any deployment problem you can think of:</p><ul><li>External Exposure (via ELB) with <a href="http://kubernetes.io/docs/user-guide/ingress/">API gateway</a> routing options</li><li>Container <a href="http://kubernetes.io/docs/user-guide/horizontal-pod-autoscaling/">Autoscaling</a></li><li><a href="http://kubernetes.io/docs/user-guide/pods/">Sidekick containers</a> — or even sidekick volumes (see: <a href="http://kubernetes.io/docs/user-guide/petset/">Pet Sets</a>)</li><li><a href="http://kubernetes.io/docs/user-guide/deployments/">Deployments</a> with Rolling Updates</li><li><a href="http://kubernetes.io/docs/user-guide/secrets/">Secrets</a> and <a href="http://kubernetes.io/docs/user-guide/configmap/">Config</a> Management</li></ul><p>I had to cut myself off from rambling on with this list. Kubernetes is simply jam-packed with features — and the community behind it is quite amazing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hqEfHK2oiRrGLxKsP3EKuw.png" /></figure><h4>EC2 Container Service</h4><p>ECS is the managed option from AWS. Until <a href="https://aws.amazon.com/about-aws/whats-new/2016/08/amazon-ec2-container-service-now-integrated-with-application-load-balancer-to-support-dynamic-ports-and-path-based-routing/">recently</a>, I had a huge gripe with this option in that it didn’t solve the dynamic port mapping problem (explained above). This meant that if you had two services exposing port 80, there was no way to run them both on the same instance due to container-to-host port mappings being bound. Using different ports for each instance of the application doesn’t work since ELBs cannot target different ports for the same request.</p><p>Recently this has been <a href="https://aws.amazon.com/about-aws/whats-new/2016/08/amazon-ec2-container-service-now-integrated-with-application-load-balancer-to-support-dynamic-ports-and-path-based-routing/">solved</a> by integrating ECS with Application Load Balancers (ALBs), which were introduced by AWS earlier this year. This makes ECS a much better contender in my opinion.</p><p>With these changes, ECS does provide some nice features:</p><ul><li>API gateway using ALBs</li><li>EC2 Instance Autoscaling</li><li>Rolling Updates</li><li>IAM Integration</li></ul><p>One thing that does bother me a bit with this option, though, is that being closed-source there is no way to truly run an ECS environment locally and achieve that development-to-production parity.</p><p>Assuming that doesn’t bother you and vendor lock-in isn’t a concern, ECS is a very viable option for low to mid-complexity deployments on AWS. It does miss out on some advanced features found in other systems but if you’re just looking to deploy services with zero-downtime rolling updates and have some control over the routing, this is a great choice. Integration with IAM for security is a very convenient benefit as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*yrjhx7KPuPZ6KBaXUAAbiA.jpeg" /></figure><h4>Rancher</h4><p>Rancher takes a completely different approach here, making it a little difficult to evaluate. Instead of trying to beat the competition, Rancher is attempting to abstract away the choices by giving you a consistent interface to use Docker Swarm, Kubernetes, Mesos, or their own scheduler called Cattle.</p><p>For it’s [relatively] smaller community and company, Rancher is doing very well keeping up in this space. Using the Cattle scheduler, you get a great system with some of the essentials:</p><ul><li>Management and Monitoring UI</li><li>API gateway / URI routing</li><li>Sidekick Containers</li><li>Single-Node support</li></ul><p>If that isn’t enough, you can always swap out Cattle for Kubernetes and get access to every feature in Kubernetes!</p><p>The installation of Rancher is one of the really neat features here. Both the server and client are Docker images, making it very easy to deploy to an existing system… or even locally. Let me also just say that Rancher’s management UI is simply stunning — far above the competition, including Kubernetes Dashboard.</p><h3>Conclusion</h3><p>This is tough. Every option has it’s benefits and drawbacks. As much as I’d like to go with the “there is no right choice” route, I’ll at least offer the closure of providing my choices.</p><p>With the limited features of Swarm Mode and the lack of a local parity option for ECS, my decision based on personal demands came down to Kubernetes and Rancher — I’ve decided to go with Kubernetes. Why? Because I’m working with a large and complex system with many moving parts and I want to handle the complexity of requests going forward.</p><p>While Rancher is capable of abstracting away the complexity of creating a Kubernetes cluster, I felt that running an abstraction that may potentially introduce issues isolated from the greater Kubernetes community could lead to a limited set of available support.</p><p>As for the complexity of creating a Kubernetes cluster, tools like <a href="https://github.com/kubernetes/kops">Kops</a> have taken great steps to improving that experience. If you have looked at Kubernetes in the past and turned away after seeing kube-up.sh, I highly recommend you give Kops a try.</p><p>With all that said, I use and will continue to use Rancher for my personal projects. Kubernetes is more demanding on resources, requiring at least an m4-series EC2 for the master, and a t2.medium or higher for the nodes. With Rancher, you can run the client and server containers on the same t2.micro instance without an issue — this gives you that beautiful UI without the overhead of separate and expensive server instances to support.</p><p>Swarm Mode and EC2 Container Services have both seen major updates recently so I wouldn’t take my eyes off them quite yet. They may fit your criteria already, but if not, keep your eyes open… this space moves quick!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8f0da2f4acd9" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>