- TechOps Examples
- Posts
- Kubernetes pod.yaml Practical Usage Guide
Kubernetes pod.yaml Practical Usage Guide
TechOps Examples
Hey — It's Govardhana MK 👋
Along with a use case deep dive, we identify the remote job opportunities, top news, tools, and articles in the TechOps industry.
👋 Before we begin... a big thank you to today's sponsor 1440
Looking for unbiased, fact-based news? Join 1440 today.
Upgrade your news intake with 1440! Dive into a daily newsletter trusted by millions for its comprehensive, 5-minute snapshot of the world's happenings. We navigate through over 100 sources to bring you fact-based news on politics, business, and culture—minus the bias and absolutely free.
IN TODAY'S EDITION
🧠 Use Case
Kubernetes pod.yaml Practical Usage Guide
🚀 Top News
👀 Remote Jobs
Numrah is hiring a DevOps Engineer
Remote Location: Worldwide
Mcafee is hiring a ML Platform Engineer
Remote Location: India
📚️ Resources
📢 Reddit Threads
🛠️ TOOL OF THE DAY
toolgit - Git Productivity Toolkit, a collection of scripts that extend Git with various sub-commands to make life easier.
🧠 USE CASE
Kubernetes pod.yaml Practical Usage Guide
Kubernetes Pods are the fundamental building blocks of containerized applications, and the pod.yaml file is how we define and control them.
Here I’ve broken down the structure of a pod.yaml for a simplified understanding.
Download a high resolution image of this diagram here for future reference.
But simply writing a pod.yaml isn’t enough - understanding how to apply, modify, and optimize it can save you from unnecessary troubleshooting, resource wastage, and deployment issues.
Understand these pointers to get the most out of pod.yaml.
1. Applying and Managing pod.yaml
kubectl apply -f pod.yaml → Deploy a Pod
kubectl delete -f pod.yaml → Remove it
kubectl get pods, kubectl describe pod <pod-name> → Inspect
2. Editing and Updating a Running Pod
kubectl edit pod <pod-name> → Live editing (some changes require recreation)
kubectl apply -f pod.yaml → Updates only changed fields while preserving state
kubectl replace --force -f pod.yaml → Deletes and recreates the resource (disruptive)
3. Dry Run and Validate Before Deployment
kubectl apply --dry-run=client -f pod.yaml → Test changes without applying
kubectl apply --validate=true -f pod.yaml → Catch schema errors
4. Defining Resource Requests and Limits
Avoid OOMKills by setting:
resources:
requests:
cpu: "100m"
memory: "256Mi"
limits:
cpu: "500m"
memory: "512Mi"
5. Prevent unnecessary downtime by PodDisruptionBudget (PDB)
kind: PodDisruptionBudget
spec:
minAvailable: 1
6. Using Liveness, Readiness, and Startup Probes
Auto restart failed Pods using:
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
Your pod.yaml isn’t just a static definition, it's a powerful tool.
Mastering it means less debugging, fewer outages, and smoother deployments.
For those 9,999,999,999 boys and girls who get confused about Kubernetes errors and what they really mean.
Here I've simplified it for you.
35K+ read my free bite-sized weekday (Mon-Fri) daily TechOps examples newsletter: techopsexamples.com/subscribe
What do we cover:
DevOps,… x.com/i/web/status/1…— Govardhana Miriyala Kannaiah (@govardhana_mk)
3:41 PM • Feb 1, 2025
I run a DevOps and Cloud consulting agency and have helped 17+ businesses, including Stanford, Hearst Corporation, CloudTruth, and more.
What people say after working with me: Genuine testimonials
When your business needs my services, book a free 1:1 business consultation.
You may even like: