Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Zalando Engineering 6 min read Incident mediumAdept

Failing to Auto Scale Elasticsearch in Kubernetes

A schedule-driven Elasticsearch cluster run by es-operator on Kubernetes repeatedly failed to scale out for the morning peak. A drain retry loop ignored context cancellation, so a nightly scale-in got stuck on the last node in an availability zone because zone awareness blocked shard relocation. After a Kubernetes 1.28 upgrade reshuffled pods on ephemeral storage, a second bug surfaced: interrupted scale-ins never removed the node from cluster.routing.allocation.exclude._ip, leaving 'zombie' excluded nodes. Mitigations were raising the nightly node count, manually clearing the exclusion list and fixing a forgotten cronjob. Crash-safe cleanup remains an open problem, and the lesson drawn is to read the code.

Related posts

  • Break Stuff on Purpose

    Slack Engineering mediumAdept

    Slack's internal Kibana cluster failed in January 2024 after running out of disk, a consequence of co-locating its Elasticsearch storage on the same hosts as the application. The rebuild exposed a nearly two-year-old unmonitored backup that failed to restore and an outdated runbook, so users' dashboards and visualizations were lost. The team added scheduled backups, checked S3 retention, rewrote runbooks, and then deliberately filled the disks on a development cluster to rehearse recovery. The drill succeeded but missed the one-hour recovery goal and surfaced missing firewall rules in infrastructure as code. A later Kubernetes migration finished with about 30 minutes of downtime, and the backup script became a CLI that restores from cloud storage with a single command.

  • 2023-03-08 incident: A deep dive into the platform-level recovery

    Datadog Engineering hardMaster

    Recovering from Datadog's March 8, 2023 multi-region outage, triggered by a systemd-networkd patch on Ubuntu 22.04 that cut network connectivity for nodes running Cilium, required restoring Kubernetes clusters in a strict order: parent control planes, then child control planes hosted on parent nodes, then application nodes. In EU1 (Google Cloud), impacted nodes could simply be rebooted. Scaling out to drain the backlog then hit a 15,500-instance network peering group limit and full pod subnets in three clusters, which normally run at around 40% IP usage. In US1 (AWS), Auto Scaling groups replaced tens of thousands of instances, so every node had to re-register through Vault, the Kubernetes API, and Cilium ENI/IP allocation via EC2 APIs, stressing those services and slowing the return to Ready capacity.

  • Migrating From Elasticsearch 7.17 to Elasticsearch 8.x: Pitfalls and Learnings

    Zalando Engineering mediumAdept

    Zalando's Search & Browse team moved their multi-cluster Elasticsearch deployment from 7.17 to 8.x, mainly to get approximate kNN vector search. They chose the official Elasticsearch Java API client over the community Scala client because it is officially maintained and has a kNN DSL. They first ran the old High Level REST Client in compatibility mode and used Testcontainers tests covering old/new client and cluster combinations. Those tests surfaced breaking changes they had to fix: the removed _type field, null is_write on aliases, date range bounds that had to be strings, action.destructive_requires_name now defaulting to true, and a mandatory nested.path on nested sorts. Cluster settings were also reworked, including node.roles, removal of deprecated thread pool and transport settings, and GC flags.

  • Node.js and the tale of worker threads

    Zalando Engineering mediumAdept

    A Node.js service using cluster mode called os.cpus().length inside a Kubernetes container, which returns the host's core count, not the pod's CPU allocation. On a 48-core node it forked 48 processes inside a 2GB pod. Each needed about 120MB, so the processes were killed under memory pressure and immediately re-forked by the exit handler, flooding a translation service with startup requests (1,000 to 20,000 rpm) and causing cancelled connections and read timeouts. The initial diagnosis of a retry feedback loop caused by process.exit() on fetch failure turned out to be wrong. The fix was to drop cluster mode and let Kubernetes handle scaling, and the incident motivated adding event-loop lag and other signals through an internal Node.js observability SDK.

  • How we migrated onto K8s in less than 12 months

    Figma mediumAdept

    Figma moved most of its core services from AWS ECS to EKS in under 12 months. It made the switch because ECS lacked StatefulSets, Helm support, easy node cordoning and access to CNCF tools like Keda, Karpenter and Istio/Envoy. The key to the timeline was tight scoping: keep the platform abstraction unchanged and only add changes that were one-way doors or cheaper to do up front. Those changes were Bazel-generated service YAMLs deployed in one step, three active EKS clusters per service to shrink blast radius, and Karpenter node autoscaling. Log pipeline changes (Vector) and pod autoscaling were deferred as fast-follows, and load testing with a scaled-up hello-world service plus incremental traffic rollout kept the migration low-risk.

The quest for software engineering knowledge.

Look:
Layout: