2. What is k8s?
1. Initial release in 2014.
2. 100% open source and written in Go programming language.
3. Based on internal project at Google known as Borg (Borg is
specifically used for cluster management)
4. Donated to cloud native computing foundation.
5. It is platform for working with containers
6. It is not restricted to use Docker as a container but can be used
with other container technologies.
7. It is container orchestration tool
8. Enables you to run your application on thousands of
computational nodes as all of these nodes separate computing
resources.
9. It abstract underlying infrastructure. Application run
irrespective of it running on single physical machine or virtual
machine.
10. Currently major cloud providers provide support for using
Kubernetes e.g AWS, Azure, GCP
11. It helps us to
Application deployment
Scale up/down
Application monitoring.
Importance of k8s
Currently multiple cloud providers provide their own
proprietary cluster services but since K8s is completely open
source and can be run on native cloud environment as well.
Steps required for execution remain same irrespective of
environment.
Important Components of K8s
1. Docker container
On most basic level we will wrap our java based micro services
in jar or war which are then used to create docker image.
2. POD
POD
1. POD is components specific to K8s.
2. One POD can consist of multiple interdependent
docker containers. In real life we will have rare
Scenario where interdependent containers present in
one POD.
3. Containers running in same POD can
Share n/w :- communicate with other containers on
local host
Share volume: - can share files with other containers in
same POD.
4. Every POD get its own IP but no guarantee it will be
remain same since it can be stopped or restarted.
5. Pods are managed (creation, deletion) by replica set.
(another component managed by k8s internally)
3. Replica sets
1. In real life scenario we might need to run multiple
copies (Replicas) of same POD.
2. Replica set is responsible for managing POD
Can start new POD if less number of PODS running
than required PODS
Can kill existing POD if more number of PODS
running than required
Responsible for running health check for POD.
4. Deployment
It mainly contains replica set and application specific details
5. Service
1. Service acts as an application load balancer
2. Provide IP or DNS name for accessing POD.
6. Cluster
1. It is set of physical or virtual machines. These machines
also known as nodes
2. It is made up of one master node and one to many
worker nodes
3. Master node
It is heart and soul of K8s.
It control and manages K8s.
Responsible for managing worker nodes
4. Worker node
Containers are running on these worker nodes.
Cluster can have one or many worker nodes.
These nodes can be physical or virtual machines
Replicaset:-
replicacount3
POD 1
POD 3
POD 2
Deployment
Replicaset
POD
Container
jar
Service
(NodePort/LoadBalancer
3. Master Node
1. It consists of multiple components which can be present on
single machine or on multiple machines for High availability.
2. API server: - Useful for communication with other master
nodes.
3. Scheduler :- It schedules our application i.e. assigning worker
node to each deployable component
4. Controller :- Control various cluster level operations such as
Replicating components
Keeping track of worker nodes
Handling node failure
5. Etcd :- Reliable distributed data source store cluster
configuration
Worker nodes
1. It runs our containerized applications
2. It consist of three components
Container run time :- It can be docker or rkt
Kubelet :- One which talk to API server and manages
containers on its own.
3. Kube proxy :- Responsible for load balance between
application components.
3.
etcd
Controller
API server
Scheduler