2. Agenda
• History
• What is Kubernetes
• Why Kubernetes
• Architecture
• Architecture Components
• Kubelet
• Kubectl
• KubeADM
• kubefed
• Minikube
• Helm
• Rancher
• Learning and Practice
3. Kubernetes ( K8S )
• Google developed an internal system called BORG then they have changed its name OMEGA to deploy
and manage 1000 google applications.
• 2014 it became Open-Source and donated it to CNCF (Cloud Native Computing Foundation).
• brings K8s very First.
• Then adopted by Azure.
• AWS brings K8S very later.
5. • Kubernetes is an open-source container orchestration platform
• it automates
• Container Deployment,
• Container Scaling.
• Load balancing ( eg. - all containers must have equal number of request)
• It also schedules, Run, Manage containers which are running on physical virtual or cloud
machines
(based on our requirement like we want to create 200 containers after 2 hours, delete 100 containers
after 3 hrs )
• All top cloud providers support K8S.
• It creates cluster of containers.
• It provides scalability to containers.
• It provides High Availability to containers.
• Kubernetes Doesn’t create Images.
What Is Kubernetes? Cont….
6. Features of Kubernetes?
• Containers cannot communicate each other.
• Auto scaling (Vertical and Horizontal)
• Load Balancing
• Auto Healing
• Platform independent
• Fault Tolerance
• Rollback
• Health Monitoring of Containers
• Health Monitoring of Pods
• Batch Execution(One time, Sequential, Parallel)
7. Why Kubernetes? Cont….
• With Monolithic Apps Scaling is very Hard to manage
• Monolithic Apps are difficult to manage.
• High Availability is not there for Monolithic Apps.
• All the above issues resolved via microservices. Therefore Monolithic apps are replaced
by Microservices.
• Eg 1 – we want to create 100 numbers of containers from the same image – we cannot
run docker run command these many number of times manually
• Even though if it is possible but if we want to create 200-300 containers of each image of
an application that is having 40/50 images this work is very hard to manage manually.
• Eg 2 - suppose I need to reduce the number of containers based on the usage even
though we cannot delete these many number of containers.
• It means scaling should be automated. (based on users access).
• That is done by kubernates.
• Kubernetes supports all Docker, Rocket, ContainerD
8. Why Kubernetes? Cont….
• Docker Swarm does the things what Kubernetes Does.
• But Docker Swarm only manages Docker Containers only, while K8S Supports all kinds of
Containers(Docker/Rocker/ContainerD).
• Kubernetes is more popular, it is better than Docker-Swarm.
• Market of Docker Swarm 11%
• While market share of Kubernetes is 57%.
11. Architecture Components – Master Node / Controller Manager
• Control Manager
• Handles what should be there or what should not be there. This is the component that
maintains the balance between Actual state and desired state.
• Logically, each controller is a separate process, but to reduce complexity, they are all
compiled into a single binary and run in a single process.
• These controllers include:
• Node Controller: Responsible for noticing and responding when nodes go down.
• Replication Controller: Responsible for maintaining the correct number of pods for every replication controller
object in the system.
• Endpoints Controller: Populates the Endpoints object (that is, it joins Services and Pods).
• Service Account and Token Controllers: Create default accounts and API access tokens for new namespaces.
12. Architecture Components – Master Node / Controller Manager
• API Server
• Most Important component(other components talk to each other via API Server)
• The API server is a component of the Kubernetes control plane that exposes the Kubernetes
API. The API server is the front end for the Kubernetes control plane.
• ETCD
• Database / Storage system. (Eg. It keeps the record of how many instances are there and
how many are required ).
• Consistent and highly-available key value store used as Kubernetes' backing store for all
cluster data.
• KubeScheduler
• Controller manager gives the instruction to Kube Scheduler to perform any task. (Main
Action is done by Kube Schedular )
• Control plane component that watches for newly created Pods with no assigned node,
and selects a node for them to run on.
13. • Pod –
• Basic Component /Logical Unit of K8s,
• A pod is a group of one or more containers,
• Inside a pod containers are tightly coupled because they share access to the same volume.
• If pod gets corrupted/destroyed then it never repaired, always a new pod is created.
A Cluster is a group of Nodes.
A Cluster is a group of Master and worker nodes.
Architecture Components – Worker Node/Minion
14. • Kubelet
• Control the pods, informs master about the pod Health / and status. Like –
• how many Containers should be there in the pod,
• what should be there in the pod.
• This is the only component/Agent that communicates wth API Server on Master Node
• It Listens to Kubernetes Master. And use port 10255 to run.
• It sends/shares Pod Creation status success/failure to the master.
• Kube Proxy – Handles Networking related work.
• Assign IP Address to each POD (IP Address never assigned to Container, it always assigned to POD)
• If two POD wants to communicate each other then it is done via Kube-Proxy.
• Id pod restarts then assigned IP Address will be changed.
• Container Engine – Docker / ContainerD / Rocket
• Works with Kubelet
• Pulls Images,
• Start/Stop Containers.
Architecture Components – Worker Node/Minion
15. Kubelet
• Kubelet is the primary
“node agent” that runs
on each node and is
used to register the
nodes in the Kubernetes
cluster through the API
server.
• After a successful
registration, the primary
role of kubelet is to
create pods and listen to
the API server for
instructions.
16. Kubectl
• The Kubernetes
command-line
tool, kubectl, allows
you to run commands
against Kubernetes
clusters.
• You can use kubectl to
deploy applications,
inspect and manage
cluster resources, and
view logs.
17. Kubeadm
• Kubeadm is a tool built to
provide kubeadm init and
kubeadm join as best-
practice "fast paths" for
creating Kubernetes
clusters.
• It is the command to
bootstrap the cluster.
• kubeadm init to bootstrap
a Kubernetes control-
plane node
• kubeadm join to bootstrap
a Kubernetes worker node
and join it to the cluster.
18. Kubefed
• KubeFed
(Kubernetes Cluster
Federation)
• Allows you to use a
single Kubernetes
cluster to coordinate
multiple Kubernetes
clusters.
• It can deploy multiple-
cluster applications in
different regions and
design for disaster
recovery.
19. Minikube
• It is a utility you can
use to run
Kubernetes (k8s) on
our local machine.
• It creates a single
node cluster
contained in a virtual
machine (VM).
• This cluster lets you
demo Kubernetes
operations without
requiring the time
and resource-
consuming
installation of full-
blown K8s.
20.
21. Helm
• K8S can become very complex with all the objects(Config Maps, Services, Pods, Persistence
Volumes, … ) that we need to handle and multiply by the number of releases that we want.
• All the above objects will be managed easily by HELM.
• HELM is a simple way of packaging all of them into One simple application. It also advertising
what we can configure.
• Helm is a package manager for Kubernetes
• With Helm the Deploy, Manage, and Maintain process will become easier.
• Helm fills the need to quickly and reliably provision container applications through easy install,
update, and removal.
• Helm is the K8s equivalent of yum or apt commands.
• If we want to package release over 1.0 and make only certain parts configurable , we can do that.
• With version 2.0 we can configure certain more parts configurable.
• We can simply install by One Click, or we can configure it suite our needs.
22. Rancher (RKE)
• It’s a Kubernetes installer that provides a UI and API.
• The users can easily access Kubernetes clusters.
• They can also access KubeCTL, which is an integrated tooling layer providing log management, CI/CD,
alerting, etc.
• It is a lightweight Kubernetes installer. It can launch Kubernetes on any computers, including:
A. Bare-metal servers
B. On-premise virtual machines
C. Virtual machines hosted by an infrastructure provider
Rancher is ideal for firms seeking a proven
multi-cloud container management platform
available on a wide variety of cloud platforms
and edge environments.
23. Learning / Practice
• Kubernetes Playground
• Play with Kubernetes
• Play with Kubernetes Classroom
• Google Kubernete Engine (GKE)
• Azure Kubernete Services (AKS)
• Amazon EKS (Elastic Kubernete Service)
• MiniKube
• KubeADM