Repository navigation
Add node_routing_table_wipeout problem - #818
keremakcali wants to merge 3 commits into
Conversation
|
@keremakcali Thanks for the PR! Might take a few days to review this. |
Saadmrp1038
left a comment
There was a problem hiding this comment.
@keremakcali Thanks for the effort! Since you tested on kind, there are some bugs in real cluster setup. I left some inline comments below.
I think a major mismatch happened here. A few days ago we changed our kind setup to Calico CNI (#774) replacing the default kindnet (which is not really something you would use in production and lacks a lot of features). I think you tested this fault on the old kind setup.
As it is now the fault does not work on new Calico based setup. It only works for the previous bridge CNI (kindnet). Calico's Felix agent actively monitors and re-adds per-pod routes via its RouteRefreshInterval (default 90s).
Bottom line is, I am not sure if this fault is feasible in a Calico based setup. You might need to do some more testing.
Feel free to ping us if you have any questions or confusions!
|
|
||
| def flush_pod_routes(self, node: str): | ||
| """Delete per-pod host routes from the kernel routing table on a specific worker node.""" | ||
| cmd = "ip route show | awk '/^10\\.244\\.[0-9]+\\.[0-9]+ dev veth/ {print $1}' | xargs -r -n 1 ip route del" |
There was a problem hiding this comment.
We would need to use sudo to make it work on real cluster.
| user = worker_info[node] | ||
| print(f"Flushing pod routes on {node}...") | ||
| self._ssh_exec(node, user, cmd) | ||
| print(f"Pod routes flushed on {node}") |
There was a problem hiding this comment.
Tested on a real cluster. The method takes a Kubernetes node name (e.g. node2.exp-242212.aiopslab-pg0.wisc.cloudlab.us) and looks it up in worker_info, which is keyed by ansible SSH hostnames (e.g. c220g5-120130.wisc.cloudlab.us). These never match, so the method prints "Node not found in inventory" and returns without doing anything. Check what faults like inject_kubelet_crash and pod_cidr_exhaustion_hotel_reservation do.
|
@keremakcali when you created the RFC we did not have Calico in kind :) You would need to clean up you old kind cluster and create a new one with the setup_kind_cluster.sh script. |
|
@Saadmrp1038 thanks a lot for the review! I came to realize this issue today as well. I should have done more research on how other CNIs handle this problem before submitting. I will do some testing as soon as I can and hopefully figure something out :") |
|
@keremakcali feel free to pivot to some other faults if you feel stuck on this one after trying. |
|
Upon testing I decided not to go forward with this problem and worked on a different fault class instead. The new PR is: #847. |
Adds a new SREGym problem simulating the removal of per-pod kernel routes from a single worker node's routing table, using Hotel Reservation as the workload.
The real-world failure story
The motivating incident is the Datadog March 8, 2023 outage. A systemd security patch on Ubuntu 22.04 restarted
systemd-networkd, which flushed IP routing rules that Cilium had installed on the affected nodes. Pods on those nodes lost network connectivity, and the nodes themselves became unreachable. About 60% of Datadog's instances across every region were affected.Reference: https://www.datadoghq.com/blog/engineering/2023-03-08-deep-dive-into-platform-level-impact/
How the failure is simulated
This is a simplified analog of the Datadog scenario. On a single worker node it deletes the per-pod host routes (
10.244.x.y dev vethXXX scope link) that the CNI writes at pod creation to deliver traffic to each local pod.The fault leaves inter-node pod-CIDR routes (
10.244.x.0/24 via <node-ip>) alone. The CNI's reconciler periodically reinstalls these inter-node routes if they go missing, so flushing them too would converge to the same end state within seconds. Per-pod host routes are not part of that reconcile path — they are only rewritten when a pod is created.The fault is implemented as a new problem class
NodeRoutingTableWipeoutatsregym/conductor/problems/node_routing_table_wipeout.pyand registered inregistry.py. The route flush itself is exposed as a newflush_pod_routes(node)method onRemoteOSFaultInjector, which runs:on the target node.
Victim node selection intersects worker nodes with nodes that have hotel-reservation pods; this guarantees
ServiceEndpointDownfires deterministically. Recovery deletes every pod on the victim node across every affected namespace — not just hotel-reservation — because the route flush is node-scoped and any pod that was on the node when the routes were deleted needs its veth route reinstalled by the CNI at recreation.Diagnosis uses
LLMAsAJudgeOraclewith a structured root cause string identifying the kernel routing table on the affected node as the origin of the failure. Mitigation usesAlertOracleagainst the existingServiceEndpointDownrule, which already covers hotel-reservation.The problem runtime behavior
Verified the behavior on a 4-node kind cluster (1 control-plane, 3 workers). The fault is injected simply by executing the command above on the victim node. The victim node stays
Ready.ip route showon the affected node confirms the missing veth entries. Pods on the victim node cannot complete TCP connections in either direction. Pods that don't depend on other services over the network stayRunning/Ready; pods that do can panic or enterCrashLoopBackOff. Within about a minute,ServiceEndpointDownfires for every Service backed by a pod on the victim node. Cross-node monitoring may surface incidental noise in other namespaces.The agent behavior
Tested with Stratus on Claude Haiku 4.5. The agent diagnosed startup race conditions between services and MongoDB, blaming missing readiness probes and dependency ordering. In the mitigation stage the agent spent a lot of time deleting specific MongoDB pods that happened not to be on the victim node, without broadening to a node-wide restart.
The agent followed the most visible signals —
CrashLoopBackOffon the reservation pod and MongoDB connection panics in pod logs — and never traced the failure down to the node or routing layer. This may reflect a difficulty in the problem: the visible symptoms point at the application while the fault sits below the Kubernetes abstraction./validate-problem node_routing_table_wipeout