FOUNDING PRICING · 40% OFFfor the first 1,000 members · from ₹95/month
OutageReddit11 min read

Reddit's Pi Day Outage Explained: One Missing Node Label

How a Kubernetes 1.24 upgrade removed a node label, silently unselected Reddit's Calico route reflectors, and led to a 314-minute outage and a backup restore.

ShareXLinkedInWhatsApp
A row of open black equipment racks filled with network patch panels and bundled blue cabling, standing on a raised perforated floor in a data centre room.
A row of open black equipment racks filled with network patch panels and bundled blue cabling, standing on a raised perforated floor in a data centre room. Photo: Carl Lender from Sunrise, USA, CC BY 2.0, via Wikimedia Commons.

On 14 March 2023, Reddit was down for 314 minutes. The date and the duration gave the incident its name: the Pi Day outage. The trigger was a routine Kubernetes upgrade on one old, important cluster, and the cause, found only after the site was back, was a label on three machines that the new version removed.

Reddit's engineers wrote a frank post-mortem. The root cause shows how a system can depend on a name that nobody remembers choosing, and the recovery shows what it is like to restore from a backup you have never used in production.

A before and after diagram: under Kubernetes 1.23 the three control plane nodes carry the label node-role.kubernetes.io/master, the Calico peering selector matches them and every worker node exchanges routes through them, and under 1.24 the label is removed, the selector matches nothing, the sessions drop and pods on different nodes can no longer reach each other.

What broke for users, and when

Reddit's post says that people visiting during the afternoon of 14 March, US time, saw an error page, or a home page with no posts. In India it began about half an hour after midnight on 15 March and ran until nearly dawn.

Not everything inside Reddit failed. According to the post-mortem, the newer service API layers stayed up. The cluster that broke runs the legacy part of the stack, the one the community calls Old Reddit, and it sits at the most critical point in Reddit's dependency graph. So most things a user can do still passed through it, and the site was effectively down.

Reddit runs its incidents in UTC. Add 5 hours 30 minutes for IST. The post gives some exact times and some elapsed times, and the table keeps them as given.

WhenWhat happened
Just after 19:00 UTCAn engineer starts upgrading the legacy cluster from Kubernetes 1.23 to 1.24.
19:04:49 UTCAPI server log volume jumps five times over in an instant. The site stops serving.
About 3 minutes inAn incident is open and responders are on a call. The cluster's metrics are gone.
About 1 hour inNo fix yet. A sub-team splits off to prepare a restore from backup, as a contingency.
Over 2 hours inThe team decides to restore. Terminating the worker nodes alone takes about 20 minutes.
After the restoreNew control plane nodes are slow to launch, then fail to join. Both problems are fixed.
Final phaseTraffic is let back in steps: 1%, 5%, 10%, 20%, 35%, 55%, 80%, 100%.
314 minutes in totalThe outage is over. The cause is still unknown.

The cluster, the upgrade and the first hours

Kubernetes runs containers across a fleet of machines called nodes. A few control plane nodes hold the cluster's brain: the API server and etcd, the database that stores the cluster's state. The rest are worker nodes that run the applications in groups of containers called pods.

Reddit's post explains that it has been on the cloud since 2009 and adopted Kubernetes early. Along the way it collected clusters that were each built by hand with the kubeadm tool, each a little different from the others. The post borrows a well-known phrase for this: the clusters were pets, not cattle.

The team had a process for this. Upgrades were tested on dedicated clusters first, then rolled out to production from the least critical cluster to the most critical. This upgrade had been through that process.

Within minutes the responders learned that the cluster had lost all of its metrics. Only the graphs at the CDN edge, which Reddit keeps separate on purpose, still worked. What they could see was strange:

  • DNS lookups for names inside the cluster failed, yet public DNS names resolved normally.
  • Pods took a very long time to start and stop.
  • Container images smaller than 100 MB took minutes to pull.
  • The pods of Calico, the cluster's networking layer, were unhealthy.

The first instinct with a bad deployment is to roll it back. Here that was not simple. As the post explains, Kubernetes has no supported downgrade. An upgrade migrates stored data forward automatically and there is no reverse path, so going back means restoring from a backup. The team estimated hours of certain downtime for that, so they first tried to fix forward.

They restarted Calico's components, then the whole control plane. They found the API server timing out on calls to an admission webhook, Open Policy Agent, and removed that webhook's configuration. The timeouts stopped. The cluster did not recover.

A person in a checked shirt crouching at the open rear of a server rack with a laptop on the floor beside them, surrounded by network cables.
Hands-on work at the back of a rack at the NERSC computing centre in 2011. An illustration of data centre work; not Reddit's infrastructure, which runs on AWS. Photo: Derrick Coetzee, CC0, via Wikimedia Commons.

