Tag: Kubernetes
14 Oct 2016 in Kubernetes, OS X, Kube Solo

Run Kubernetes on a Mac with Kube Solo

Kubernetes is one of the best known container orchestration tools, but often, setting up a dev environment with Kubernetes is a daunting task. This is especially true for people who are just getting started with containers and orchestration in general.

Fortunately, now that Docker for Mac is generally available, you can easily run both Docker and Kubernetes on OS X allowing you to quickly develop, containerize, and work with your applications as if they were in production. But what if you want to get up and running with Kubernetes on OS X?

In this post, I will show you how to set up a Kubernetes dev environment on OS X with a tool called Kube-Solo.

Read More
29 Sep 2016 in Kubernetes

What's New With Kubernetes 1.4

Kubernetes announced the release of version 1.4 this week, and already, the response has been great.

The Kubernetes 1.4 release improves Kubernetes' installability, and includes a new tool, kubeadm, to help with this. It also includes support for stateful applications and improves user experience and security.

In this post I'll take a quick look at these new features.

Read More
27 Sep 2016 in Socket.IO, Kubernetes

Running Socket.IO Applications on Kubernetes

Socket.IO is a JavaScript library that enables real-time bidirectional event-based communication. It primarily uses the WebSocket protocol, with polling as a fallback option.

In this post, I'm going to go through the challenges faced when running a WebSocket based application on Kubernetes, and how to deal with these challenges.

I'll be considering an AWS based setup. A similar approach would work for other environments as well.

Read More
26 Sep 2016 in Kubernetes, resource

Kubernetes the Hard Way

Kubernetes is already the most popular container orchestration platform, and expected to keep the top spot in coming year as well. So, if you are planning to get onto Kubernetes bandwagon, this is a good time. And if you’re not up to speed with what Kubernetes does, this post is a good place to start.

One of the best things about Kubernetes is that it's very easy, almost trivial to launch your own Kubernetes cluster using automation scripts. But, launching a cluster is seldom the end goal. You want to use your Kubernetes cluster to orchestrate some containers. And, if you’re just playing around and want see how it works, automation defeats the purpose.

So, the bottom line is: it’s important you understand what goes on behind the scenes.

How do you do this? By learning Kubernetes the hard way. By specifically making sure that you know what’s going on under the hood when you run a script.

There’s a resource that helps you do this. It’s called Kubernetes The Hard Way. And with 2500+ GitHub stars and 150+ forks, this guide is one of the most extensive guides out there to help you learn Kubernetes.

Read More
20 Sep 2016 in Kubernetes, adoption, business

Approaching Kubernetes Adoption in Your Organization

Kubernetes is great. I know that and you know that. But if you're not using it in your organization yet, how do you convince your colleagues? How do you convince the business?

One of the ways you can improve your chances is by borrowing from the study of user experience. And when it comes to Kubernetes adoption, the user is not just one person or team. It's more far reaching, as I'll explain.

User experience (UX) is a fascinating part of software development. In many ways, it is the art behind the science. It has to accommodate a whole range of different human beings, with varying experiences, knowledge, and needs.

When you think of Kubernetes, it's natural to think of the UX as the way you interact with the cluster itself. As an engineer, this makes perfect sense. But what about other parts of your organization, including those completely outside of engineering? How does the platform you run your business on affect them?

To get Kubernetes into production, you have to understand who your customers (i.e. users) are inside the company and get them on board. And doing so will require careful planning and thoughtful consideration that puts people first, processes second, and tools last—even though that might seem counterintuitive.

In this post, I will look at how technology adoption works in practice, and how to improve your chances of success introducing Kubernetes to your organization.

Read More
12 Sep 2016 in Docker, DAB, Kubernetes, Kompose

Push a Docker DAB to a Kubernetes Cluster in Two Commands!

Docker Distributed Application Bundles (DABs) are "an experimental open file format for bundling up all the artifacts required to ship and deploy multi-container apps." DABs contain a complete description of all the services required to run an application, along with details about which images to use, ports to expose, and networks used to link services.

A little over a month ago, I wrote about DABs and outlined how they can be used with multi-tier apps to develop locally with Docker Compose and then bundled for deployment to a Docker Swarm cluster.

In this post, I will expand on my previous post and show how DABs can be used to make an artifact that is deployable on a Kubernetes cluster.

Why? Because by doing this we can take advantage of the awesome develop experience that the Docker tools provide to deploy artifacts to a production-ready Kubernetes cluster without needing a whole bunch of Kubernetes experience. Win win.

Note: DAB files are still experimental as of Docker 1.12.

Read More
9 Sep 2016 in Kubernetes, logging, Sumo Logic, Logentries

Off-Cluster Kubernetes Logging With Sumo Logic and Logentries

One of the best parts of my job as a solutions architect for Deis is working with an amazing array of talented engineers at companies solving truly interesting problems.

I was recently working with a company on the forefront of wearable fitness trackers. Their modest but world-class engineering team had reached the outer limits of what could be done with Ansible-based Docker deployments in AWS.

While everything worked, there were areas of API entanglement, and a lack of orchestration that created duplicated effort and an inefficient use of EC2 resources. The company is clearly on a rocketship growth trajectory, so scaling and efficient systems management are forefront on everyone's mind.

Fortunately, they also recognized that the time to pivot to more efficient and scalable architecture is while they're still in an early growth phase.

Kubernetes provides the perfect fit for their use-case because it allows a more atomic service distribution, scaling, and painless service discovery. Also, when the infrastructure below the cluster is configured with autoscaling, rapid growth should be no problem.

In this blog post, I'll take a look at one aspect of the work I did with them: how I got logs shipped off-cluster to Sumo Logic. I will also draw a link to some work I did for another company to send logs to Logentries.

Read More
7 Sep 2016 in Helm, Kubernetes

Trusting Who's at the Helm

Last year at KubeCon in San Francisco, I first learnt about Helm—a sort of Homebrew for Kubernetes. It seemed too good to be true, so I dug deeper. Fast forward to today, and I find myself packaging applications with Helm.

In this post, I'll talk briefly about why Helm is so exciting, and then show you how to install and use one of the packages I wrote.

Why Use a Package Manager?

A team I worked with was deploying various components to Kubernetes, including: Zookeeper, etcd, Consul, Cassandra, Kafka, and Elasticsearch. Each one of these components was using a manifest file that someone on the team had written by hand, and then these manifest files had been improved over time. Each change, each improvement, reflecting some sort of knowledge or experience the team had gained.

But there are many teams across the world deploying these same components. And let's face it, most deploy situations are similar enough. So each one of these teams is, for the most part, duplicating each other's work.

But what if there was a way to avoid that? What if we could organise that collective knowledge and bring people together to collaborate on it.

Read More
30 Aug 2016 in Kubernetes, logging, Elasticsearch, Kibana

Kubernetes Logging With Elasticsearch and Kibana

Developers, system administrators, and other stakeholders need to access system logs on a daily (sometimes even hourly) basis.

Logs from a couple of servers are easy to generate and handle. But, imagine a Kubernetes cluster with several pods running. Handling and storing logs in itself becomes a huge task.

How does the system administrator collect, manage, and query the logs of the system pods? How does a user query the logs of their application, which is composed of many pods, all of which may be restarted or automatically created by Kubernetes?

Thankfully, Kubernetes supports cluster level logging.

Cluster level logging allows collecting logs for all the pods in the cluster, at a centralized location, with options to search and view the logs.

There are two ways you can use the cluster level logging: either via Google Cloud Logging or Elasticsearch and Kibana.

It is important to note here that the default logging components may vary based on the Kubernetes distribution you are using. For example, if you are running Kubernetes on a Google Container Engine (GKE) cluster, you'll have Google Cloud Logging. But if you're running your Kubernetes cluster on AWS EC2, you'll have Elasticsearch and Kibana available by default.

In this post we'll focus on Kubernetes on an AWS EC2 instance. We'll learn how to set up a Kubernetes cluster on an AWS EC2 instance and ingest logs into Elasticsearch and view them using Kibana.

But first, let's make some introductions.

Read More
16 Aug 2016 in monitoring, Deis, Kubernetes, Heapster

Monitoring Kubernetes with Heapster

In my last post we saw how to install Deis Workflow on AWS EC2 and then deploy an Express.js application using the git push trigger. With Deis Workflow taking control of the build process, it all looked very smooth.

But, understanding how an app behaves after deployment is crucial for scaling the application and providing a reliable service.

To do that, we need to measure and analyze the performance of our apps. And in this post, we're going to look at how we can start to do that with Heapster, InfluxDB, and Grafana. This technique will work with Kubernetes by itself, and with Deis Workflow.

Read More
3 Aug 2016 in Kubernetes, autoscalers

Autoscalers the Hard Way

In a previous post, we showed you how to build a custom Kubernetes scheduler with Elixir.

That post was inspired by a recent talk by Kelsey Hightower.

Kelsey also tweeted:

I would take this logic and apply it to autoscalers too.

While everyone doesn’t need to go and build their own autoscaler, it can be beneficial to understand how they work. And one of the best ways to gain that experience is by trying your hand at writing your own.

Read More
27 Jul 2016 in Kubernetes, scheduler, Elixir

Scheduling Your Kubernetes Pods With Elixir

Kelsey Hightower gave a really interesting talk at ContainerSched about how to create your own scheduler using the Kubernetes HTTP API.

The talk was awesome. It's incredible to see what kind of things you can do with a base system as good as Kubernetes.

However, I missed one thing. The example provided by Kelsey was a Go application. Which is the main language used with Kubernetes. So, if you look at that code without any context, you might think it's using some kind of Kubernetes internal packages. But it's not! It's a standalone piece of code that happens to make some HTTP calls.

To illustrate this point, I decided to write my own scheduler, in a different language. In my case, Elixir, because that's the language I happen to be learning at the moment.

This post isn't an intro to Elixir, but the code should be easy to follow.

Also, I'm going to use localhost when accessing the Kubernetes API. Why? For simplicity. If we run kubectl proxy on a computer connected to the Kubernetes master, we will not need to deal with authorization, hosts, and so on. The proxy command will do it for us.

So, let's dive in.

Read More
21 Jun 2016 in Deis Workflow, fleet, Kubernetes

Deis Workflow: Migrating From fleet to Kubernetes

This month, we released Deis Workflow.

This was the second major release of the Deis v1 PaaS.

One of the big changes under the covers (and the reason we bumped the major version number) was the shift from fleet to Kubernetes. There are several fundamental changes that needed to occur for this to happen.

In this post I'm going to look at some of the challenges, and the solutions we came up with as we migrated from one scheduler to another. Hopefully others can learn from our experience.

Read More
16 Jun 2016 in Kubernetes, Book

The Children's Illustrated Guide to Kubernetes

Introducing Phippy, an intrepid little PHP app, and her journey to Kubernetes.

What is this? Well, I wrote a book that explains Kubernetes. We posted a video version to the Kubernetes community blog. If you find us at a conference, you stand a chance to pick up a physical copy. But for now, here's a blog post version!

And after you've finished reading, tweet something at @opendeis for a chance to win a squishy little Phippy toy of your own. Not sure what to tweet? Why don't you tell us about yourself and how you use Kubernetes!

The Other Day...

The other day, my daughter sidled into my office, and asked me, "Dearest Father, whose knowledge is incomparable, what is Kubernetes?"

Alright, that's a little bit of a paraphrase, but you get the idea.

And I responded, "Kubernetes is an open source orchestration system for Docker containers. It handles scheduling onto nodes in a compute cluster and actively manages workloads to ensure that their state matches the users' declared intentions. Using the concepts of "labels" and "pods", it groups the container which make up an application into logical units for easy management and discovery."

And my daughter said to me, "Huh?"

And so I give you...

The Children's Illustrated Guide to Kubernetes

Read More
8 Jun 2016 in Kubernetes

Finding The Right Local Kubernetes Development Environment

In the Kubernetes world, there's no single source of truth and rarely can you find a single recommended best-practice. This is nice (diversity!) but can also get quite confusing if you're just getting started.

There are many local development environments out there, so in this post, I'll take a look at a few of them and give you a bit of help choosing one that works for you.

Disclaimer: This is in no way a complete guide. I have limited it to just three common cases. If you think I've overlooked an important option, just shoot me a message and I might add it to the list.

Read More
27 May 2016 in Kubernetes, Intro

Getting Started With Kubernetes

Kubernetes is a very popular open source container management system.

The goal of the Kubernetes project is to make management of containers across multiple nodes as simple as managing containers on a single system. To accomplish this, it offers quite a few unique features such as traffic load balancing, self-healing (automatic restarts), scheduling, scaling, and rolling updates.

