If you’re going to successfully deploy containers in production, you need more than just container orchestration
Kubernetes is a valuable tool
Kubernetes is an open-source container orchestrator for deploying and managing containerized applications. Building on 15 years of experience running production workloads at Google, it provides the advantages inherent to containers, while enabling DevOps teams to build container-ready environments which are customized to their needs.
The Kubernetes architecture is comprised of loosely coupled components combined with a rich set of APIs, making Kubernetes well-suited for running highly distributed application architectures, including microservices, monolithic web applications and batch applications. In production, these applications typically span multiple containers across multiple server hosts, which are networked together to form a cluster.
Kubernetes provides the orchestration and management capabilities required to deploy containers for distributed application workloads. It enables users to build multi-container application services and schedule the containers across a cluster, as well as manage the health of the containers. Because these operational tasks are automated, DevOps team can now do many of the same things that other application platforms enable them to do, but using containers.
But configuring and deploying Kubernetes can be hard
It’s commonly believed that Kubernetes is the key to successfully operationalizing containers at scale. This may be true if you are running a single Kubernetes cluster in the cloud or have reasonably homogenous infrastructure. However, many organizations have a diverse application portfolio and user requirements, and therefore have more expansive and diverse needs. Read more
2017 Predictions: Rapid Adoption and Innovation to Come
Rapid adoption of container orchestration frameworks
As more companies use containers in production, adoption of orchestration frameworks like Kubernetes, Mesos, Cattle and Docker Swarm will increase as well. These projects have evolved quickly in terms of stability, community and partner ecosystem, and will act as necessary and enabling technologies for enterprises using containers more widely in production. Read more
Note: Since publishing this article, we’ve gotten requests for a downloadable version. You can request a copy here.
Recent versions of Rancher have added support for several common orchestration engines in addition to the standard Cattle. The three newly supported engines, Swarm (soon to be Docker Native Orchestration), Kubernetes and Mesos are the most widely used orchestration systems in the Docker community and provide a gradient of usability versus feature sets. Although Docker is the defacto standard for containerization, there are no clear winners in the orchestration space. In this article, we go over the features and characteristics of the three systems and make recommendations of use cases where they may be suitable.
Docker Native Orchestration is fairly bare bones at the moment but is getting new features at a rapid clip. Since it is part of the official Docker system, it will be the default choice for many developers and hence will have likely have good tooling and community support. Kubernetes is among the most widely used container orchestration systems today and has the support of Google. Lastly, Mesos with Mesosphere (or Marathon, its open source version) takes a much more compartmentalized approach to service managements where a lot of features are left to independent plug-ins and applications. This makes it easier to customize the deployment as individual parts can be swapped out or customized. However, this also means more tinkering is required to get a working setup. Kubernetes is more opinionated about how to build clusters and ships with integrated systems for many common use cases.
In a previous article in this series we looked at the basic Kubernetes concepts including namespaces, pods, deployments and services. Now we will use these building blocks in a realistic deployment. We will cover how to setup persistent volumes, how to setup claims for those volumes and then mount those claims into pods. We will also look at creating and using secrets using the Kubernetes secrets management system. Lastly, we will look at service discovery within the cluster as well as exposing services to the outside world.
We will be using go-auth as a sample application to illustrate the features of Kubernetes. If you have gone through our Docker CI/CD series of articles then you will be familiar with the application. It is a simple authentication service consisting of an array of stateless web-servers and a database cluster. Creating a database inside Kubernetes is nontrivial as the ephemeral nature of containers conflicts with the persistent storage requirements of databases.
Prior to launching our go-auth application we must setup a database for it to connect to. Prior setting up a database server in Kubernetes we must provide it with a persistent storage volume. This will help in making database state persistent across database restarts, and in migrating storage when containers are moved from one host to another. The list of currently supported persistent volume types are listed below: Read more
Most people running Docker in production use it as a way to build and move deployment artifacts. However, their deployment model is still very monolithic or comprises of a few large services. The major stumbling block in the way of using true containerized microservices is the lack of clarity on how to manage and orchestrate containerized workloads at scale. Today we are going to talk about building a Kubernetes based microservice deployment. Kubernetes is the open source successor to Google’s long running Borg project, which has been running such workloads at scale for about a decade. While there are still some rough edges, Kubernetes represents one of the most mature container orchestration systems available today.
Launching Kubernetes Environment
You can take a look at the Kubernetes Documentation for instructions on how launch a Kubernetes cluster in various environments. In this post, I’m going to focus on launching Rancher’s distribution of Kubernetes as an environment within the Rancher container management platform. We’ll start by setting up a Rancher server as described here and select Environment/Default > Manage Environments > Add Environment. Select Kubernetes from Container Orchestration options and create your environment. Now select Infrastructure > Hosts > Add Host and launch a few nodes for Kubernetes to run on. Note: we recommend adding at least 3 hosts, which will run the Rancher agent container. Once the hosts come up, you should see the following screen, and in a few minutes your cluster should be up and ready.
Prometheus is a modern and popular monitoring alerting system, built at SoundCloud and eventually open sourced in 2012 – it handles multi-dimensional time series data really well, and friends at InfinityWorks have already developed a Rancher template to deploy Prometheus at click of a button.
In hybrid cloud environments, it is likely that one might be using multiple orchestration engines such as Kubernetes and Mesos, in which case it is helpful to have the stack or application portable across environments. In this short tutorial, we will convert the template for Prometheus from Cattle format to make it work in a Kubernetes environment. It is assumed that the reader has a basic understanding of Kubernetes concepts such as pods, replication controller (RC), services and so on. If you need a refresher on the basic concepts, the Kubernetes 101 and concept guide are excellent starting points.