PODs in Kubernetes:

A POD is the smallest object, that we can create in kubernetes. It's a single instance of an application.kubernetes helps us to deploy our application in the form of containers on a set of machines that are configured as worker nodes in a cluster. However, kubernetes does not deploy containers directly on the worker nodes. The containers are encapsulated into a Kubernetes object which is known as PODs.

When the users increases we need to scale our application so we need to add additional instance of our application to share the load. We need to create new POD with a new instance of our application. A single POD can have multiple containers, except for the fact that they are usually not multiple containers of the same kind.

PODs usually have a one-to-one relationship with containers running your application. To scale UP we create new PODs and to scale down we delete PODs. With PODs, kubernetes does all of the configuration for us automatically. We just need to define what containers a POD consists of and the containers in a POD by default will have access to the same storage, the same network namespace as in they will be created together and destroyed together.

How to Deploy the PODs in Kubernetes:

	
 # Deploy the PODs in K8s :  	
	kubectl run [podname] --image [imagename]
	# Example : 
	kubectl run nginx --image nginx
		

How to get the list of running PODs in Kubernetes:

	
 # Deploy the PODs in K8s :  	
	kubectl get pods
		

How to see the detailed informatin of a POD in Kubernetes:

	
 # detailed informatin of a PODs in K8s :  	
	kubectl describe pod [pod-name]

	# Example : 
	kubectl describe pod myapp-pod
		

PODs Creation using YAML Configuration file:

Kubernetes uses YAML files as input for the creation of objects such as PODs, Replicas, Deployments, Services etc. All of these follow similar structure.

kubernetes definition file always contains 4 top level fields which is listed Below. These are top level or root level properties and we can think of them as siblings, children of the same parent. These are all REQUIRED fields, so we MUST have them in our configuration file.

Setup Visual Studio code for Yaml file

go to extensions -> search for YAML by Rad Hat -> click on setting gear icon -> go to YAML: Schema -> click on setting gear icon