Skip to content

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
  • No Access

Category: Kubernetes

Kubernetes

Kubernetes: Use kubectl diff Before Applying Changes to Preview Impact

- 13.02.26 - ErcanOPAK comment on Kubernetes: Use kubectl diff Before Applying Changes to Preview Impact

Applying YAML changes blindly is risky. Preview exactly what will change first. Before Applying: # See what kubectl apply will change kubectl diff -f deployment.yaml # Output shows: # – Lines being removed # + Lines being added # ~ Lines being modified Safe Workflow: # 1. Check diff kubectl diff -f deployment.yaml # 2. […]

Read More
Kubernetes

Kubernetes: View Real-Time Pod Logs with Stern Instead of kubectl

- 13.02.26 - ErcanOPAK comment on Kubernetes: View Real-Time Pod Logs with Stern Instead of kubectl

Tired of running kubectl logs for each pod separately? Stern streams logs from multiple pods simultaneously. Install Stern: # Mac brew install stern # Linux wget https://github.com/stern/stern/releases/download/v1.28.0/stern_linux_amd64 Usage: # Tail all pods matching pattern stern my-app # All pods in namespace stern . -n production # Color-coded by pod, auto-follows new pods Why Better: Kubectl […]

Read More
Kubernetes

Kubernetes Ingress: Expose Multiple Services Through One Load Balancer

- 05.02.26 - ErcanOPAK comment on Kubernetes Ingress: Expose Multiple Services Through One Load Balancer

Paying for multiple cloud load balancers? Ingress routes traffic to different services based on hostname or path. # ingress.yaml apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: main-ingress annotations: # NGINX Ingress Controller nginx.ingress.kubernetes.io/rewrite-target: / nginx.ingress.kubernetes.io/ssl-redirect: “true” nginx.ingress.kubernetes.io/proxy-body-size: “10m” # Cert-Manager for SSL cert-manager.io/cluster-issuer: “letsencrypt-prod” spec: tls: – hosts: – api.example.com – app.example.com – admin.example.com secretName: tls-secret […]

Read More
Kubernetes

Kubernetes: Force Delete Stuck Pods in Terminating State Instantly

- 03.02.26 - ErcanOPAK comment on Kubernetes: Force Delete Stuck Pods in Terminating State Instantly

Pod stuck in “Terminating” state for hours? Kubernetes is waiting for graceful shutdown that will never complete. Force delete it properly. The Problem: # Pod stuck forever kubectl get pods NAME STATUS AGE stuck-pod-abc123 Terminating 3h # Normal delete doesn’t work kubectl delete pod stuck-pod-abc123 # Still shows Terminating… Why Pods Get Stuck: When deleting […]

Read More
Kubernetes

Debug Kubernetes Pods That Keep Crashing Before Logs Disappear

- 01.02.26 | 01.02.26 - ErcanOPAK comment on Debug Kubernetes Pods That Keep Crashing Before Logs Disappear

Your pod crashes in 2 seconds, and logs vanish before you can read them? Here’s how to catch the output before Kubernetes deletes the container. The Problem: When a pod CrashLoops, the container exits so fast that ‘kubectl logs’ shows nothing useful or “container not found” errors. By the time you run the command, Kubernetes […]

Read More
Kubernetes

Why Your Pod “Looks Healthy” But Still Drops Traffic

- 31.01.26 - ErcanOPAK comment on Why Your Pod “Looks Healthy” But Still Drops Traffic

This is a classic production trap. Root cause readinessProbe ≠ livenessProbe Most people use only one. Correct pattern livenessProbe: httpGet: path: /health/live port: 80 readinessProbe: httpGet: path: /health/ready port: 80 Why this matters Liveness = should I restart? Readiness = should I receive traffic? If your app is warming caches or reconnecting DBs, traffic arrives […]

Read More
Kubernetes

Why Pods Restart Even When CPU & Memory Look Fine

- 30.01.26 - ErcanOPAK comment on Why Pods Restart Even When CPU & Memory Look Fine

Everything green… pods still restart. Hidden killer Liveness probes too aggressive Short timeouts during GC pauses Cold starts under load Fix Separate readiness & liveness Increase initialDelaySeconds Avoid HTTP probes on heavy endpoints livenessProbe: initialDelaySeconds: 30 timeoutSeconds: 5  

Read More
Kubernetes

Why Pods Restart Without Errors (OOMKilled Isn’t Always Logged)

- 29.01.26 - ErcanOPAK comment on Why Pods Restart Without Errors (OOMKilled Isn’t Always Logged)

Pods restart, logs look clean. Hidden reason Memory limit hit → kernel kills container → no app log. Check kubectl describe pod <pod-name> Look for: Reason: OOMKilled Fix Increase memory or fix memory leak — don’t just scale blindly.

Read More
Kubernetes

Use Liveness vs Readiness Correctly

