<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Amit Kumar</title>
    <description>The latest articles on DEV Community by Amit Kumar (@amitk030).</description>
    <link>https://dev.to/amitk030</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3015739%2F09d47fa7-da1f-4eaf-86b3-e33eda953640.png</url>
      <title>DEV Community: Amit Kumar</title>
      <link>https://dev.to/amitk030</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/amitk030"/>
    <language>en</language>
    <item>
      <title>Getting Started with Kubernetes Pods: A Beginner-Friendly Guide</title>
      <dc:creator>Amit Kumar</dc:creator>
      <pubDate>Sat, 12 Apr 2025 11:10:03 +0000</pubDate>
      <link>https://dev.to/amitk030/getting-started-with-kubernetes-pods-a-beginner-friendly-guide-3o65</link>
      <guid>https://dev.to/amitk030/getting-started-with-kubernetes-pods-a-beginner-friendly-guide-3o65</guid>
      <description>&lt;p&gt;In Kubernetes, Pods are the most basic deployable units. If you're just starting to learn kubernetes, getting to know Pods inside out is absolutely essential.&lt;/p&gt;

&lt;p&gt;In this post, we'll break down what Pods are, how they work, and a quick example of creating a Pod using kubectl — the most direct way to get hands-on practice.&lt;/p&gt;

&lt;p&gt;🌟 What is a Pod in Kubernetes?&lt;br&gt;
A Pod is the smallest and simplest unit in the Kubernetes object model. It represents a single instance of a running process in your cluster.&lt;/p&gt;

&lt;p&gt;Typically, a Pod will contain:&lt;/p&gt;

&lt;p&gt;One container (most common), or&lt;/p&gt;

&lt;p&gt;Multiple tightly coupled containers that share storage/network and are always co-located and co-scheduled.&lt;/p&gt;

&lt;p&gt;Think of a Pod as a wrapper around one or more containers. It provides an environment for containers to communicate easily and share resources.&lt;/p&gt;

&lt;p&gt;Key characteristics of Pods:&lt;/p&gt;

&lt;p&gt;Shared Storage: Volumes can be mounted to Pods for data persistence.&lt;/p&gt;

&lt;p&gt;Shared Network: Each Pod gets a unique IP address. Containers inside a Pod can communicate with each other over localhost.&lt;/p&gt;

&lt;p&gt;Lifecycle Management: Pods are designed to be ephemeral. If a Pod dies, Kubernetes can create a new one through controllers like Deployments or replicasets.&lt;/p&gt;

&lt;p&gt;🔹 Why Not Just Use Containers Directly?&lt;br&gt;
While tools like Docker allow you to run containers individually, Kubernetes groups containers into Pods for better management, scalability, and communication.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;p&gt;Containers in the same Pod can easily share data.&lt;/p&gt;

&lt;p&gt;Containers can work together (like a helper container that updates a main app container).&lt;/p&gt;

&lt;p&gt;🚀 How to Create a Pod (Using a YAML File)&lt;br&gt;
Let’s create a simple Pod running an nginx container by defining a YAML manifest.&lt;/p&gt;

&lt;p&gt;Here’s a sample pod.yaml file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: v1
kind: Pod
metadata:
  name: nginx-pod
spec:
  containers:
    - name: nginx
      image: nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;apiVersion: v1 specifies the Kubernetes API version.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;kind: Pod tells Kubernetes that we are creating a Pod resource.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;metadata.name is the name of the Pod.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;spec.containers lists the containers inside the Pod, with their names and images.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once you have the YAML file ready, you can create the Pod with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl apply -f pod.yaml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can verify the Pod creation by running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl get pods
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And inspect the Pod in detail:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;kubectl describe pod nginx-pod
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Pro Tip:&lt;br&gt;
During exams like CKAD/CKA, using YAML manifests is often safer for complex resources, as it helps avoid mistakes and makes it easier to edit and reapply configurations.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🎥 In the video linked below, I walk you through creating this Pod step-by-step using a YAML file.&lt;br&gt;
  &lt;iframe src="https://www.youtube.com/embed/7liC6SxiXDo"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

</description>
      <category>kubernetes</category>
      <category>kubectl</category>
      <category>thek8slabs</category>
    </item>
  </channel>
</rss>
