{"id":"IL-0198","org":"Datadog","date":"2023-03-08","docs":[],"title":{"en":"An automatic Ubuntu security update restarted systemd-networkd, which flushed the IP rules Cilium relied on and cut more than 60 percent of Datadog's Kubernetes nodes off the network across regions and cloud providers","ko":"systemd 보안 패치가 Ubuntu 22.04 노드의 systemd-networkd 를 재시작해 Cilium 이 넣은 IP 규칙을 지웠고, 여러 리전과 세 클라우드의 Kubernetes 노드가 한꺼번에 네트워크를 잃었다."},"domain":["kubernetes","networking","aws","gcp","azure"],"impact":{"scope":"All Datadog services across multiple regions; more than 60 percent of instances lost network connectivity, including the regions hosting CI/CD and automation tools","users":"unknown","region":"Multiple regions on AWS, Google Cloud and Azure, including EU1 and US1"},"review":{"written_by":"session","reviewed_at":null,"reviewed_by":null},"lessons":{"en":"A change in a base operating system component can stay dormant for months until something restarts that component. Here the trigger was a security patch, and the change reached every region at once because automatic OS updates ran outside the progressive, region-by-region process used for every other change.\n\nCloud providers react differently to an instance that loses its network. Google Cloud and Azure left the instances running, so a restart recovered them with their disks; AWS replaced them quickly, which brought stateless services back fast but destroyed the local-disk data the stateful services needed.","ko":"기본값 그대로 둔 OS 무인 보안 업데이트는 단계적 배포 절차를 거치지 않고 모든 리전과 클라우드에 같은 시각에 변경을 적용한다. systemd-networkd 의 새 동작은 22.04 도입 때부터 있었지만 systemd-networkd 가 재시작될 때만 나타나서 몇 달 동안 보이지 않았다. CNI 가 호스트의 IP 규칙에 기대고 있으면, 그 규칙을 지우는 다른 구성 요소 하나가 노드 네트워크 전체를 끊는다. 클라우드마다 네트워크를 잃은 인스턴스를 다루는 방식이 다르고, 로컬 디스크에 데이터를 두는 서비스에서는 자동 교체가 오히려 복구를 늦춘다."},"related":[],"sources":[{"url":"https://www.datadoghq.com/blog/engineering/2023-03-08-deep-dive-into-platform-level-impact/","kind":"blog","license":"unknown","archived":null}],"summary":{"en":"In December 2020, a change in systemd v248 made systemd-networkd remove every IP rule it does not know about when it starts; v249 added the ManageForeignRoutingPolicyRules setting to turn that off, and both changes were backported to v248 and v247. Ubuntu 22.04 ships systemd v249 with the default that manages foreign rules, while Ubuntu 20.04 uses v245 without either change. Datadog had tested 22.04 from June 2022 and rolled it out progressively from November 2022, reaching more than 90 percent of the fleet by 8 March. The new behaviour had never shown, because systemd-networkd only started when a host was created, before any routing rules existed.\n\nPods at Datadog get IP addresses from the cloud network, and Cilium makes this work by installing host routes and rules. On AWS (ipam=eni) and Azure (ipam=azure) pods use an extra network interface, so Cilium adds source routing rules per pod. On all three providers Cilium also moves the default \"from all lookup local\" rule from priority 0 to 100, so that traffic leaving its L7 proxy can be routed correctly. When the patched systemd restarted systemd-networkd, it deleted these rules and did not put back the priority-0 local rule. Traffic to the node's own IP was no longer treated as local, so every affected node lost host connectivity on all providers, and pods also lost connectivity on AWS and Azure.\n\nThe nodes kept Ubuntu's default unattended-upgrades settings: download package updates twice a day with up to 12 hours of random delay, and install security updates once a day at 06:00 UTC with up to 60 minutes of delay. Datadog does not depend on these upgrades and patches its fleet by replacing nodes progressively, cluster by cluster and region by region, with bake times of a week to a month, but unattended upgrades had never been disabled. They applied the patch everywhere within the same hour. Nodes on Ubuntu 20.04, and nodes that had not yet downloaded the new package (for example Google Cloud nodes whose update check ran before about 18:50 UTC on 7 March), were not affected. In total more than 60 percent of instances were disconnected.\n\nRecovery depended on the provider. On Google Cloud and Azure, thousands of instances were restarted through the cloud APIs and kept their local disks. On AWS, automatic replacement of tens of thousands of instances destroyed local-disk data that many data stores, caches and coordination systems relied on, so that data had to be rebuilt through replication, reprocessing or restore from backup. Datadog understood the cause within the first two to three hours; the recovery took longer and is described in a separate post.","ko":"systemd v248 부터 systemd-networkd 는 시작할 때 자신이 모르는 IP 규칙을 모두 지운다. v249 에서는 ManageForeignRoutingPolicyRules 설정으로 이 동작을 끌 수 있게 됐다. Ubuntu 20.04 의 systemd v245 에는 이 변경이 없지만, Ubuntu 22.04 는 v249 를 쓰고, 기본 설정에서 이 동작이 켜져 있다. Datadog 은 2022년 11월부터 22.04 를 단계적으로 배포했고, 3월 8일에는 전체 노드의 90% 넘게 22.04 였다. 그동안 systemd-networkd 는 새 호스트를 만들 때만 시작됐고, 그때는 지울 라우팅 규칙이 없어서 문제가 드러나지 않았다.\n\n3월 7일 systemd 의 CVE 패치가 나왔다. 이 패치를 설치하면 systemd-networkd 를 포함한 systemd 구성 요소가 모두 재시작된다. Datadog 서버는 Ubuntu 무인 업그레이드 기본값을 그대로 썼다. 패키지는 하루 두 번 6:00 과 18:00 UTC 에 최대 12시간의 무작위 지연을 두고 내려받고, 업그레이드는 매일 6:00 UTC 에 최대 60분의 무작위 지연을 두고 실행한다. Datadog 은 노드를 주기적으로 교체하면서 리전과 클러스터별로 단계적으로 패치를 배포하고 있었지만, 무인 업그레이드는 꺼 두지 않았다. 그래서 새 systemd 를 미리 내려받은 22.04 노드가 모두 같은 한 시간 안에 패치를 설치했다.\n\nDatadog 은 Cilium 으로 파드 네트워크를 관리하고, 파드는 클라우드 VPC 의 IP 를 받는다. AWS 와 Azure 에서는 파드용 추가 인터페이스를 쓰므로 Cilium 이 파드 IP 마다 소스 라우팅 규칙을 넣는다. 모든 클라우드에서 Cilium 은 우선순위 0 인 local 조회 규칙을 우선순위 100 으로 옮긴다. systemd-networkd 가 이 규칙들을 지우자, AWS 와 Azure 에서는 파드 트래픽이 잘못된 인터페이스로 나가 클라우드 네트워크에서 버려졌다. 모든 클라우드에서 local 조회 규칙이 사라지면서 노드 IP 로 돌아오는 응답이 로컬로 전달되지 않고 기본 경로로 다시 나갔고, 노드가 네트워크를 완전히 잃었다.\n\n결과는 클라우드마다 달랐다. Google Cloud 와 Azure 는 게스트 OS 수준의 문제로는 인스턴스를 교체하지 않으므로 인스턴스가 네트워크 없이 살아 있었고, 재시작으로 디스크와 함께 되살릴 수 있었다. AWS 는 상태 검사에 실패한 Auto Scaling 그룹 인스턴스를 종료하고 교체했다. 그래서 stateless 워크로드는 빨리 회복했지만, 로컬 디스크에 데이터를 두는 데이터 저장소들은 데이터를 잃어 복구가 늦어졌다. 팀은 이 원인을 장애 첫 두세 시간 안에 파악했지만, 전체 복구는 그 뒤로도 오래 이어졌다."},"trigger":{"en":"On 7 March 2023 Ubuntu published a systemd patch for a CVE (249.11-0ubuntu3.7). Ubuntu's default unattended upgrades installed it on the nodes between 06:00 and 07:00 UTC on 8 March, and installing it restarted systemd-networkd.","ko":"2023년 3월 7일 Ubuntu 저장소에 systemd 의 CVE 패치 249.11-0ubuntu3.7 이 올라왔다. 3월 8일 06:00 에서 07:00 UTC 사이에 Ubuntu 기본값 그대로 둔 무인 업그레이드가 이 패치를 설치했고, systemd-networkd 가 재시작되면서 자신이 모르는 IP 규칙을 모두 지웠다."},"severity":"unknown","symptoms":["node-not-ready","service-unavailable","throughput-degraded"],"timeline":{"detected_after":null,"resolved_after":null},"date_kind":"incident","detection":null,"components":["systemd-networkd","cilium","node-image"],"root_cause":"upgrade-breaking-change","remediation":[{"text":{"en":"restarted thousands of disconnected instances on Google Cloud and Azure through the cloud APIs, keeping their local disks","ko":"Google Cloud 와 Azure 에서 네트워크만 잃고 실행 중이던 인스턴스 수천 대를 클라우드 API 로 재시작해 로컬 디스크의 데이터와 함께 복구했다."}},{"text":{"en":"rebuilt the data lost with terminated AWS instances' local disks through replication, reprocessing and restores from backup","ko":"AWS 에서 교체되면서 로컬 디스크를 잃은 데이터 저장소는 데이터를 다시 만들거나, 다시 처리하거나, 백업에서 복원해 되살렸다."}}],"action_items":[],"contributing":["default-config-unchanged","delayed-effect-change","no-staged-rollout","automation-amplified"],"recurrence_of":null,"symptoms_text":{"en":"Between 06:00 and 07:00 UTC on 8 March 2023, Kubernetes nodes in several Datadog regions lost network connectivity at the same time, on AWS, Google Cloud and Azure. All services across multiple regions were affected, including the regions that host Datadog's CI/CD and automation tools. Datadog's regions are not connected to each other and changes are rolled out one region at a time, so a simultaneous failure on several cloud providers looked implausible at first.\n\nOn Google Cloud and Azure the instances kept running without network. Packets sent per second across the EU1 region fell from hundreds of millions to almost zero between 06:00 and 07:00, and later rose to twice the usual rate while the backlog was processed. The providers did not replace these instances, because they only auto-repair guest operating system failures when HTTP health checks are configured, and Datadog relies on the Kubernetes control plane instead.\n\nOn AWS, instances that lost connectivity failed their status checks and Auto Scaling groups terminated and replaced them. In US1 more than 8 percent of instances were terminated every 10 minutes between 06:00 and 07:00 UTC, and by 08:00 AWS had replaced about 60 percent of the region's instances, tens of thousands. Stateless services there recovered fast, so the first assessment was that Google Cloud and Azure were in worse shape; it later became clear that AWS was harder to recover, because the data on the terminated instances' local disks was gone.\n\nOn an affected node, ip rule listed only \"32766: from all lookup main\" and \"32767: from all lookup default\". The rules Cilium installs, such as \"100: from all lookup local\" and per-pod source routing rules like \"111: from 10.132.126.226 lookup 11\", were gone. ip route get showed pod traffic to 8.8.8.8 leaving through the host interface ens5 instead of the pod interface ens6, and reply traffic addressed to the host IP being sent back out through ens5 instead of being delivered locally, so the cloud network dropped both.","ko":"2023년 3월 8일 06:00 에서 07:00 UTC 사이에 여러 리전과 여러 클라우드의 Kubernetes 노드가 한꺼번에 네트워크 연결을 잃었다. Datadog 의 모든 서비스가 영향을 받았고, CI/CD 와 자동화 도구가 있는 리전도 함께 끊겼다.\n\nEU1 리전 인스턴스가 보내는 패킷 수는 06:00 에서 07:00 사이에 초당 수억 개에서 거의 0으로 떨어졌다. 네트워크를 잃은 노드에서 ip rule 을 보면 32766: from all lookup main 과 32767: from all lookup default 두 줄만 남아 있었다. Cilium 이 넣은 파드 경로 규칙과 100: from all lookup local 규칙이 사라진 상태였다.\n\nGoogle Cloud 와 Azure 의 인스턴스는 네트워크 없이 계속 실행됐고, 웹 트래픽을 받는 stateless 서비스 다수가 내려가거나 크게 느려졌다. AWS 에서는 상태 검사가 네트워크를 잃은 인스턴스를 비정상으로 보고 종료한 뒤 교체했다. US1 에서는 06:00 에서 07:00 UTC 사이에 10분마다 인스턴스의 8% 넘게 종료됐고, 08:00 까지 리전 인스턴스의 약 60%, 수만 대가 교체됐다. 교체된 인스턴스의 로컬 디스크 데이터는 함께 사라졌다.\n\n팀은 처음에 stateless 서비스가 많이 내려간 Google Cloud 와 Azure 리전이 AWS 리전보다 나쁜 상태라고 판단했다. 나중에야 로컬 디스크 데이터를 대량으로 잃은 AWS 쪽이 복구하기 훨씬 어렵다는 것을 알았다."},"updated_at":"2026-11-09T11:55:59.312142Z","url":"https://benchlet.com/incidentlib/app/cases/IL-0198","org_slug":"datadog"}