Getting Started with a Production-Ready Clusters
Learn how to set up a cluster for a production-ready environment.
We'll cover the following
Creating a Kubernetes cluster is not trivial. We have to make many choices, and we can easily get lost because of too many options. The number of permutations is getting close to infinite and yet, our clusters need to be configured consistently.
Cluster setup
Let’s compare Docker Swarm and Kubernetes for setting up a cluster.
Docker Swarm
Unlike Docker Swarm, which packs almost everything into a single binary, Kubernetes clusters require quite a few separate components running across nodes. Setting them up can be very easy, or it can become a challenge. It all depends on the choices we make initially. One of the first things we need to do is choose a tool that we’ll use to create a Kubernetes cluster.
If we decide to install a Docker Swarm cluster we need to install the Docker engine on all the servers and execute docker swarm init
or docker swarm join
command on each of the nodes. That’s it. Docker packs everything into a single binary. The Docker Swarm setup process is as simple as it can get.
Kubernetes
The same cannot be said for Kubernetes. Unlike Swarm, which is highly opinionated, Kubernetes provides many more options. It is designed around extensibility. We need to choose among many different components. Some of them are maintained by the core Kubernetes project, while others are provided by third parties. Extensibility is probably one of the main reasons behind Kubernetes’ rapid growth. Almost every software vendor today is either building components for Kubernetes or providing a service that sits on top of it.
Exploring the Options
Besides the intelligent design and the fact that it solves problems related to distributed, scalable, fault-tolerant, and highly available systems, Kubernetes’ power comes from adoption and support from many different individuals and companies. You can use that power as long as you understand that it comes with responsibilities.
It’s up to us to choose what our Kubernetes cluster will look like and which components it’ll host. We can decide to build it from scratch or use one of the hosted solutions like Google Cloud Platform (GCE) Kubernetes Engine. There is a third option, though. We can choose to use one of the installation tools. Most of them are highly opinionated, but with a limited amount of arguments we can use to tweak the outcome.
You might be thinking that creating a cluster from scratch using kubeadm
cannot be that hard. You’d be right if running Kubernetes is all we need. But it isn’t. We need to make it fault-tolerant and highly available. It needs to stand the test of time. Constructing a robust solution requires a combination of Kubernetes core and third-party components. We need familiarity with AWS and many custom scripts that can tie the two together. We won’t go into the details for now.
Our choice
We’ll use Kubernetes Operations (kOps) to create a cluster. It is somewhere in the middle between do-it-yourself-from-scratch and hosted solutions (e.g., GCE). It’s an excellent fit for both beginners and professionals. You’ll learn which components are required for running a Kubernetes cluster. You’ll be able to make some choices.
Typically, this would be a great place to explain the most significant components of a Kubernetes cluster. You were probably wondering why we didn’t do that early on when we began the journey. Still, we’ll postpone the discussion for a while longer. It’ll be better to create a cluster first and discuss the components through live examples.
Let’s create a cluster first and discuss its components later.
Since we have already mentioned that we’ll use kops to create a cluster, in the next lesson, we’ll start with a very brief introduction to the project behind it.
Get hands-on with 1200+ tech skills courses.