devops6 min read

A One-Line Kubernetes Fix That Saved 600 Hours a Year

2 similar posts
  • Kubernetes
  • Atlantis
  • Terraform
  • GitLab
  • Kibana
  • Ceph

AI Summary

Cloudflare engineers resolved a 30-minute delay during Kubernetes pod restarts for their Atlantis automation tool. By diagnosing low-level kubelet and persistent volume logs, they discovered that the default fsGroup setting was recursively changing permissions across millions of files on every mount. Changing this policy to OnRootMismatch reduced restart times to 30 seconds, saving 600 hours of engineering time annually.

Key Takeaways

  • The issue stemmed from Kubernetes running chgrp -R recursively on persistent volumes upon mounting when fsGroup was specified.
  • Switching fsGroupChangePolicy from Always to OnRootMismatch solved the problem by avoiding unnecessary recursive permission checks.
  • The fix recovered approximately 50 hours of blocked engineering time per month.

Why it matters

Default Kubernetes security contexts can create severe performance bottlenecks on large persistent volumes due to recursive permission checks. Understanding and configuring fsGroupChangePolicy correctly can dramatically improve system availability and operational efficiency at scale.

Conversation0

What would you add from your experience?

Checking your session…

Every good conversation starts with one perspective.