Introduction
We have seen together what Kubernetes was : an open source container orchestration system. Today, we will see how Kubernetes is built, how it works and 2 ways to deploy easily a lab environment
Kubernetes Architecture
In this first part, let’s see the basic concepts and components in a Kubernetes infrastructure.
Nodes
Nodes, or previously known as Minions, are virtual or physical machines on which k8s is installed. It’s where containers run and are deployed.
Cluster
If a Node fails, you need to have more than one node to be able to have your application available. A cluster is basically set of Nodes grouped together. It also shares the load between nodes.
Master Node
The “Master Node” watches other nodes on the cluster and is also responsible of orchestration of containers on worker nodes.
Kubernetes components
When you install Kubernetes on a system, you actually install the following components :
- API Server : frontend for Kubernetes
- etcd : this keystore is a distributed key-value store which helps kubernetes to store all data used to manage the cluster
- kubelet : agent that runs on each nodes of the cluster which verify that containers run as expected on nodes
- container runtime : software used to run containers (i.e docker)
- controller : the brain behind orchestration (noticing and responding when endpoints go down)
- scheduler : the scheduler is reponsible for distributing work accross nodes on the cluster
What components run on Master and Worker nodes
On the Master Node (which manage, plan, schedule, monitor nodes), you will find the following components :
- ETCD cluster
- API Server
- Controller Manager
- Scheduler
On worker nodes (which host application as containers), we will have the following components:
- Kubelet
- kube-proxy
- container runtime
Minikube
The first way to deploy a K8S lab environment is to install Minikube.
Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a Virtual Machine (VM) on your laptop for users looking to try out Kubernetes or develop with it day-to-day.
I invite you to follow the great documentation on Kubernetes.io : Here
Kubeadm
Another way to deploy K8S is by using kubeadm !
Kubeadm is a tool built to provide kubeadm init and kubeadm join as best-practice “fast paths” for creating Kubernetes clusters.
kubeadm performs the actions necessary to get a minimum viable cluster up and running. By design, it cares only about bootstrapping, not about provisioning machines. Likewise, installing various nice-to-have addons, like the Kubernetes Dashboard, monitoring solutions, and cloud-specific addons, is not in scope.
Instead, we expect higher-level and more tailored tooling to be built on top of kubeadm, and ideally, using kubeadm as the basis of all deployments will make it easier to create conformant clusters.
I invite you to follow the great documentation on Kubernetes.io : Here