Getting Started with Pods

Learn what are Pods, and how to create a Kubernetes cluster.

We'll cover the following

Understanding pods#

Pods are equivalent to bricks we use to build houses. Both are uneventful and not much by themselves. Yet, they are fundamental building blocks without which we could not construct the solution we are set to build.

If you have used Docker or Docker Swarm, you’re probably used to thinking that a container is the smallest unit and that more complex patterns are built on top of it. With Kubernetes, the smallest unit is a Pod.

A Pod is a way to represent a running process in a cluster.

From the Kubernetes’ perspective, there’s nothing smaller than a Pod.

A Pod encapsulates one or more containers. It provides a unique network IP, attaches storage resources, and also decides how containers should run. Everything in a Pod is tightly coupled.

We should clarify that containers in a Pod are not necessarily made by Docker. Other container runtimes are supported as well. Still, at the time of this writing, Docker is the most commonly used container runtime, and all our examples will use it.

Since we cannot create Pods without a Kubernetes cluster, our first order of business is to create one.

Creating a cluster#

In this course, we will use k3d clusters on our platform. k3d is an open source wrapper to run lightweight k3s clusters on docker containers.

For practicing this course on the Educative Platform all necessary toolkits and installations are already taken care of. However, if you want to experiment with clusters on your local machines, please refer to the appendix section of this course.

We’ll create a Kubernetes cluster using k3d, the first command will create a k3d cluster named mycluster.

Create Cluster and get the details about nodes

The output of the latter command is as follows.

Output of 'get nodes'

Run the above commands in the Terminal below. Make sure to connect the Terminal by pressing Click to Connect before executing any commands.

Terminal 1
Terminal

Click to Connect...

What is Kubernetes?
A Quick and Dirty way to Run Pods
Mark as Completed
Report an Issue