In the previous chapter, we used Docker to pre-build and package different parts of our application, such as Elasticsearch and our API server, into Docker images. These images are portable and can be deployed independently onto any environment. Although this revised approach automated some aspects of our workflow, we are still manually deploying our containers on a single server.
This lack of automation presents the risk of human error. Deploying on a single server introduces a single point of failure (SPOF), which reduces the reliability of our application.
Instead, we should provide redundancy by spawning multiple instances of each service, and deploying them across different physical servers and data centers. In other words, we should deploy our application on a cluster.
Clusters allow us to have high availability, reliability, and scalability. When an instance of a service becomes unavailable, a failover mechanism can redirect unfulfilled requests to the still-available instances. This ensures that the application, as a whole, remains responsive and functional.
However, coordinating and managing this distributed, redundant cluster is non-trivial, and requires many moving parts to work in concert. These include the following:
- Service discovery tools
- Global configuration store
- Networking tools
- Scheduling tools
- Load balancers
- ...and many more
Cluster Management Tools is a platform which manages these tools and provides a layer of abstraction for developers to work with. A prime example is Kubernetes, which was open-sourced by Google in 2014.
In this chapter, we will learn how to:
- Make our application more robust by deploying it with Kubernetes on DigitalOcean
- Understand the features of a robust system; namely availability, reliability, throughput, and scalability
- Examine the types of components a Cluster Management Tool would normally manage, how they work together, and how they contribute to making our system more robust
- Get hands-on and deploy and manage our application as a distributed Kubernetes cluster