- 28.01.26 - ErcanOPAK comment on Use Liveness vs Readiness Correctly

livenessProbe: httpGet: path: /health port: 80 Why it mattersWrong probes cause infinite restarts or traffic to broken pods.

Read More
Kubernetes

Use Resource Requests to Prevent Noisy Neighbors

- 27.01.26 - ErcanOPAK comment on Use Resource Requests to Prevent Noisy Neighbors

resources: requests: cpu: “250m” memory: “256Mi” Why it mattersWithout requests, Kubernetes can’t schedule intelligently → random slowdowns.

Read More
Kubernetes

Why Liveness ≠ Readiness Probes

- 26.01.26 - ErcanOPAK comment on Why Liveness ≠ Readiness Probes

livenessProbe: httpGet: path: /health readinessProbe: httpGet: path: /ready Why it mattersLiveness restarts pods, readiness controls traffic. Mixing them causes outages.

Read More
Kubernetes

Readiness vs Liveness — One Mistake Takes Down Clusters

- 25.01.26 - ErcanOPAK comment on Readiness vs Liveness — One Mistake Takes Down Clusters

Readiness vs Liveness — One Mistake Takes Down Clusters livenessProbe: httpGet: path: /health/live readinessProbe: httpGet: path: /health/ready Why this mattersLiveness restarts pods. Readiness controls traffic. Mixing them causes cascading failures.

Read More
Kubernetes

Why Readiness Probes Matter More Than Liveness

- 24.01.26 - ErcanOPAK comment on Why Readiness Probes Matter More Than Liveness

Most outages happen because traffic hits half-ready pods. readinessProbe: httpGet: path: /health/ready port: 80 Key idea: Liveness = “restart me” Readiness = “send traffic or not” If you only use liveness → Kubernetes will happily route traffic to chaos.

Read More
Kubernetes

Detect CrashLoopBackOff Root Cause in 10 Seconds

- 24.01.26 | 24.01.26 - ErcanOPAK comment on Detect CrashLoopBackOff Root Cause in 10 Seconds

Most people stare at logs too long. Kubernetes already tells you why your pod died. Fastest diagnostic command: kubectl describe pod <pod-name> Look for: Last State: Terminated Reason: OOMKilled Why this matters:Logs may be empty if the container never fully started. Real fix:Increase memory requests, not limits: resources: requests: memory: “512Mi” limits: memory: “1Gi” Result:Stable […]

Read More
Kubernetes

Kubernetes Pods Restart with No CPU or Memory Spikes

- 23.01.26 - ErcanOPAK comment on Kubernetes Pods Restart with No CPU or Memory Spikes

Metrics look clean, pods restart anyway. Why it happensProcess exits with code 0 (app logic exit). Why it mattersKubernetes assumes failure. Vital fix Keep main process alive or use proper controllers.

Read More
Kubernetes

Kubernetes Pods Restart Without Errors

- 22.01.26 - ErcanOPAK comment on Kubernetes Pods Restart Without Errors

No crash logs, still restarts. Why it happensLiveness probe fails silently. Why it mattersYour app is healthy — Kubernetes thinks it isn’t. Smart fixSeparate readiness and liveness logic.

Read More
Kubernetes

Kubernetes Deployments Succeed But Traffic Fails

- 21.01.26 - ErcanOPAK comment on Kubernetes Deployments Succeed But Traffic Fails

Pods are “Running” — app unreachable. Why it happensService selector does not match pod labels. Why it mattersLooks healthy, acts broken. Smart fixVerify selectors, not just pod status.

Read More
Kubernetes

Kubernetes Pods Restart Without Errors

- 18.01.26 - ErcanOPAK comment on Kubernetes Pods Restart Without Errors

No crash logs, still restarting. WhyResource limits exceeded silently. TipCheck memory limits and OOMKills.

Read More
Kubernetes

Kubernetes Services Work Internally but Fail Externally

- 16.01.26 - ErcanOPAK comment on Kubernetes Services Work Internally but Fail Externally

Pods communicate, users cannot. WhyService type mismatch (ClusterIP vs LoadBalancer). TipExplicitly define service exposure strategy.

Read More
Kubernetes

Kubernetes Pods Behave Differently After Restarts

- 15.01.26 - ErcanOPAK comment on Kubernetes Pods Behave Differently After Restarts

Same image, different runtime behavior. WhyEnvironment variables and config maps may change order or values. TipVersion configuration separately from images.

Read More
Kubernetes

Kubernetes Nodes Slowly Waste Resources

- 14.01.26 - ErcanOPAK comment on Kubernetes Nodes Slowly Waste Resources

No alerts, rising costs. WhyRequests stay high while actual usage drops. Maintenance TipRecalculate requests after load stabilizes.

Read More
Kubernetes

Kubernetes Clusters Age Without Showing Errors

- 13.01.26 - ErcanOPAK comment on Kubernetes Clusters Age Without Showing Errors

Everything green, costs go up. WhyUnused resources are rarely reclaimed automatically. Tip Audit requests vs real usage periodically.

Read More
Kubernetes

Kubernetes Services Work But Traffic Is Uneven

- 12.01.26 - ErcanOPAK comment on Kubernetes Services Work But Traffic Is Uneven

Some pods are overloaded, others idle. WhyClient-side connection reuse breaks load balancing. Tip Tune keep-alive and connection pools.

Read More
Kubernetes

Kubernetes Pods Restart Without Errors

- 11.01.26 - ErcanOPAK comment on Kubernetes Pods Restart Without Errors

Everything looks “normal”. WhyOOMKills don’t always surface clearly. Tip Check container memory limits vs actual usage patterns.

Read More
Kubernetes

Kubernetes Deployments Appear “Healthy” but Perform Poorly

- 07.01.26 - ErcanOPAK comment on Kubernetes Deployments Appear “Healthy” but Perform Poorly

Pods are green, users complain. WhyResource limits hide throttling issues. Fix Monitor CPU throttling, not just pod status. Healthy pods can still be starved.

Read More
Kubernetes

Kubernetes Pods Get Killed Without Errors

- 06.01.26 - ErcanOPAK comment on Kubernetes Pods Get Killed Without Errors

No logs. Just gone. WhyOOMKill triggered before logging flush. FixIncrease memory requests, not limits.

Read More
Kubernetes

Kubernetes Pods Restart Without Scaling Events

- 05.01.26 - ErcanOPAK comment on Kubernetes Pods Restart Without Scaling Events

Traffic increases, no scale-out. WhyRequests never hit resource thresholds. FixTune resource requests, not limits.

Read More
Kubernetes

Kubernetes ConfigMap Changes Don’t Apply

- 04.01.26 - ErcanOPAK comment on Kubernetes ConfigMap Changes Don’t Apply

You updated config, app ignores it. WhyConfigMaps are not auto-reloaded. FixRestart pods or mount with checksum-based rollout.

Read More
Kubernetes

Kubernetes HPA Doesn’t Scale When Traffic Spikes

- 03.01.26 - ErcanOPAK comment on Kubernetes HPA Doesn’t Scale When Traffic Spikes

Metrics look fine, pods stay the same. WhyCPU-based autoscaling ignores I/O-bound workloads. FixScale using custom or request-based metrics.

Read More
Kubernetes

Kubernetes Pods Restart Without Logs

- 03.01.26 - ErcanOPAK comment on Kubernetes Pods Restart Without Logs

No errors, no stack traces. WhyThe container is killed before logs flush (OOMKill). FixInspect pod events, not container logs.

Read More
Page 1 of 2
1 2 Next »

Posts navigation

Older posts
February 2026
M T W T F S S
 1
2345678
9101112131415
16171819202122
232425262728  
« Jan    

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (934)
  • How to add default value for Entity Framework migrations for DateTime and Bool (830)
  • Get the First and Last Word from a String or Sentence in SQL (822)
  • How to select distinct rows in a datatable in C# (799)
  • How to make theater mode the default for Youtube (708)
  • Add Constraint to SQL Table to ensure email contains @ (572)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (552)
  • Average of all values in a column that are not zero in SQL (517)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (473)
  • Find numbers with more than two decimal places in SQL (436)

Recent Posts

  • C#: Use init Accessor to Create Immutable Objects Without Constructor Boilerplate
  • C#: Use Index and Range Operators for Cleaner Array Slicing
  • C#: Use Null-Coalescing Assignment to Simplify Lazy Initialization
  • SQL: Use CHAR Instead of VARCHAR for Fixed-Length Columns to Save Space
  • SQL: Use CROSS APPLY Instead of Subqueries for Better Performance
  • .NET Core: Use Required Modifier to Force Property Initialization
  • .NET Core: Use Global Using Directives to Avoid Repeating Imports
  • Git: Use git restore to Unstage Files Without Losing Changes
  • Git: Use git bisect to Find Which Commit Introduced a Bug
  • AJAX: Use Fetch with Signal to Cancel Requests When User Navigates Away

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (934)
  • How to add default value for Entity Framework migrations for DateTime and Bool (830)
  • Get the First and Last Word from a String or Sentence in SQL (822)
  • How to select distinct rows in a datatable in C# (799)
  • How to make theater mode the default for Youtube (708)

Recent Posts

  • C#: Use init Accessor to Create Immutable Objects Without Constructor Boilerplate
  • C#: Use Index and Range Operators for Cleaner Array Slicing
  • C#: Use Null-Coalescing Assignment to Simplify Lazy Initialization
  • SQL: Use CHAR Instead of VARCHAR for Fixed-Length Columns to Save Space
  • SQL: Use CROSS APPLY Instead of Subqueries for Better Performance

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2026 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com