Kubernetes Pod - Kubernetes

What is Kubernetes Pod?

A pod is a group of containers and its storage inside a node of a Kubernetes cluster. It is likely to make a pod with several containers inside it. For instance, keeping a database container and data container in the same pod.

Types of Pod

There are two types of Pods −

  • Single container pod
  • Multi container pod

Single Container Pod

They can be merely produced with the kubctl run command, where you have a distinct image on the Docker registry which we will pull while creating a pod.

Example − We will make a pod with a tomcat image which is accessible on the Docker hub.

This can also be done by making the yaml file and then running the kubectl create command.

When the above yaml file is produced, we will save the file with the name of tomcat.yml and run the create command to run the document.

It will make a pod with the name of tomcat. We can use the define command along with kubectl to describe the pod.

Multi Container Pod

Multi container pods are created using yaml mail with the definition of the containers.

In the beyond code, we have made one pod with two containers inside it, one for tomcat and the other for MongoDB.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Kubernetes Topics