In this post, we'll learn about Kubernetes by deploying a simple web application across a multi-node Kubernetes cluster. Before we can start deploying containers however, we first need to set up a cluster.

Read More
26 May 2016 in Helm, Kubernetes, Annoucement

Helm 2 Reaches Alpha 1

This release marks the first in the Helm 2 line. It is an unstable Alpha-quality release that supports the core functionality for the Helm 2 platform.

Helm 2 has two major components:

  • The Helm client, whose responsibility is to provide tooling for working with charts and uploading them to the server.
  • The Tiller server, whose responsibility is to manage releases into the Kubernetes cluster.

Additionally, Helm can fetch charts from remote repositories. A Helm 2 chart repository is simply an HTTP server capable of serving YAML and TGZ files.

As a developer preview, the Alpha 1 release does not have a binary build of its components. The quickest route to get started is to fetch the source, and then run make bootstrap build. To start using Helm, use helm init.

Stay in touch

To keep up with news on Helm, join the #Helm channel on the Kubernetes Slack channel, or join our weekly developer call every Thursday at 9:30-10:00 Pacific.

You are welcome to join! https://engineyard.zoom.us/j/366425549

Click Play

During the May Deis Community meeting I took a few moments to talk about the general direction and core values for the Helm project. Click play for my presentation:

19 May 2016 in GlusterFS, GCE, GKE, Kubernetes

Bootstrap a GlusterFS Cluster on GCE

As we've covered before, shared file systems are a tricky problem in the cloud. One solution to that problem is a distributed file system. Something each one of your app nodes can read from and write to. When it comes to distributed file systems, GlusterFS is one of the leading products.

With a few simple scripts on your Mac OS X or Linux machine, you can deploy a multi-zone High Availability (HA) GlusterFS cluster to Google Compute Engine (GCE) that provides scalable, persistent shared storage for your GCE or Google Container Engine (GKE) Kubernetes clusters.

In this post, I will demo these scripts and show you how to do this. By default, our GlusterFS cluster will use three GlusterFS servers, one server per Google Cloud zone in the same chosen region.

Read More
6 May 2016 in Kubernetes, GKE, Tutorial

Spinning Up Your First Kubernetes Cluster on GKE

So you've read about Kubernetes and maybe Google Cloud Platform, but you've never spun up a cluster for yourself. Fret not. In this post, we'll take you through the basics, and by the end of it, you'll have a three node cluster up and running.

Create Your Google Cloud Project

If you don't already have a Google account, you must create one before you continue.

Sign in to your Google Cloud Platform console and create a new project:

Then pick the project name:

Note down the project ID. This is a unique name across all Google Cloud projects. Later in this post, we will refer to this as PROJECT_ID.

Next, enable billing in the console. You need this to access Google Cloud resources. Next, enable the Container Engine API and Compute Engine API. You must complete all three steps before continuing.

Read More
3 May 2016 in Kubernetes, Overview, Series: Kubernetes Overview

Kubernetes Overview, Part Two

In my previous post we looked at kubectl, clusters, the control plane, namespaces, pods, services, replication controllers, and labels.

In this post we take a look at at volumes, secrets, rolling updates, and Helm.

Volumes

A volume is a directory, possibly with some data in it, accessible to a container as part of its filesystem. Volumes are used used, for example, to store stateful app data.

Kubernetes supports several types of volume:

  • emptyDir
  • hostPath
  • gcePersistentDisk
  • awsElasticBlockStore
  • nfs
  • iscsi
  • glusterfs
  • rbd
  • gitRepo
  • secret
  • persistentVolumeClaim
Read More
28 Apr 2016 in Deis Workflow, Announcement, Kubernetes

Deis Workflow, Beta 3

Time keeps on slippin', slippin', slippin', into the future. But not Deis Workflow Beta releases.

The team just cut Beta 3 of Deis Workflow. We've been happy with the two-week release cadence. Keep your eyes out for Beta 4 due May 11th and our Release Candidate May 25th.

Now, for beta highlights!

Read More
27 Apr 2016 in Kubernetes, Overview, Series: Kubernetes Overview

Kubernetes Overview, Part One

Kubernetes is an open-source system for managing containerized applications across multiple hosts in a cluster.

