Not from class

Difference between POD, Deployment and container

ContainerPodDeployment
Has docker filehas yaml fileyaml
command docker run nginxkubectl create -f pod.yamlkubectl create -f deployment.yaml

Controller: - Ensures desired state is always present in the cluster. Pod:- A wrapper around container that maintain desired state. ReplicaSet - A controller that carries autohealing behaviour.

Login to kubernetes cluster with minkube minikube ssh

Deplyoyment - Is an abstraction.

Controller is golang application which ensures specific behaviour is implemented. eg. - ReplicaSet behaviour ensures desired replicas are always present.

Autohealing - spawns the containers with different ip addresses hence we create service

svc ---- 1. load balancer |-------- 2. Service Discovery | |------- labels and selector |-------- 3. expsoing to the world

autohealing without service ---- deployment pod ---- 172.16.3.4 — user 1 rs1---- 172.16.3.5 — user 2 rs2 --- 172.16.3.6 — user 3

but if one pod gets deleted auto healing will create another pod with different ip address and user not knowing new ip address unable to access it

hence service comes in handy

Service (eg. load balancer) will have single ip and all users will get ip of service and service will distribute traffic among pods and rs.

but when pods gets respawn with new ip how does service knows its ip for that service has this feature called service discovery

how service does service discovery unlike manually keeping track of ip addresses which can change everytime service use labels and selectors mechanism. service maintains service discovery through labels and selectors. label will be common for all the app and service will only be watching for the labels.

Service is also use for exposing your application to outside world. service is allow application to access outiside k8s cluster.

You can create service of 3 types

Service.YAML |_ _ _ _ _ 1. Cluster IP (inside accessible) [ you get discovery and lb] |_ _ _ _ _ 2. Node Port (inside organisation or network\ access worker node ) |_ _ _ _ _ 3. Load balancer ( service is accessible to external world)

load balancer only work for cloud based k8s like EKS

load balancer — amazon.com Node Port - VPC and nodes CLUSTER IP - Cluster Network