Cloud Native 5 min read

Understanding Kubernetes Pods: Basics, Types, Networking, Storage, and Common Commands

This article explains the fundamentals of Kubernetes Pods, covering their definition, creation methods, container count, networking model, storage options, and provides essential kubectl commands for managing Pods and deployments.

Practical DevOps Architecture
Practical DevOps Architecture
Practical DevOps Architecture
Understanding Kubernetes Pods: Basics, Types, Networking, Storage, and Common Commands

1. Pod

A Pod is a group of containers; in Kubernetes, the smallest deployable unit is a Pod. Typically a Pod runs a single container, but it can host multiple containers that share resources, similar to peas in a pod.

The core of a Pod is to run containers, requiring a container runtime such as Docker.

2. Classification

Self‑created Pods: directly created Pods that disappear when deleted and are not automatically recreated.

Controller‑created Pods: Pods created by a controller (e.g., Deployment, ReplicaSet); if deleted, the controller will recreate them.

3. Number of Containers per Pod

The common pattern is one container per Pod, making a Pod a simple wrapper for a container, with Kubernetes managing Pods rather than individual containers.

Multiple containers can run in the same Pod when they need to cooperate; they share resources and can be treated as a single service unit.

4. Pod Network

Each Pod is assigned a unique IP address, and all containers in the Pod share the same network namespace, including IP and ports.

Containers within the same Pod can communicate via localhost .

5. Pod Storage

Volumes can be used to persist storage for a Pod, preventing data loss when containers restart.

All containers in a Pod can access the shared Volume.

Kubernetes system components themselves run as Pods; you can list them with kubectl get pod -n kube-system .

6. Command Recap

(1) View created resources: kubectl get pod,deploy

(2) Delete an nginx Pod (if created by a Deployment, a new Pod will be recreated automatically): kubectl delete pod POD_NAME -n NAMESPACE

(3) To delete a controller that created the Pod, delete the controller itself: kubectl delete deployment DEPLOYMENT_NAME -n NAMESPACE

(4) Run a Pod with a specific namespace: kubectl run hahashen-nginx-pod --image=nginx:1.20.0 --port=80 --namespace=tuoguan

(5) Export a Deployment manifest to a YAML file: kubectl create deployment hahashen-nginx-pod --image=nginx:1.20.0 --port=80 --dry-run=client -o yaml > nginx.yaml

(6) Deploy three replicas by editing the YAML (change replicas: 1 to replicas: 3 ) and apply: kubectl apply -f nginx.yaml

(7) View detailed information of Pods in a specific namespace: kubectl get pod -n dev -o wide

If this article helped you, please like, view, and share—it greatly supports my continued creation of quality content. Thank you 🙏🏻

cloud nativeKubernetescontainerPodkubectl
Practical DevOps Architecture
Written by

Practical DevOps Architecture

Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.