<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Kubernetes on Kubernetes Fail</title><link>https://kubernetes.fail/tags/kubernetes/</link><description>Recent content in Kubernetes on Kubernetes Fail</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 15 Apr 2024 09:15:00 +0200</lastBuildDate><atom:link href="https://kubernetes.fail/tags/kubernetes/index.xml" rel="self" type="application/rss+xml"/><item><title>RBAC Misconfiguration Leads to Security Breach</title><link>https://kubernetes.fail/posts/rbac-misconfiguration/</link><pubDate>Mon, 15 Apr 2024 09:15:00 +0200</pubDate><guid>https://kubernetes.fail/posts/rbac-misconfiguration/</guid><description>&lt;h2 id="security-incident"&gt;Security Incident&lt;/h2&gt;&#10;&lt;p&gt;An overly permissive RBAC configuration allowed an attacker to:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Gain access through a compromised developer account&lt;/li&gt;&#10;&lt;li&gt;Escalate privileges using cluster-admin binding&lt;/li&gt;&#10;&lt;li&gt;Deploy cryptocurrency mining containers&lt;/li&gt;&#10;&lt;li&gt;Access sensitive data from other namespaces&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h2 id="how-it-happened"&gt;How It Happened&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Default namespace had cluster-admin role binding&lt;/li&gt;&#10;&lt;li&gt;No network policies between namespaces&lt;/li&gt;&#10;&lt;li&gt;No pod security policies enforced&lt;/li&gt;&#10;&lt;li&gt;Developer accounts had excessive permissions&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="immediate-actions"&gt;Immediate Actions&lt;/h2&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Revoked all compromised credentials&lt;/li&gt;&#10;&lt;li&gt;Deleted malicious pods&lt;/li&gt;&#10;&lt;li&gt;Isolated affected nodes&lt;/li&gt;&#10;&lt;li&gt;Rotated all cluster certificates&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h2 id="long-term-fixes"&gt;Long-term Fixes&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Implemented principle of least privilege&lt;/li&gt;&#10;&lt;li&gt;Enabled network policies&lt;/li&gt;&#10;&lt;li&gt;Deployed pod security admission&lt;/li&gt;&#10;&lt;li&gt;Regular RBAC audits&lt;/li&gt;&#10;&lt;li&gt;Developer security training&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>Network Partition Causes Split-Brain</title><link>https://kubernetes.fail/posts/network-outage/</link><pubDate>Sun, 14 Apr 2024 14:30:00 +0200</pubDate><guid>https://kubernetes.fail/posts/network-outage/</guid><description>&lt;h2 id="the-incident"&gt;The Incident&lt;/h2&gt;&#10;&lt;p&gt;A network partition between availability zones caused our etcd cluster to split into two separate quorums, resulting in:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Inconsistent cluster state&lt;/li&gt;&#10;&lt;li&gt;Scheduling conflicts&lt;/li&gt;&#10;&lt;li&gt;Data corruption in stateful applications&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="root-cause"&gt;Root Cause&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Network provider had a routing issue between zones&lt;/li&gt;&#10;&lt;li&gt;Our etcd cluster was spread across 3 zones but had no zone-aware configuration&lt;/li&gt;&#10;&lt;li&gt;No network partition detection or automatic fencing&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="resolution"&gt;Resolution&lt;/h2&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Manually identified the healthy partition&lt;/li&gt;&#10;&lt;li&gt;Forced etcd to use only the healthy members&lt;/li&gt;&#10;&lt;li&gt;Rebuilt the unhealthy nodes from backups&lt;/li&gt;&#10;&lt;li&gt;Implemented zone-aware etcd configuration&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h2 id="prevention"&gt;Prevention&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Configure etcd with strict zone awareness&lt;/li&gt;&#10;&lt;li&gt;Implement network health checks&lt;/li&gt;&#10;&lt;li&gt;Regular disaster recovery drills&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>First Kubernetes Failure: Node Out of Disk</title><link>https://kubernetes.fail/posts/first-post/</link><pubDate>Sat, 13 Apr 2024 10:00:00 +0200</pubDate><guid>https://kubernetes.fail/posts/first-post/</guid><description>&lt;h2 id="what-happened"&gt;What Happened&lt;/h2&gt;&#10;&lt;p&gt;Our production Kubernetes cluster experienced a complete outage when all worker nodes ran out of disk space simultaneously. This was caused by:&lt;/p&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;Unbounded log growth from a misconfigured application&lt;/li&gt;&#10;&lt;li&gt;No disk space monitoring alerts&lt;/li&gt;&#10;&lt;li&gt;Default emptyDir volumes filling up node storage&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h2 id="the-impact"&gt;The Impact&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;All pods became pending as nodes were marked unschedulable&lt;/li&gt;&#10;&lt;li&gt;4 hours of downtime during peak traffic&lt;/li&gt;&#10;&lt;li&gt;Data loss for applications using emptyDir storage&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;h2 id="lessons-learned"&gt;Lessons Learned&lt;/h2&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;&lt;strong&gt;Monitor disk usage&lt;/strong&gt;: Set up alerts at 70%, 80%, and 90% capacity&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Log rotation&lt;/strong&gt;: Configure proper log rotation for all containers&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Resource limits&lt;/strong&gt;: Set storage limits on emptyDir volumes&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Multi-zone deployment&lt;/strong&gt;: Distribute workloads across availability zones&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;h2 id="the-fix"&gt;The Fix&lt;/h2&gt;&#10;&lt;p&gt;We implemented:&lt;/p&gt;</description></item></channel></rss>