Pods & YAML Demystified ๐Ÿงพ

TheTansihTheTansih
2 min read

Hey everyone ๐Ÿ‘‹
Today was one of those days in my Kubernetes journey where things started to feel a bit complex and overwhelming, but I chose not to give up. Instead, I chose to document, reflect, and move ahead โ€” one step at a time.
๐ŸŒธ Radhe Radhe for the strength, and let's begin.


๐Ÿง  What I Learned Today

This session focused on two crucial building blocks of Kubernetes:

  1. Pods โ€“ the smallest deployable unit in K8s

  2. YAML โ€“ the configuration language we use to define everything in Kubernetes


๐Ÿ“Œ Key Takeaways

๐Ÿณ Pods โ€“ The Core of Kubernetes

A Pod is the smallest unit you can deploy in K8s. It usually wraps a single container but can hold more than one if needed.

Example (Imperative):

kubectl run nginx --image=nginx

๐Ÿ“„ YAML โ€“ Your Way to Talk to Kubernetes

Kubernetes loves YAML. Here's why it matters:

  • Human-readable

  • Spacing-sensitive (no tabs!)

  • Used to define every resource in a cluster

A basic pod YAML looks like this:

apiVersion: v1 kind: Pod metadata: name: mypod spec: containers: - name: nginx-container image: nginx

๐Ÿงฉ Imperative vs Declarative

๐Ÿงช Imperative (kubectl run)๐Ÿ“‚ Declarative (kubectl apply -f)

Great for quick testing

Best for production setup

Not version controlled

Can be stored in Git

Less flexible

Full control and history

kubectl run nginx --image=nginx --dry-run=client -o yaml > pod.yaml

๐Ÿ” Troubleshooting & Useful Commands

  • kubectl describe pod โ€“ See events and logs for debugging

  • kubectl get pods -o wide โ€“ See node info

  • kubectl get pods --show-labels โ€“ Filter with labels

  • kubectl exec -it pod-name -- bash โ€“ Get inside a running Pod

  • kubectl edit pod pod-name โ€“ Edit directly in terminal (using vi)


๐Ÿ’ฌ My Reflections

Today wasnโ€™t easy.

There were moments when:

  • The concepts felt abstract

  • Tools like KIND were heavy to download

  • Hands-on felt out of sync with the theory

But instead of switching tracks or getting frustrated, I reminded myself:

โ€œLearning something powerful will never feel easy โ€” thatโ€™s what makes it powerful.โ€

And with discipline and a bit of faith in Shree Krishna & Radha Rani, I kept going.

0
Subscribe to my newsletter

Read articles from TheTansih directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

TheTansih
TheTansih