Introduction to DevOps with Kubernetes
上QQ阅读APP看书,第一时间看更新

Introduction

Running microservice applications in containers solves problems related to scalability, reliability, and robustness; however, it comes with own its drawbacks. In the previous chapter, a database and blog application were run in Docker containers. If you want to run multiple databases and blogs across numerous servers, there are a couple of issues to consider. For instance, networking should be configured to enable communication between database and blog instances. In addition, the storage of the database instances should be handled so that no data is lost. Furthermore, there should be a method to handle failures at the application and hardware levels. Kubernetes is the answer to solve all these problems, plus many more to run microservice applications in containers in a scalable, reliable, and robust way. In this chapter, the history and architecture of Kubernetes are presented first. After that, accessing Kubernetes clusters is covered, and, finally, Kubernetes concepts and resources are introduced.

What is Kubernetes?

Kubernetes is actually a Greek word meaning ship captain. As ships carry a vast number of containers overseas, it is an excellent analogy for managing containers in the massive ocean of data centers. Kubernetes is also abbreviated as k8s to indicate the eight letters between "k" and "s" in both developer communities and source code. Kubernetes started as an open source project backed by Google in 2014. It is the outcome of 15 years of experience in managing containers for almost every Google product, such as Search or Gmail.

From a technical point of view, Kubernetes is a platform for running and managing containers. Kubernetes enables the running of microservice applications, defined as a set of containers on a Kubernetes cluster. It focuses on the complete life cycle of containers to provide scalability and high availability. With Kubernetes, it is possible to define the number of instances of a database application and interaction points with the outside world. You can also scale up or down manually or with usage level, roll out new updates, or redirect customer traffic. Kubernetes provides building blocks to define and manage complex cloud-native applications with a high level of flexibility and reliability.

There are many container orchestration tools in the market, such as Mesos, Docker Swarm, Amazon Elastic Container Service, and Kubernetes. All of these tools have an active community and many organizations adopt them. However, Kubernetes puts itself forward among others with Google support, a significant amount of popularity, and many success stories, including GitHub, GoDaddy, and Workday.

With more than 76,000 commits and nearly 50,000 stars on GitHub, Kubernetes is the most popular open source repository, as shown in Figure 3.1. Its vast popularity and fast adoption in the industry made Kubernetes the de facto container management solution:

Figure 3.1: Kubernetes GitHub repository

In the following section, the Kubernetes architecture is discussed to give an overall idea of how Kubernetes manages microservices in containers.