Kubernetes provides mechanisms for application deployment, scheduling, updating, maintenance, and scaling. A key feature of Kubernetes is that it actively manages the containers to ensure the state of the cluster continually matches the user's intentions.

Kubernetes enables you to respond quickly to customer demand by scaling or rolling out new features. It also allows you to make maximal use of your hardware.

Kubernetes is:

  • Lean: lightweight, simple, accessible
  • Portable: public, private, hybrid, multi cloud
  • Extensible: modular, pluggable, hookable, composable, toolable
  • Self-healing: auto-placement, auto-restart, auto-replication

Kubernetes builds on a decade and a half of experience at Google running production workloads at scale, combined with best-of-breed ideas and practices from the community.

Kubernetes supports Docker and rkt containers, with more container types to be supported in a future.

In this miniseries, we’ll cover Kubernetes from the ground up.

Let’s start with the basic components.

Read More
24 Mar 2016 in Deis Workflow, Announcement, Kubernetes

Deis Workflow, now in Beta!

We are excited to announce that we have recently cut a beta release for the next major release of Deis! As many of you know, for 2.0 we’ve decided to re-platform the PaaS from CoreOS’s Fleet onto Kubernetes. This gives us a stable cluster manager, a better scheduler, a smaller overall footprint (potentially a single machine!), and a great Kubernetes community to work with. This lets us focus our efforts on making it as easy as possible to deploy and scale your applications.

To borrow from the late, great David Bowie, beta brings along with it some Ch-ch-ch-ch-changes!

Read More
15 Mar 2016 in Trip Report, Kubernetes, KubeCon

KubeCon Trip Report

KubeCon is the Kubernetes community conference, in its second year of running now. I had the pleasure of attending KubeCon in London last week, and I came away from it an even bigger fan of Kubernetes than I already was.

I was impressed to find out that less than two years after the first Kubernetes release, there are already over 1,200 new GitHub projects using Kubernetes. What’s even more exciting is the news that Kubernetes has moved to the Cloud Native Computing Foundation.

In this post, I’ll share my experience of the event and cover the stuff I learned.

Read More
19 Feb 2016 in Kubernetes, Google Cloud Platform, Google Compute Engine

Internal Load Balancing on Google Container Engine

Internal load balancing is important for many infrastructures. But, if you've tried to do it for Google Container Engine, you'll know there's no prepackaged solution. Well, fear not. I've written a tool to help you out. So keep reading.

To quote the Google Cloud Compute Engine (GCE) docs:

An internal load balancer distributes network traffic on a private network that is not exposed to the Internet. Internal load balancing is useful not only for intranet applications where all traffic remains on a private network, but also for complex web applications where a frontend sends requests to backend servers via a private network.

Read More
14 Jan 2016 in Announcement, Helm, Kubernetes

The Helm 0.3 Release Line Is Here

Helm is a package manager for Kubernetes.

Helm 0.3.0 was released last week, and 0.3.1 was released this week with a few minor bug fixes.

The 0.3 release line of Helm introduces several improvements to linting. It also introduces two new Helm commands: helm generate and helm template. These pave the way for generic template support in Helm, and provide a plugin architecture for implementing arbitrary template engines. Also, Helm charts now have a source: field for specifying a URL to the source used to create the chart's resources.

In addition to these new features, many bugs in the 0.2 release line have been found and fixed. Several parts of the codebase have been refactored for easier maintainability and better testing.

Read More
22 Dec 2015 in KubeCon, Kubernetes

KubeCon Videos, Day Two

KubeCon, which took place this November, was the first community conference for users and contributors to Kubernetes. It's goal was to deliver expert technical talks designed to spark creativity and promote Kubernetes education.

As part of our sponsorship of KubeCon, we're happy to be able to post the talk videos. In this post, we're sharing videos from day two of the conference. In our previous post, we shared the videos from day one.

Read More
15 Dec 2015 in KubeCon, Kubernetes

KubeCon Videos, Day One

KubeCon, which took place this November, was the first community conference for users and contributors to Kubernetes. It's goal was to deliver expert technical talks designed to spark creativity and promote Kubernetes education.

As part of our sponsorship of KubeCon, we're happy to be able to post the talk videos. In this post, we're sharing videos from day one of the conference. In the follow-up post, we share the videos from day two.

Two sessions are currently missing. This is the unfortunate result of a sound recording glitch. We're working with an external company to get these ready for release.

Read More
3 Dec 2015 in Announcement, Helm, Kubernetes

Helm 0.2.0 Released

Since KubeCon 2015, the Helm team has been hard at work bringing you a new release.

Helm 0.2.0 contains numerous bug fixes, some code refactoring, and several enticing new features.

Highlights:

  • Helm has been moved to github.com/helm/helm and the core charts are now at github.com/helm/charts
  • helm lint helps you validate your charts.
  • helm repo add|rm|list lets you easily manage your own chart repositories.
  • Support for Kubernetes 1.1 beta 1 kinds (DaemonSet, Job, etc.) as well as custom kinds.
  • helm install and helm uninstall are smarter! In fact, many commands are improved.
  • Helm now supports git-style plugins.
  • Many, many bug fixes.

We're already hard at work on Helm 0.3 and have some exciting new features in the works.

Follow along on our GitHub Milestone for 0.3.0.

17 Nov 2015 in Helm, Kubernetes

Why Kubernetes Needs Helm

Earlier this week, Deis released Helm—the package manager for Kubernetes. Conceptually similar to Homebrew, Helm makes it easy to install standard workloads on Kubernetes.<!--more-->

But... Kubernetes is a container platform, so why does it need a package manager?

Perhaps looking at OS-level package managers (like Homebrew, apt, yum/rpm, ports, and so on) will help explain the situation.

Why use apt, yum, or homebrew?

Let's take a typical scenario.

I'm sat at the terminal in the chilly server room. I tried the command again: ./configure && make. Page after page of information scrolled across the screen. Apache httpd was building. I flipped open my book to read a few pages while I waited. Several minutes later, I saw the make command fail. I just wanted a stock Apache httpd server, but I couldn't figure the right combination of build flags, nor could I find and install all of the correct dependencies.

In frustration, I gave up and tried the radical approach: I switched operating systems.

Then when the time came to install Apache httpd, I simply typed apt-get install apache. And hey presto! It worked. If I needed to make changes, I could head to the /etc/httpd directory and configure away. But even prior to that I had a functioning web server. Apache httpd was working right out of the box.

Read More
9 Nov 2015 in Helm, Kubernetes, Announcement

Introducing Helm, The Kubernetes Package Manager

We at Deis are really excited about Kubernetes. In fact, we're hard at work building Deis v2 on top of a Kubernetes base. During this integration, we developed a tool that we think seasoned Kubernetes users will enjoy, and newcomers can use as an onramp for running containerized applications. And today, we're thrilled to announce this new tool.

We call it Helm, and it's the first package manager for Kubernetes.

Inspired by Homebrew, apt, and npm, Helm is a tool for working with Kubernetes-powered applications. It works like this:

  • A Helm package is bundled up as a chart.
  • The charts are collected together in a repository that you can search. Helm uses git under the hood for storing and organizing chart data.
  • Using the helm tool, you can find, customize, manage and install these charts.

Helm makes it easy run apps and services inside Kubernetes.

Helm's Goals

We built Helm to help with two things.

First, we want to make it simple to share information about running common apps and services inside of Kubernetes. When we all share our charts, the Kubernetes community at large learns how best to work with Kubernetes. We share information and discover great ways of doing things. And we also make it easier for newcomers to get going. Helm is about growing Kubernetes.

Second, we want to make it easier for teams to manage their Kubernetes manifest files. So we created a tool that eases the process of collaborating on and keeping track of your team's charts. Start with widely available charts, customize them to your team's needs, and then store them in your own version control. Helm is about helping teams.

Kubernetes is a powerful platform. We want to make it easy to manage the apps and services you deploy.

Read More
27 Oct 2015 in Kubernetes, Development, Containers

Zero to Kubernetes Dev Environment on OS X

Many people we talk to are interested in experimenting with Kubernetes but find that putting together a development environment is daunting.

Kubernetes Solo OSX (Kube Solo) provides a lightweight, simple Kubernetes enviroment that is easy as a few clicks.

Kube Solo wraps coreos-xhyve and runs in your Mac's status bar. With a few clicks Kube Solo provisions a CoreOS server and boostraps Kubernetes development environment.

Since Kube Solo is based on xhyve there is no need to have VirtualBox and Vagrant installed on your Mac.

Read More