Ankit ☁︎ ❯ (@ankit_ops2799) header
Ankit ☁︎ ❯ (@ankit_ops2799) profile picture

Cloud & DevOps Engineer 🛠️ | AWS • Azure • Docker • Kubernetes ☸️ Building & Automating Scalable Infrastructure 🏗️

India
Joined September 2011
Photo by Ankit ☁︎ ❯ (@ankit_ops2799)Photo by Ankit ☁︎ ❯ (@ankit_ops2799)Photo by Ankit ☁︎ ❯ (@ankit_ops2799)Photo by Ankit ☁︎ ❯ (@ankit_ops2799)Photo by Ankit ☁︎ ❯ (@ankit_ops2799)Photo by Ankit ☁︎ ❯ (@ankit_ops2799)Photo by Ankit ☁︎ ❯ (@ankit_ops2799)Photo by Ankit ☁︎ ❯ (@ankit_ops2799)Photo by Ankit ☁︎ ❯ (@ankit_ops2799)Photo by Ankit ☁︎ ❯ (@ankit_ops2799)
Someone commits a database password to Git. Ten minutes later they delete it and push again. The password is gone from the latest version, but it lives forever in the history, in every clone, and in every fork. That's why secrets management starts with one rule: a secret should never be in your code, your repo, or your container image. Once it's there, you can't truly take it back. The only real fix is rotating it. The first step up is environment variables, injected at runtime instead of baked into the image. Better, but not safe. They show up in process listings, crash dumps, and debug logs, and anyone who can exec into the container can read them. Kubernetes Secrets look like the answer, but by default they're only base64-encoded, which is encoding, not encryption. Anyone with read access to the namespace can decode them in one command. Turning on encryption at rest and tightening RBAC makes them much safer, but it isn't automatic. A dedicated secrets manager changes the model. Tools like HashiCorp Vault, AWS Secrets Manager, and Azure Key Vault store secrets encrypted, control who can read each one, and log every access. You can answer "who read this password and when" instead of hoping nobody did. The better ones generate short-lived credentials. Instead of one database password that lives for two years, the app asks Vault for a login that expires in an hour. A leaked credential is worthless by the time anyone finds it. Rotation is the habit that matters most. If rotating a secret requires a deploy, a meeting, and three people, it won't get done. Design it so rotation is routine, and a leak becomes an inconvenience instead of an emergency. Assume every secret will leak eventually. The goal is making sure that when it does, it's already expired.
4
10
374
Opening 0.0.0.0/0 in your security group to inspect a staging database is an invitation for credential-stuffing bots. SSH already gives you a secure path. Here's how to use it. ssh -L 5432 sends your laptop's port 5432 through the bastion to a private database. Point DBeaver or pgAdmin at localhost and the RDS instance behaves like it's on your machine. ssh -J chains multiple hops to reach worker nodes in private subnets. Your keys stay on your laptop's ssh-agent. Intermediate hosts never hold them. ssh -R exposes your local port 3000 on a public server, so you can test live Stripe or GitHub webhooks against code still on your machine. ssh -D 1080 turns the connection into a SOCKS5 proxy. Point your browser at it to reach internal Grafana, Prometheus, or Consul. Enable proxy DNS, or private hostnames won't resolve. Long-running tunnels need keepalives. ServerAliveInterval=30 stops NAT gateways from dropping idle connections. It doesn't reconnect a dead session. For that, use autossh. Getting "Too many authentication failures"? Add -o IdentitiesOnly=yes with the specific key. SSH stops cycling through every key in your agent. ControlMaster reuses one connection across ssh, scp, and rsync. Repeat connections skip the full handshake, so they open almost instantly. For new keys, ssh-keygen -t ed25519 gives you a short, modern key. Set a passphrase, since the -a rounds only protect a passphrase-encrypted private key. Keep the bastion as your only public door. Everything else stays private.
1
6
317
Good morning. Some memories don't return as pictures. They return as a smell, a familiar melody, a particular afternoon feeling, or a street that suddenly reminds you of another time. The mind has its own beautiful ways of travelling.
1
4
183
Pod OOMKilled? The container used more memory than its limit, and the Linux kernel killed it. Kubernetes didn't make that decision. It only reports it. First command, always: kubectl describe pod <pod> Look under Last State for Reason: OOMKilled and Exit Code: 137. Then check kubectl top pod to see actual usage. Two kinds of OOM, and people mix them up: Container limit hit Your pod crossed its own memory limit. Only that container is killed and restarted. This is the common one. Node out of memory The whole node ran low, and the kubelet evicts pods. Pods using more than they requested go first. Check kubectl describe node for MemoryPressure. Common causes: 1. Limit set too low Someone guessed 256Mi and the app needs 400Mi at peak. Look at real usage over time in Prometheus or Grafana, not a single snapshot. 2. Memory leak Usage climbs steadily until the kill, drops, and climbs again in a sawtooth pattern. Raising the limit only delays it. Profile the app. 3. Runtime ignores the container limit Older JVMs sized their heap from the node's memory, not the container's. Use -XX:MaxRAMPercentage for Java, --max-old-space-size for Node, and GOMEMLIMIT for Go. The process needs memory beyond the heap too. 4. Spikes at startup or on big requests Loading a large file, a big query result, or a batch job. The average looks fine and the peak kills it. 5. Page cache and tmpfs counting toward the limit Files written to an emptyDir with medium: Memory count as memory. So can heavy file I/O. Setting requests and limits: 1. Set the memory request close to real usage, so the scheduler places pods honestly 2. Set the memory limit with headroom above the peak 3. Request equal to limit gives you Guaranteed QoS, the last to be evicted 4. Use VPA in recommendation mode to see what the app actually needs Quick flow: 1. describe pod, confirm exit code 137 and OOMKilled 2. kubectl top pod and your metrics for the usage pattern 3. Sawtooth means a leak. Flat then a spike means a peak. 4. Fix the runtime memory settings, then adjust requests and limits CPU gets throttled. Memory gets killed. Size memory for the worst minute, not the average day.
2
14
403
An AWS key gets pushed to a public repo at 4:02 PM. The developer spots it at 4:10, deletes the file, force-pushes a clean history, and breathes out. The key was already copied. Automated scrapers watch public commit feeds around the clock, and exposed keys often get picked up within minutes. Cleaning the history afterwards does not recall a single copy. Forks, clones and cached views keep their version. So the order of operations matters more than the cleanup: 1. Revoke and rotate the key first 2. Check the access logs for the whole window since the push 3. Scrub history only after that 4. Add push protection so the next one never lands Deleting the file in a new commit does nothing, since the secret stays in history. Making the repo private does nothing for copies that already exist. Does your team have a written "someone just leaked a key" runbook, or would everyone improvise at 4 PM on a Friday?
2
6
193
You don't have a monitoring problem. You have an alerting problem if 500 alerts can't tell you which one matters.
5
2
200
Staring at 500MB of JSON logs during a checkout outage won't tell you why. These one-liners will, and you can run them right on the server. jq filters your structured logs down to 5xx errors and reshapes each one into a single readable line. Forty fields become four. Check your field names first, since they vary by app. awk and uniq tally your nginx status codes. In one command you see the ratio of 200s, 401s, 429s, and 502s hitting your edge right now. grep -C 5 grabs five lines around every panic, fatal, or timeout. You get the request ID and the upstream host that triggered it, not just the error line. awk ranks your slowest endpoints by response time. Confirm your log format puts response time in the last column before you trust the ranking. sed masks passwords, tokens, and API keys in key=value form before you paste logs into Slack or a support ticket. It won't catch JSON-style secrets, so review the output before sharing. zgrep searches compressed archives directly. Hunt a memory leak across last week's rotated logs without decompressing gigabytes onto a disk that's already full. Batch cleanup of Evicted pods with xargs works, but match on the STATUS column and dry-run first. A loose match can delete pods you didn't mean to touch. tail -F with grep --line-buffered streams matching lines as they happen, even across log rotation. No mysterious 30-second delays. Filter with jq. Add context with grep. Tally with awk. Scrub with sed. Then share.
1
3
216
Good morning. A person's world becomes richer when they can find interest in things beyond their immediate responsibilities. Read something unexpected. Ask a different question. Explore an unfamiliar idea. Curiosity keeps life moving in beautiful directions.
2
3
97
Node showing NotReady? The kubelet on that node has stopped reporting healthy to the control plane. The machine might be fine. The node's conversation with the API server isn't. First command, always: kubectl describe node <node> Read the Conditions section and the Events at the bottom. Ready, MemoryPressure, DiskPressure, and PIDPressure tell you where to look. Common causes: Kubelet stopped or crashing SSH to the node and run systemctl status kubelet, then journalctl -u kubelet. Expired kubelet certificates and bad config after an upgrade show up here. Container runtime down If containerd or Docker is dead, the kubelet can't run anything and reports not ready. Check systemctl status containerd. Disk full Image layers and container logs fill /var/lib/containerd or /var/lib/docker. Run df -h, and df -i for inodes. DiskPressure makes the kubelet start evicting pods. Out of memory Without proper requests and limits, pods can starve the node itself, including the kubelet. Check dmesg for OOM kills. CNI plugin not ready The network plugin failed to start, or its pod is crashing on that node. The condition message usually says network plugin not ready. Network or instance failure Security group change, broken route, or a failed cloud status check. If the node is unreachable, the control plane marks it NotReady after the node-monitor grace period (about 40 seconds by default). What happens to the pods: The control plane taints the node, and pods get evicted after 5 minutes by default. StatefulSet pods can sit in Terminating because Kubernetes can't confirm the old pod is really gone. Don't force delete them unless you're sure the node is dead, or two copies may write to the same volume. Quick flow: 1. describe node, read Conditions and Events 2. kubelet and runtime logs on the node 3. df -h, df -i, free -m 4. If it's unfixable, cordon, drain, and replace the node In the cloud, nodes are cattle. Replace first, investigate afterward, and keep the logs.
3
1
9
365
The Kubernetes cluster was healthy. All pods were running. All nodes were ready. CPU was normal. Memory was normal. But users couldn't access the application. That's the thing about production: Green dashboards don't always mean a healthy system. Sometimes the biggest outage is the one your monitoring never noticed.
3
3
1
10
398
Your bad deploy hit main, or a reset --hard wiped hours of work. Before you re-clone anything, check the reflog. Reflog Git records every move HEAD makes, including rebases and resets that vanished from git log. Find the hash, stash your current changes, then reset to it. Bad PR merged to main? Use git revert -m 1 on the merge commit. It creates a new commit that undoes the change without rewriting history. Mystery regression across 500 commits? git bisect runs a binary search. Mark one bad commit and one good one, then test each midpoint. About nine steps to find the culprit. Urgent hotfix while your Terraform refactor is half done? git worktree add gives you a second folder linked to the same repo. Fix production there and leave your messy workspace alone. Need to find when an env var got deleted six months ago? git log -S "DB_CONNECTION_STRING" -p shows the commits that changed it. Review the results before you trust them. Force pushing after a rebase? Use --force-with-lease, not --force. It refuses to overwrite commits you haven't fetched. Reflog saves local work. Revert saves main. Worktrees save your focus.
2
113
Docker just got a new identity. 🐳 From shipping containers to securing AI agents. The whale has evolved. The mission has expanded. Containers aren't going anywhere. But the future is bigger than containers. Docker: Built to Run on Trust. Official announcement 👉docker.com/blog/meet-the-new…
3
66
DevOps isn't about deploying faster. It's about recovering faster when your deployment goes wrong.
2
7
297
Good morning. ✨ A little wonder can make an ordinary life feel extraordinary. Notice the changing sky, learn something unfamiliar, take a different road, or listen to a song you haven't heard in years. There is still so much to experience.
2
5
129
Your new checkout flow is finished, tested, and merged. Shipping it means every user gets it at the same moment, and if something is wrong, the only way back is another deploy. Feature flags break that link between putting code in production and turning it on. A flag is a conditional in your code, backed by a setting you can change without redeploying. If the flag is on, the new path runs. If it's off, the old one does. The code sits in production, dormant, until you decide otherwise. That changes how rollouts work. You can enable the feature for internal staff first, then 1% of users, then 10%, then everyone, watching error rates and latency at each step. If something looks wrong, you switch it off in seconds. No rollback, no pipeline, no waiting. It also makes merging safer. Teams can ship unfinished work to main behind a flag that stays off, instead of keeping long-lived branches that drift further from the codebase every day. Smaller, more frequent merges mean fewer painful conflicts. Flags aren't only for new features. A kill switch lets you disable a risky or expensive code path during an incident, like turning off recommendations when the service behind them is struggling. Others gate premium features by plan, or let you run A/B tests by splitting users between variants. The catch is that flags are debt. Every one you add creates another branch in your code and another combination to test. Old flags that are always on, but never removed, pile up until nobody remembers what they control or whether it's safe to delete them. A habit that helps: give every flag an owner and an expiry date when you create it. Once a feature is fully rolled out, removing the flag and the dead code path is part of finishing the work. Releasing becomes a business decision you can make at any time, and deploying becomes a routine technical event nobody has to be nervous about.
4
1
7
346
You updated the ConfigMap, but the app is still using the old value. Nothing is broken. Kubernetes just never told your pod to reload. First command: kubectl rollout restart deployment <name> If the new value shows up after that, you've found the cause. How ConfigMaps reach a pod, and when they update: Environment variables Read once when the container starts and never updated. Change the ConfigMap and the running pod keeps the old value until it restarts. This is the most common cause. Volume mounts These do update in place, but not instantly. The kubelet syncs on a delay, so expect up to a minute or more. Your app also has to re-read the file, and many apps only read config at startup. subPath mounts Files mounted with subPath never get updates at all. Mounting a single file this way is convenient, and it's a silent trap. How to make changes roll out automatically: - Helm: add a checksum of the ConfigMap as a pod annotation, so any config change alters the pod template and triggers a rolling update - Kustomize: configMapGenerator appends a hash to the name, so a new config means a new name and a new rollout - Reloader (Stakater) or similar controllers watch ConfigMaps and Secrets and restart the workloads using them - Immutable ConfigMaps: set immutable: true and create a new one per version. Safer rollbacks, fewer surprises, and less load on the API server Same applies to Secrets. Quick flow: 1. Env var or volume? Env vars need a restart 2. Using subPath? It will never update 3. Does the app re-read the file, or only at startup? 4. Automate the restart so nobody has to remember Config that changes without a rollout is config you can't roll back. Tie your config to your deploys.
4
2
21
1,092
Good morning. 🌱 We rarely notice when a season of life is becoming a memory. That's why it's worth looking up from the routine once in a while. Some moments deserve more than just passing through them.
1
2
99
Happy International Men's Day! 💙 To the men who silently carry responsibilities. Who turn their worries into smiles. Who show up even when life gets difficult. Who work hard, stay strong, and rarely talk about what they're going through. A reminder: You don't always have to be strong. You don't have to have everything figured out. Your feelings matter. Your struggles matter. Your existence matters. Being a man isn't about never breaking. It's about being human, too. Check on the men in your life. Sometimes, a simple "Are you doing okay?" means more than you think. Happy Men's Day. You matter. 💙
2
53
Your cache slows down, then your database gets slammed. Diagnose before you flush. redis-cli INFO memory shows memory pressure and evictions. redis-cli SLOWLOG GET 10 finds commands freezing Redis, like KEYS * or huge HGETALL calls. redis-cli --bigkeys finds oversized keys. Run it off-peak. redis-cli CLIENT LIST shows connection storms from unpooled pods. Check memory, find slow commands, hunt big keys, audit connections.
1
3
98