Posts

Understanding Kubernetes YAML: Structure, Templates, Labels, and Selectors

 Today, focus on one common YAML structure , then learn what changes between Pod, ReplicaSet, Deployment, and DaemonSet . Don't try to memorize four YAML files separately. 1. First understand the universal Kubernetes YAML structure Almost every Kubernetes manifest starts like this: apiVersion: kind: metadata: spec: 🧠 Remember: AKMS A piVersion → K ind → M etadata → S pec Think: What API? → What object? → What is its name? → What should it do? 2. Pod YAML Start with the simplest one. apiVersion: v1 kind: Pod metadata: name: nginx-pod spec: containers: - name: nginx-container image: nginx Understand it like this: Pod YAML │ ├── apiVersion: v1 │ ├── kind: Pod │ ├── metadata │ └── name: nginx-pod │ └── spec └── containers └── nginx-container └── image: nginx What do you need to remember? Only this: apiVersion: v1 kind: Pod metadata: name: <pod-name> spec: containers: - name: <container-name> image: <image> The...

Kubernetes Fundamentals: Architecture, Core Components, and Essential kubectl Commands

  Introduction Kubernetes (K8s) is an open-source container orchestration platform used to deploy, manage, scale, and maintain containerized applications. Instead of manually managing individual containers, Kubernetes automates many operational tasks, including: Deploying applications Managing containers Scaling applications Restarting failed workloads Load balancing Service discovery Rolling updates Managing application configuration Scheduling workloads across machines For example, instead of manually running: docker run nginx we can define the desired state in Kubernetes and let Kubernetes manage the application. Kubernetes Architecture at a Glance The basic Kubernetes structure looks like this: Kubernetes Cluster │ ├── Control Plane │ └── Worker Node │ ├── Pod │ └── Container │ ↑ │ Image │ └── Container Runtime └── containerd / CRI-O There is an important relationship to understand here: A Kubernetes cluster contain...

Kubernetes Pods: Public & Private Container Registries, Local Images, Authentication and Image Pulling

  Kubernetes Pods: Public & Private Container Registries, Local Images, Authentication and Image Pulling Complete Beginner-to-Practical Guide When Kubernetes creates a Pod, it needs a container image . That image can come from: A local image already available to the Kubernetes node A public container registry such as Docker Hub A private container registry requiring authentication Understanding this process helps us troubleshoot common Kubernetes errors such as: ErrImagePull ImagePullBackOff 1. First Understand Image → Container → Pod The easiest way to remember the relationship is: Container Image ↓ Container ↓ Pod In Kubernetes terminology, the Pod is the Kubernetes unit that contains the container: Pod └── Container └── Image For example: Pod └── nginx container └── nginx:latest image Remember Image = package/template Container = running instance of the image Pod = Kubernetes unit containing one or more containers 2. What Happens When We Create a Pod?...

Docker inspect — Easy Memory Trick

🐳 Docker inspect — Easy Memory Trick Instead of memorizing dozens of docker inspect commands, remember: CSNMH → ICEEP → FSRPET → PING → SD → CMR 1️⃣ Main Mnemonic — CSNMH C → Config S → State N → NetworkSettings M → Mounts H → HostConfig Think: Config → State → Network → Mount → Host 2️⃣ Config → ICEEP 🧊 ICEEP = Ice P I → Image C → Cmd E → Entrypoint E → Env P → ExposedPorts Fields .Config.Image .Config.Cmd .Config.Entrypoint .Config.Env .Config.ExposedPorts 3️⃣ State → FSRPET ⚙️ F → FinishedAt S → Status R → Running P → PID E → ExitCode T → StartedAt Fields .State.FinishedAt .State.Status .State.Running .State.Pid .State.ExitCode .State.StartedAt 4️⃣ NetworkSettings → PING 📡 Network = PING P → Ports I → IPAddress N → Networks G → Gateway Fields .NetworkSettings.Ports .NetworkSettings.IPAddress .NetworkSettings.Networks .NetworkSettings.Gateway ⚠️ IP and Gateway are commonly nested inside Networks , so in practice use range : docker inspect con...