POD

POD is a unit of deployment which runs containers. Containers are not directly deployed in kubernetes nodes. Containers are encapsulated into a pod and pod are created or deployed inside the node. If you need to scale your application, you can create as many pod as you need. PODs are created in one node or many nodes in your cluster, and each pod can run the container image of your app pulling it from container registry - Docker Hub, AWS ECR etc. If you scale down your apps, kubernetes will delete the pods from node and containers will be eventually deleted as pods are getting deleted. However, you can deploy more than one container inside one POD but containers other than main application container known as helper container. This is known as multi-container pod. for example, you may want to run one separate container - monitoring container along with with your app container in one pod. However, multiple instances of the same containers are not run inside same pod.

POD Definition file

Kubernetes objects - like pods, services,deployments, replicaset etc. are all deployed into cluster using kubernetes definition file. Every definition file contains four root level fields. These are required fields and must be present in the definition file. apiVersion determines the version of kubernetes. kind mentions the type of object - like POD, Service, Deployment, REplicaset etc. To create a POD, it will be Pod. metadata field contains child attrbiutes name, labels. Here labels are like tags you can use any name-value pair you want. These labels field are used to filter or group the pods later on. spec defines the specification of the image and other fields. To Create a pod, you need to run command - kubectl create -f pod-definition.yaml
To get all pods, run kubectl get pods
To get description of any pod, run kubectl describe pod myapp-pod
Next