Kubernetes is a system designed to manage containerized applications built within Docker containers in a clustered environment. It provides basic mechanisms for deployment, maintenance and scaling of applications on public, private or hybrid setups, means, it handles the entire life cycle of a containerized application. It also has intelligence of self-healing features where containers can be auto provisioned, restarted, or even replicated.
Kubernetes Components
etcd — A highly available key-value store for shared configuration and service discovery.
kube-apiserver — Provides the API for Kubernetes orchestration.
kube-controller-manager — Enforces Kubernetes services.
kube-scheduler — Schedules containers on hosts.
kubelet — Processes a container manifest so the containers are launched according to how they are described.
kube-proxy — Provides network proxy services.
Read More: What is Kubernetes, its basics and components
Okay, now let’s see how to setup multi-master kubernetes setup with kubeadm. Major advantage for this setup is keeping the cluster HA.
Prerequisites
In this example, we will be using an Ubuntu 18.04 as a base image for the seven machines needed. The machines will all be configured on the same network, 10.1.1.0/24, and this network needs to have access to the Internet.
As per the flow diagram, we are going to setup HAProxy first on machine 10.1.1.11. then we will be setup three Kubernetes master nodes. These machines will have the IPs 10.1.1.21, 10.1.1.22, and 10.1.1.23. Finally, lets setup three Kubernetes worker nodes with the IPs 10.1.1.31, 10.1.1.32, and 10.1.1.33.
We also need an IP range for the pods. Let’s set as 10.2.0.0/16, but it is only internal to Kubernetes.
In this setup we will be using ubuntu 18.04 installed to generate all the necessary certificates, and to manage the Kubernetes cluster. If you don’t have a Linux system, you can use the HAProxy machine to manage or generate the certificate.
Client Tools
We need two tools on the client machine: the Cloud Flare SSL tool to generate the different certificates, and the Kubernetes client, kubectl, to manage the Kubernetes cluster.
Installing cfssl
1. Download the binaries.
# wget https://pkg.cfssl.org/R1.2/cfssl_linux-amd64
# wget https://pkg.cfssl.org/R1.2/cfssljson_linux-amd64
2. Add the execution permission to the binaries.
# chmod +x cfssl*
3. Move the binaries to /usr/local/bin.
# mv cfssl_linux-amd64 /usr/local/bin/cfssl
# mv cfssljson_linux-amd64 /usr/local/bin/cfssljson
4. Verify the installation.
# cfssl version
Installing kubectl
1. Download the binary.
# wget https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/linux/amd64/kubectl
2. Add the execution permission to the binary.
# chmod +x kubectl
3. Move the binary to /usr/local/bin.
# mv kubectl /usr/local/bin
4. Verify the installation.
# kubectl version
Continue reading on Setup a multi-master Kubernetes cluster with kubeadm — FoxuTech