The restore nobody had run before

After more than two hours the team made the call to restore. The upgrade procedure had taken a backup, as it always did. But the restore procedure had been written years earlier. It had been tested on pilot clusters and never used on a production cluster. Nobody on the call had performed it.

The plan was short: terminate two of the three control plane nodes, downgrade the remaining one, restore the backup onto it, then launch fresh control plane nodes to join it. Almost every step hid a surprise.

  • The document was out of date. It was written for a Kubernetes version that had since reached end of life, and for Docker. The cluster now used a different container runtime, CRI-O, so commands had to be rewritten live.
  • The cloud had no room. When the team launched the replacement control plane nodes, AWS had run out of capacity for that instance type, and they had to wait.
  • The new nodes would not join. They could not connect to etcd on the restored node. The backup could be taken on any control plane node, but the restore had to happen on the same node, and it had not. The restored node was presenting TLS certificates issued for a different hostname, so its peers rejected it. The team generated new certificates and the nodes joined.
A three-row diagram of the recovery: a first phase of over two hours trying to fix forward, a restore phase in which three obstacles appear in turn (a procedure written for an old version and for Docker, no AWS capacity for control plane nodes, and TLS certificates with the wrong hostname), and a final phase in which traffic returns in eight steps from 1% to 100%, for 314 minutes in total.
314 minutes: fix forward, restore, then a slow ramp

Even then they did not open the doors. Reddit leans on caches, and after hours of downtime those caches were cold, and the post notes that idle services tend to scale down. Sending all users back at once would have hit the backends with a stampede. So traffic came back in eight steps, starting at 1%.

The root cause: a label that 1.24 removed

The answer came later, from logs. Reddit's metrics lived inside Kubernetes and died with it, but its logging agent worked at a lower level and kept running. In Calico's logs, two seconds before the API server logs exploded, nodes across the cluster began dropping routes. Dropping routes to the one control plane node being upgraded was expected. Dropping all routes to all nodes was not.

To see why that happened you need to know how Calico moves packets. Each pod has its own IP address, and every node must learn which node hosts which pod addresses. Calico spreads this information with BGP, the same routing protocol that connects networks on the internet. By default every node holds a BGP session with every other node, a full mesh. Calico's documentation says this is fine up to roughly 100 nodes. Beyond that the number of sessions grows too fast, because a mesh of n nodes needs n(n-1)/2 of them.

The standard fix is route reflectors. A few nodes are chosen as reflectors. Every other node peers only with them, and the reflectors pass routes along.

A diagram comparing two ways to share routes: a full mesh in which seven nodes need 21 BGP sessions, and a route reflector layout in which three reflectors mesh with each other and four workers peer only with the reflectors, with a note that 1,000 nodes need 499,500 sessions in a full mesh and 2,994 with three reflectors.
Why large clusters use route reflectors

Years earlier, a previous team had set this up on Reddit's largest clusters. They made the control plane nodes the reflectors, which is a sensible choice in an autoscaled cluster where those are the only nodes that are always present. In Calico this is expressed with selectors that pick nodes by label. Reddit's post says that both the nodeSelector and the peerSelector in its reflector configuration targeted the label node-role.kubernetes.io/master. A simplified peering rule of that kind looks like this (an illustration in the style of Calico's documentation, not Reddit's actual file):

apiVersion: projectcalico.org/v3
kind: BGPPeer
metadata:
  name: peer-with-route-reflectors
spec:
  nodeSelector: all()
  peerSelector: has(node-role.kubernetes.io/master)

Kubernetes had been moving away from the word "master" towards "control-plane" since the 1.20 release. The 1.24 release notes say what the final step does: when a cluster is upgraded with kubeadm upgrade apply, the command removes the label node-role.kubernetes.io/master from existing control plane nodes.

So the upgrade took away the label, and a selector that matches a missing label matches no nodes. Nothing crashed and no error was raised. The peering rules simply no longer pointed at the reflectors, routes were withdrawn across the cluster, and pods on different nodes lost the ability to talk to each other. The post does not walk through each symptom in turn, but a broken pod network fits what the responders had seen: an admission webhook that timed out, and DNS that failed only for names served from inside the cluster.

Two rack-mounted Ethernet switches with green status lights below three patch panels, joined by neatly looped grey patch cables.
Physical networks are wired by hand, cable by cable. A cluster's pod network is wired by configuration, and one unmatched selector can unplug all of it. Illustrative; not Reddit's equipment. Photo: Dsimic, CC BY-SA 4.0, via Wikimedia Commons.

