DEV Community

Cover image for PODS in Kubernetes for Developers
KodeKloud
KodeKloud

Posted on • Originally published at kodekloud.com

PODS in Kubernetes for Developers

Here, we will take a look at PODS.

  • POD introduction
  • How to deploy a pod?

Kubernetes doesn't deploy containers directly on the worker node.

  • The containers are encapsulated into a Kubernetes object called POD.
  • A POD is a single instance of an application.
  • A POD is the smallest object that you can create in Kubernetes

Here is a single-node Kubernetes cluster with a single instance of your application running in a single docker container encapsulated in the pod.

Alt Text

A Pod usually has a one-to-one relationship with containers running your application.

  • To scale up, you create a pod, and to scale down, you delete a pod.
  • You do not add additional containers to an existing POD to scale your application. Alt Text

Multi-Container PODs

  • A single pod can have multiple containers except for the fact that they are usually not multiple containers of the same kind.
  • Sometimes you might have a scenario where helper containers that might be doing some kind of supporting tasks for a web application such as processing a user-entered data, processing a file uploaded by the user, etc. and you want these helper containers to live alongside your application container. In that case, you can have both of these containers part of the same POD.

Alt Text

How to deploy pods?

Let’s now take a look to create an Nginx pod using kubectl.

To deploy a docker container by creating a POD.
$ kubectl run nginx --image nginx

To get the list of pods
$ kubectl get pods

Alt Text

K8s Reference Docs:

https://kubernetes.io/docs/concepts/workloads/pods/pod/
https://kubernetes.io/docs/concepts/workloads/pods/pod-overview/
https://kubernetes.io/docs/tutorials/kubernetes-basics/explore/explore-intro/

Access certified Kubernetes administrator course with practice tests

Top comments (0)