Define kubernetes in Siddharth’s words
Limited Time Offer!
For Less Than the Cost of a Starbucks Coffee, Access All DevOpsSchool Videos on YouTube Unlimitedly.
Master DevOps, SRE, DevSecOps Skills!
what is kubernetes ?
In a microservice architecture if we are running contanierized application workload, kubernetes can help to manage those container workloads hosted on multiple nodes, it works as an orchestrator for container workloads and manage the lifecycle, operations, security, networking, auto-scaling of pods
- kubernetes was originally designed by google and later acquired by CNCF who manages it now.
- kubernetes was written in Go/Golang
- Kubernetes is an orchestrator tool to manage container workloads usually hosted on multiple hosts. it can manage 1000s of container workloads
- kubernetes provides loadbalancing feature to pods hosted on multiple hosts
- kubernetes provides networking solution between pods and nodes
- nginx service can be hosted on same port in different pods and kubernetes can manage it.
- kubernetes helps to auto-scale the container workloads
- kubernetes simplifies the build deployments and deployments can be completed in few mins.
why kubernetes ?
- in a microservice architecture if we are running contanierized application workload, kubernetes can help to manage those workloads hosted on multiple nodes, it works as an orchestrator for container workloads and manage the lifecycle, operations, security, networking, auto-scaling of pods
- Kubernetes is an orchestrator tool to manage container workloads usually hosted on multiple hosts. it can manage 1000s of container workloads
- kubernetes provides loadbalancing feature to pods hosted on multiple hosts
- kubernetes provides networking solution between pods and nodes
- nginx service can be hosted on same port in different pods and kubernetes can manage it.
- kubernetes helps to auto-scale the container workloads
- kubernetes simplifies the build deployments and deployments can be completed in few mins.
what are the components of kubernetes ?
- Master node: This is also called control plane which manages or orchestrate the cluster operations.
- master node consists of 4 components
- etcd (cluster store): this is a key value database and cluster state and config are stored here, every operation in cluster and its state is captured in this database via kube apiserver
- kube apiserver: this is the primary component or face of master node which orchestrates the cluster communication between various other componenets and worker nodes. it communicates with scheduler and controller manager and updates the states in etcd database. kubelet from worker node also communicates with kube apiserver
- scheduler: this component of master node decides or schedules the pods on nodes, this interacts with apiserver and pass the information about scheduling pods on desired node and then apiserver send this info to kubelet to place the pods on desired nodes.
- controller manager: it consists of various controller like node controller, replication controller, namespace controller, etc.the role of this componenet is to manage nodes, pods etc and make sure to keep them in desired state. if we have defined 4 pods in yaml definition file and one of the pod does down, then replication controller manager will send the info to apiserver to update the number of pods to 4 via scheduler –> kubelet on worker nodes.
- Then we have worker nodes in kubernetes which actually performs the workload , it consists of 3 componenets.
- kubelet: this agent is installed on every worker node and it interacts with apiserver on master node to perform operations on worker nodes, eg placing pods on nodes
- kube proxy: this is a networking solution or interface to establish communication between pods and nodes , because of this component every pod is able to communicate with other pods on different nodes
- docker run time engine: which is responsible to run containers inside pod
what is pod ?
- pod is a logical or virtual wrapper around containers
- pod is the smalled object of kubernetes.
- single pod can have multiple container running inside it
- there can be sidecar container running along with main container in pod
- we can not create pod and it can be instantiated as it is a logical component.
- lifecycle of pod is pending running, successfull/failed
- pod to pod communication happen via kube-proxy installed on nodes
- pods are ephemeral, which mean that we can replace the similar pod but it can not be same.