
Cloud & DevOps Engineer 🛠️ | AWS • Azure • Docker • Kubernetes ☸️ Building & Automating Scalable Infrastructure 🏗️
India
Joined September 2011
- Tweets9.3K
- Following800
- Followers1.1K
- Likes2.5K
Dashboard: CPU at 30%. Users: "the app is slow."
Everyone checks the database. Nobody checks throttling.
A CPU limit is enforced in short time slices. A container can burn its whole quota early in a slice, then sit frozen until the next one. The average looks calm while requests wait.
Check cpu.stat inside the container. If nr_throttled keeps climbing, that is your answer.
Does your dashboard show throttle rate, or only CPU average?
2
6
211
You create a pod, and a few seconds later it's running on node 7. Nobody told it to go there. The scheduler picked it.
It works in two steps. First it filters out nodes that can't run the pod: not enough CPU or memory, a taint the pod doesn't tolerate, a wrong label. Then it scores the nodes that are left and picks the best one.
The key detail is that it schedules by your resource requests, not by actual usage. A node that looks idle can still be "full" if the pods on it requested everything.
A pod stuck in Pending usually means no node passed the filter. Run `kubectl describe pod` and the events tell you why.
2
3
112
Hardcoded AWS keys in CI are a breach waiting to happen. Short-lived roles and rotation beat long-lived tokens every time.
Check which identity your runner is actually using. If it's a stale key instead of a short-lived role, you're leaking access.
Need to kill a leaked database login? Revoke its temporary credentials instantly, no PostgreSQL restart needed.
Audit your CI secrets. Anything untouched for a year is overdue for rotation.
Scan your repo before commits. Stop AWS keys and private keys from reaching Git history.
Zero trust starts when static credentials stop existing.
1
4
193
Deleting a file in a later Dockerfile layer does not shrink the image.
The earlier layer still holds it.
Clean up in the same RUN, or use a multi-stage build.
5
155
Your server feels slow, CPU looks fine, and writes take 5 seconds. The bottleneck is usually disk I/O or the hypervisor.
Check I/O wait. If your CPUs are sitting idle waiting on slow storage, that's the problem.
Check steal time. If a noisy neighbor on the same host is taking your CPU cycles, you'll see it here.
Check disk utilization. If the disk is maxed out and latency keeps climbing, you've hit its IOPS limit.
Find the process. Something is hammering the disk, and it's usually a backup job, a log flood, or a debug logger.
Check available memory, not free memory. Linux uses spare RAM for caching, so low free memory isn't a problem by itself.
Check network throughput. You may be hitting your cloud provider's bandwidth cap.
Find the bottleneck before you resize anything.
1
8
214
Ran `kubectl delete` on production when you meant staging?
Your context decided that, not you.
Fix it:
1. `kubectl config current-context` before any destructive command
2. Show the context in your shell prompt (kube-ps1)
3. Use `kubectx` and `kubens` to switch fast and deliberately
Bonus: set a different prompt color for prod so you can't miss it.
Check the context before you press Enter.
A node goes NotReady. For the next five minutes, its pods still show Running.
Nothing is reachable, but nothing has moved yet. By default, Kubernetes waits about 5 minutes before evicting pods from an unhealthy node.
Run kubectl describe node and read the Conditions. Ready: Unknown and Ready: False point to different problems, so check which one it is before touching anything.
Did a "Running" pod ever mislead you during a node failure?
Your Linux server is acting up, and restarting it won't tell you why. These systemd and journalctl commands will.
Think of a server like a building with many staff. Each service is one worker. When one fails quietly, you need to find out who.
systemctl --failed lists every service that has crashed. Run it first when you SSH into a broken server.
journalctl -u kubelet -p err --since "30 min ago" shows only the error messages from the last 30 minutes. You skip the thousands of routine status lines.
journalctl -k -g "oom-killer|segfault" checks the kernel's logs. If the kernel killed your app for using too much memory, this shows it, even when the app logs say nothing.
systemctl list-timers shows every scheduled job and when it last ran. Useful for catching backups or certificate renewals that quietly stopped.
systemctl edit --full nginx.service lets you change a service's settings without the change getting wiped out by system updates.
Find the failed worker. Read the error. Check the kernel. Then fix it.
2
84
Not every question needs an immediate answer.
Some thoughts become clearer with time, some decisions need distance, and some things make sense only when we stop trying so hard to understand them.
Good Morning.
Happy Monday.
31
An outage happens, and the first question in the room is "who pushed that change?" Everyone in the room learns something from that question: next time, hide your mistakes.
A blameless postmortem asks a different question: how did our system let this happen? Someone made the change, but a pipeline approved it, a review passed it, and no alert caught it.
Blame makes people quiet, and quiet teams repeat the same outage. Fix the process, not the person.
Shell says ulimit -n is 65535. The service still dies with "Too many open files."
Because the service never saw that number. A systemd service ignores the shell's ulimit and runs with its own limit, often 1024.
Run cat /proc/PID/limits. That is the limit the process actually has.
Has this one fooled you before?
Your Docker image is 2.5 GB and your build takes 25 minutes. Most of that weight is stuff production never needs.
Think of an image like a moving box. Every extra item you pack makes it heavier to ship.
dive shows you what's inside each layer and where the waste hides. A common trap: you install packages in one step, delete the cache in the next, and the deleted files still take up space.
trivy scans your image for known security holes. Run it in CI and block vulnerable images before they reach production.
docker buildx builds one image that runs on both Intel and ARM servers. ARM servers are often cheaper, and you don't need separate tags.
Smaller images, fewer security holes, faster deploys. Pack only what your app needs to run.
1
8
310
Pod stuck in Terminating? Kubernetes asked it to stop, and something is blocking it from finishing. The pod isn't hung. The shutdown is.
First commands, always:
kubectl describe pod <pod>
kubectl get pod <pod> -o yaml
Look for deletionTimestamp (the delete was requested), finalizers in metadata, and the node the pod is running on.
What happens during a normal shutdown:
1. The pod is marked Terminating and removed from Service endpoints
2. The preStop hook runs, if there is one
3. SIGTERM is sent to the container
4. After terminationGracePeriodSeconds (30s by default), SIGKILL is sent
If it sits there for minutes, one of those steps is stuck.
Common causes:
1. App ignores SIGTERM
The process never exits, so the pod waits the full grace period and then gets killed. This often happens when a shell script is the entrypoint and doesn't forward signals. Use exec in the script, or run an init like tini.
2. Long grace period
Someone set terminationGracePeriodSeconds to 600 for a slow drain. The pod isn't stuck, it's waiting as configured. Check the spec before assuming the worst.
3. preStop hook hanging
A hook that calls a dead endpoint or sleeps too long delays everything after it. The hook time counts against the grace period.
4. Finalizers never removed
A finalizer tells Kubernetes to wait for a controller to clean up first. If that controller is down or deleted, the pod waits forever. Check metadata.finalizers in the YAML.
5. Node is NotReady or unreachable
The kubelet on that node can't confirm the container stopped, so the API server can't finish the deletion. The pod stays Terminating until the node returns or is removed.
6. Volume won't detach
A CSI driver or a storage backend issue keeps the volume attached, and cleanup stalls. Check VolumeAttachment objects and the CSI driver logs.
7. Container runtime problem
containerd can't stop the container, usually from a hung process in uninterruptible sleep (D state) stuck on I/O. Check the node.
Fixes:
1. Fix the cause first: SIGTERM handling, hooks, the node, or the controller owning the finalizer
2. If the finalizer's controller is gone, remove it with kubectl patch pod <pod> -p '{"metadata":{"finalizers":null}}'
3. Force delete as a last resort: kubectl delete pod <pod> --force --grace-period=0
Careful with force delete:
It only removes the object from the API. The container may still be running on the node. For StatefulSet pods, that can mean two copies running against the same volume. Only force delete when you are sure the node is dead.
Namespace stuck Terminating:
Same idea. A finalizer is waiting on something, often a deleted CRD or an unavailable API service. Find what's left with kubectl api-resources --verbs=list --namespaced -o name and clear it.
Quick flow:
1. describe pod, check the node and events
2. Check finalizers, hooks, and grace period in the YAML
3. Is the node Ready? If not, fix or replace the node
4. Force delete only after you know the process is gone
Terminating isn't a state. It's a task, and something is stopping it from finishing.
Find the blocker before you force anything.
Good morning.
The strange thing about life is that we often understand the value of a moment only after it becomes a memory.
Maybe that's a reason to pay a little more attention today.
2
4
92
AI makes deployments faster.
That also means mistakes can reach production faster.
Automation without guardrails is just faster failure.
1
87
PVC stuck in Pending for 10 minutes. Time to panic?
Not always. With WaitForFirstConsumer, a PVC stays Pending until a pod actually uses it. That is by design.
If a pod is already waiting and the claim is still Pending, run kubectl describe pvc. The Events at the bottom name the cause.
Which storage error has cost you the most time?