Why the safeguards did not catch it

The test clusters were not the same as this one. Reddit says only its largest and oldest clusters used route reflectors. An upgrade rehearsed on a cluster without them cannot show this failure, and the post says the problem had never appeared in earlier upgrades or in tests.

The configuration was written down nowhere. The post explains that part of Calico's route reflector setup is managed through Calico's own command line tool, by fetching data, editing it by hand and uploading it back. Reddit had not built tooling to keep that in version control. No file in any repository contained the word "master" for a reviewer or a search to find.

The people who knew had moved on. The engineers who set up the reflectors had changed roles or left. During the incident nobody knew the feature was in use, so nobody could suspect it. One engineer remembered it during the post-mortem and traced the link.

Reddit calls the label the proximate cause. The underlying cause, in its words, is inconsistency: nearly every critical cluster was unique in some way.

What Reddit said it is changing

The post describes a direction more than a checklist:

  • Standardise components across clusters, and keep unique configurations only where there is no alternative.
  • Run more pre-production clusters that genuinely resemble production, so upgrades can be tested with confidence.
  • Build tooling that manages the lifecycle of whole clusters, so they look alike and can be recreated.
  • Put everything possible into code, for consistency and for a historical record. Where that cannot be done, document it in detail and look for a replacement.
  • Improve the backup and restore process, which the post describes as full of pitfalls.

The computer science underneath

How pods find each other. In Kubernetes every pod gets its own IP, and a network plugin has to make those addresses reachable from every node. The lesson on Kubernetes networking: pod IPs, CNI, Services, kube-proxy and Ingress walks through that model. When the plugin's routing fails, pods keep running but become islands.

BGP and route reflection. BGP: how the internet routes itself explains sessions, route advertisements and withdrawals. The full mesh requirement inside one network, and route reflectors as the way around its quadratic cost, are classic BGP topics.

A backup is only as good as its restore. Backups, point-in-time recovery and planning for disaster makes the point that an untested restore is a hope, not a plan. Reddit's backup was fine. The procedure around it had drifted: wrong runtime, wrong node, wrong certificates.

Cold starts and stampedes. Bringing a site back is its own risk. Cache invalidation and stampedes covers what happens when many requests miss an empty cache together, and why a gradual ramp protects the systems behind it.

Learning from incidents. The post follows the practice in incident response and blameless post-mortems: a contingency prepared before it was needed, and a write-up that looks for systemic causes.

What an interviewer could ask from this

Why could Reddit not just roll the upgrade back? Kubernetes does not support downgrades. Upgrades migrate stored state forward, so returning to the old version means restoring the control plane's data from a backup.

What is a route reflector and why use one? A BGP speaker that redistributes routes between its clients. It replaces a full mesh of n(n-1)/2 sessions with a few sessions per node, which large clusters need.

How did removing a label break networking? The peering configuration selected the reflectors by that label. With the label gone the selector matched nothing, the BGP sessions were no longer configured, and nodes withdrew the routes to each other's pods.

Why did the new control plane nodes fail to join after the restore? The backup was restored onto a different node from the one it was taken on. The certificates it presented named another host, so TLS verification failed when peers connected to etcd.

How would you guard against a selector that silently matches nothing? Keep the configuration in version control, alert when a selector that should match a known set of nodes matches none, monitor the number of established BGP sessions, and use labels you own instead of labels another tool manages.

Takeaways

  • The cluster depended on a label that another tool owned. When that tool renamed it, a selector quietly matched nothing.
  • Configuration that lives outside version control cannot be reviewed, searched or tested, and it leaves when its authors do.
  • A test environment only protects you from failures it is capable of having. This one needed a feature that only the largest, oldest clusters used.
  • Practise restores on the real thing. The backup worked; the instructions, the cloud capacity and the certificates were what went wrong.
  • After a long outage, recovery is a controlled ramp, not a switch.

Sources

  1. Reddit Engineering: You Broke Reddit, The Pi-Day Outage (read via the Wayback Machine)
  2. Kubernetes: CHANGELOG for v1.24 (kubeadm removal of the node-role.kubernetes.io/master label)
  3. Calico documentation: Configure BGP peering (full mesh, route reflectors, BGPPeer selectors)

Written by the Codevizag Academy team

An independent explainer built from the public sources listed above. Codevizag Academy is not affiliated with Reddit. Found a mistake? Write to support@codevizag.com.

More case studies

Understood it? Now prove it.

The lessons behind this case study are free, and 20 problems a month are judged on real test cases at no cost.

Start solving free