How_LinkedIn_Runs_Compute__Self-managed_Kuberne...

Ronak Nathani
November 24, 2026
6

 How_LinkedIn_Runs_Compute__Self-managed_Kubernetes_on_500_000__bare-metal_servers.pdf

Ronak Nathani

November 24, 2026

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

67 slides
  1. QCON SAN FRANCISCO How LinkedIn Runs Compute Self-managed Kubernetes on

    500,000 bare-metal servers Ronak Nathani Principal Staff Software Engineer, LinkedIn
  2. values.yaml spec: replicas: 7 nodeProfile: general resources: cpu: 4 memory:

    8Gi updateStrategy: maxUnavailable: 15% The deployment config for a typical LinkedIn service. 2
  3. “ Kubernetes is a platform for building platforms. It's a

    better place to start; not the endgame. Kelsey Hightower This talk: what we built on it, and what we deliberately didn't add. 3
  4. THE FLEET Thousands of engineers, one very large fleet 500K+

    5M+ 3,000+ 110K+ bare-metal servers pods services deployments / week 4
  5. WHY BUILD OUR OWN Why we built a curated compute

    platform 01 02 03 Bare metal Cognitive load Leverage No cloud provider, no VMs: we build what a managed offering would give us. Running Kubernetes well isn't the app team's day job. Solve each hard problem once, centrally. 5
  6. ARCHITECTURE Three layers, from metal to apps Apps say what

    they need. The layers below decide where, when and how. Workload platforms Kubernetes cluster management Machine layer (IaaS) Deployment Orchestration onboard · roll out · history Compute Platform UI explore · troubleshoot Kubernetes-as-a-service platform teams Stateless LiDeployment Stateful LiStatefulSet Jobs Spark · ML · CI Clusters & pools 6,000-node clusters Lifecycle controllers cluster · pool · node Workload placement picks cluster + pool Inventory every machine Compute Broker pools · allocation Quota Ledger who gets what Host health auto-repair Maintenance Orchestrator fleet-wide work 6
  7. LAYER 1 OF 3 The machine layer has no Kubernetes

    in it The problem: 500,000 machines, something always failing, maintenance that never stops. Workload platforms Kubernetes cluster management Machine layer (IaaS) Deployment Orchestration onboard · roll out · history Compute Platform UI explore · troubleshoot Kubernetes-as-a-service platform teams Stateless LiDeployment Stateful LiStatefulSet Jobs Spark · ML · CI Clusters & pools 6,000-node clusters Lifecycle controllers cluster · pool · node Workload placement picks cluster + pool Inventory every machine Compute Broker pools · allocation Quota Ledger who gets what Host health auto-repair Maintenance Orchestrator fleet-wide work 7
  8. LAYER 1 · MACHINE LAYER What runs the machine layer

    Inventory Manager Every machine's hardware: CPU, memory, GPU, disk, NIC, rack. 8
  9. LAYER 1 · MACHINE LAYER What runs the machine layer

    Inventory Manager Every machine's hardware: CPU, memory, GPU, disk, NIC, rack. Compute Broker Pools of machines and who holds each one. Autoscaling groups, for bare metal. 9
  10. LAYER 1 · MACHINE LAYER What runs the machine layer

    Inventory Manager Every machine's hardware: CPU, memory, GPU, disk, NIC, rack. Compute Broker Pools of machines and who holds each one. Autoscaling groups, for bare metal. Quota Ledger Who gets how much compute: allocated vs. used, per org. 10
  11. LAYER 1 · MACHINE LAYER What runs the machine layer

    Inventory Manager Every machine's hardware: CPU, memory, GPU, disk, NIC, rack. Compute Broker Pools of machines and who holds each one. Autoscaling groups, for bare metal. Quota Ledger Who gets how much compute: allocated vs. used, per org. Host health Finds failing machines and repairs them, with no human in the loop. 11
  12. LAYER 1 · MACHINE LAYER What runs the machine layer

    Inventory Manager Every machine's hardware: CPU, memory, GPU, disk, NIC, rack. Compute Broker Pools of machines and who holds each one. Autoscaling groups, for bare metal. Quota Ledger Who gets how much compute: allocated vs. used, per org. Host health Finds failing machines and repairs them, with no human in the loop. Maintenance Orchestrator Plans fleet-wide work: OS, kubelet, firmware, switch upgrades. 12
  13. MAINTENANCE ZONES Software rolls out one maintenance zone at a

    time 20 zones per data center. Pools stripe across all of them. pool-A pool-B pool-C ~5% of a data center's capacity per rollout step Apps spread across zones without asking. one data center · 20 maintenance zones 13
  14. LAYER 2 OF 3 Kubernetes cluster management The problem: turn

    spare machines into nodes of a few large clusters, and back. Workload platforms Kubernetes cluster management Machine layer (IaaS) Deployment Orchestration onboard · roll out · history Compute Platform UI explore · troubleshoot Kubernetes-as-a-service platform teams Stateless LiDeployment Stateful LiStatefulSet Jobs Spark · ML · CI Clusters & pools 6,000-node clusters Lifecycle controllers cluster · pool · node Workload placement picks cluster + pool Inventory every machine Compute Broker pools · allocation Quota Ledger who gets what Host health auto-repair Maintenance Orchestrator fleet-wide work 14
  15. LAYER 2 Few, large clusters: about 6,000 nodes each MANY

    SMALL CLUSTERS ONE LARGE CLUSTER Free capacity is stranded in every cluster. Free capacity in one place; stateless, stateful and batch share it. Trade-off: an app's availability is tied to its one cluster. More on that at the end. 15
  16. LAYER 2 · CONTROL PLANE Control planes run outside the

    clusters they serve etcd state store API server front door Scheduler + controllers Add-ons kept minimal reconcile Stable hosts In order HA outside Kubernetes, never rescheduled each component up and healthy before the next multiple replicas of every component 16
  17. LAYER 2 · CONTROL PLANE etcd is the first thing

    to need attention etcd state store API server front door Scheduler + controllers reconcile Add-ons kept minimal 32 GiB 1 etcd Own backup backend quota on fast SSD. Upstream guidance: 8 GiB. events stay in the primary; a second cluster wasn't worth it and restore, for disaster recovery 17
  18. LAYER 2 · CONTROL PLANE API server: every client gets

    a fair share etcd state store API server front door Scheduler + controllers reconcile Add-ons kept minimal APF RBAC review Kubelet API API Priority and Fairness: no client starves the rest for every operator a team brings in DaemonSets query their node's kubelet; we govern who runs them 18
  19. LAYER 2 · CONTROL PLANE Controllers are memory-bound by their

    caches etcd state store API server front door Scheduler + controllers reconcile Add-ons kept minimal Big caches Alert early Lean caches most controllers watch and cache pods before a component nears its memory limit tune watch cache, managedFields and unwatched fields stripped 19
  20. LAYER 2 · CONTROL PLANE Add-ons: few, and only ones

    we understand etcd state store API server front door Scheduler + controllers reconcile Add-ons kept minimal Read the source Test at scale Build in-house and study how it fails before we adopt it does its scaling model hold at 6,000 nodes? when off-the-shelf doesn't meet the bar 20
  21. A MACHINE'S LIFE · 1 OF 2 Pools grow and

    shrink through the spare pool Spare pool ready or reimaging join a nodepool scale up Kubernetes clusters every machine here is a node in some nodepool pool-A pool-B pool-C return to spare scale down Maintenance actor repair · reimage · upgrade borrowed, then returned a disruption 21
  22. LAYER 2 · POOLS Every pool declares a node profile

    Node profile: general Pool · any machine that meets it minimum for every machine CPU + memory SKU A SKU B SKU C older gen current gen more memory meets min meets min meets min Disk + NIC OS + kernel config Mixed hardware, interchangeable machines. 22
  23. LAYER 2 Pools and nodes are custom resources on a

    hub cluster Hub cluster · KCM controllers kind: KubernetesPool spec: computeBrokerPoolTemplate: capacity: 1200 nodeProfileName: gpu unschedulableBudget: 10% nodeLabels: {...} requiredDaemonSets: [...] ComputeBrokerPool capacity · node profile sync Compute Broker gRPC · layer 1 machine picked KubernetesNode one per machine: cluster · labels · taints · kubelet Workload clusters the machine joins as a node Change one integer: spare machines join in about a minute. 23
  24. A MACHINE'S LIFE · 2 OF 2 A disruption borrows

    a machine, then hands it back One protocol for planned and unplanned maintenance. Spare pool ready or reimaging join a nodepool scale up Kubernetes clusters every machine here is a node in some nodepool pool-A pool-B pool-C return to spare scale down Maintenance actor repair · reimage · upgrade borrowed, then returned a disruption 24
  25. DISRUPTION · STEP 1 OF 6 A maintenance actor schedules

    a disruption Maintenance actor planned or unplanned 1 Compute Broker owns machines KCM hub controllers Workload handlers stateless · stateful Node in a workload cluster schedule disruption import disruption pool budget OK? can we cordon? every handler: yes cordon drain what it owns each handler: done all → APPROVED actor now owns it reimage · repair COMPLETED back into rotation 25
  26. DISRUPTION · STEP 2 OF 6 KCM picks it up

    and coordinates Maintenance actor planned or unplanned Compute Broker owns machines KCM hub controllers Workload handlers stateless · stateful Node in a workload cluster schedule disruption 2 import disruption pool budget OK? can we cordon? every handler: yes cordon drain what it owns each handler: done all → APPROVED actor now owns it reimage · repair COMPLETED back into rotation 26
  27. DISRUPTION · STEP 3 OF 6 KCM first checks the

    pool can afford it Maintenance actor planned or unplanned Compute Broker owns machines KCM hub controllers Workload handlers stateless · stateful Node in a workload cluster schedule disruption import disruption Pool budget full? The disruption waits. pool budget OK? can we cordon? every handler: yes cordon drain what it owns each handler: done all → APPROVED actor now owns it reimage · repair COMPLETED back into rotation 27
  28. DISRUPTION · STEP 4 OF 6 Handlers agree, KCM cordons,

    each handler drains its own Maintenance actor planned or unplanned Compute Broker owns machines KCM hub controllers Workload handlers stateless · stateful Node in a workload cluster schedule disruption import disruption pool budget OK? 4 Stateless: eviction API  PDBs Stateful: the data system's ACM approves 4 4 can we cordon? every handler: yes cordon each handler: done 4 drain what it owns all → APPROVED actor now owns it reimage · repair COMPLETED back into rotation 28
  29. DISRUPTION · STEP 5 OF 6 Every handler is done,

    so maintenance gets the machine Maintenance actor planned or unplanned Compute Broker owns machines KCM hub controllers Workload handlers stateless · stateful Node in a workload cluster schedule disruption import disruption pool budget OK? can we cordon? every handler: yes cordon drain what it owns 5 actor now owns it 5 all → APPROVED 5 each handler: done One approved disruption per machine. reimage · repair COMPLETED back into rotation 29
  30. DISRUPTION · STEP 6 OF 6 Maintenance hands the machine

    back Maintenance actor planned or unplanned Compute Broker owns machines KCM hub controllers Workload handlers stateless · stateful Node in a workload cluster schedule disruption import disruption pool budget OK? can we cordon? every handler: yes cordon drain what it owns each handler: done all → APPROVED actor now owns it reimage · repair 6 COMPLETED 6 back into rotation 30
  31. UPGRADES Upgrades happen in place, riding the maintenance train N-2

    upstream Kubernetes, upgraded in place done upgrading next kubelet + containerd, one maintenance zone at a time USES THE DISRUPTION PROTOCOL Maint. Orchestrator Compute Broker KCM Handlers drain 31
  32. UPGRADES How fast we can update the whole fleet 30

    days 7 days Zero to update the whole fleet in normal operations when we need it faster coordination with workload teams 32
  33. LAYER 3 OF 3 Workload platforms: what developers get The

    problem: thousands of engineers who shouldn't have to learn Kubernetes. Workload platforms Kubernetes cluster management Machine layer (IaaS) Deployment Orchestration onboard · roll out · history Compute Platform UI explore · troubleshoot Kubernetes-as-a-service platform teams Stateless LiDeployment Stateful LiStatefulSet Jobs Spark · ML · CI Clusters & pools 6,000-node clusters Lifecycle controllers cluster · pool · node Workload placement picks cluster + pool Inventory every machine Compute Broker pools · allocation Quota Ledger who gets what Host health auto-repair Maintenance Orchestrator fleet-wide work 33
  34. LAYER 3 · WORKLOAD PLATFORMS Four ways to run on

    Kubernetes Stateless Stateful Jobs Kubernetes as a service LiDeployment LiStatefulSet Spark · ML · CI wider API access app teams app teams data + ML teams platform teams 34
  35. FOUR OFFERINGS 80% of compute runs on two platform APIs

    Measured by CPU allocation. 5% Jobs 80% 15% Stateless + stateful services LiDeployment K8s-as-a-service LiStatefulSet The only APIs app teams can write. 35
  36. FLEETSCALE INTEGRATIONS Cluster-scoped features, replaced by fleet-wide ones TYPICAL KUBERNETES

    LINKEDIN Service discovery Services + DNS Global xDS discovery Config & secrets ConfigMap / Secret Regional services Identity cert-manager cert-manager + our PKI Network policy NetworkPolicy Global policy, host agent Observability Prometheus Centralized metrics, logs, traces 36
  37. DEVELOPER API Stateless apps spec: replicas: 7 nodeProfile: general resources:

    cpu: 4 memory: 8Gi updateStrategy: maxUnavailable: 15% kind: LiDeployment spec: application: feed replicas: 7 updateStrategy: maxUnavailable: 15% status: conditions: - type: Ready kind: Pod spec: initContainers: - name: infra-init containers: - name: feed image: feed:3.1.126 volumeMounts: … volumes: … values.yaml · you write LiDeployment · Helm renders Pod · controllers expand 95% have no custom Dockerfile 37
  38. DEVELOPER API Workloads ask for a node profile, not a

    SKU Pool · node profile: general # values.yaml nodeProfile: general what the app asks for SKU A SKU B SKU C older gen current gen more memory meets min meets min meets min Heterogeneous, but interchangeable. 38
  39. DEPLOYMENTS First deploy only: the hub onboards the app Global

    authorization app ownership rules Selected cluster Deployment Orchestration one action Hub controller namespace · role bindings · pick cluster Namespace app + tenant labels RoleBinding application owners Developers never pick a cluster. Stateless apps can be relocated later. 39
  40. DEPLOYMENTS Every deploy, end to end Target workload cluster PKI

    · discovery · config · authz · observability Deployment Orchestration one action Rollout pod render · apply · watch Helm repository API server LinkedIn controllers expand + wire up Quota Ledger layer 1 Pods running Over quota? The deploy fails at once, with a clear reason. BLOG How we scale deployments with a custom GitOps engine 40
  41. DEPLOYMENTS The deploy infrastructure rarely gets in the way 99.9%

    of stateless deployment attempts reach a final state without an infrastructure-caused failure. App-health failures excluded: this measures our infrastructure, not the app. 41
  42. STATEFUL A StatefulSet can't see shards Kafka, Pinot, Ambry, Venice:

    sharded, replicated, data on local disk. pod-0 A pod-1 B B StatefulSet sees pod-2 C C 1 of 3 pods down. Fine. A Reality eviction requested already down healthy Shard B 0 replicas. It manages pod lifecycle, not the data system's safety rules. 42
  43. STATEFUL One operator for all. Each system brings its own

    ACM. create pod safe? ACM LiStatefulSet one generic operator per-system policy delete pod drain pod approve swap pod Kafka Pinot Ambry Venice Same handshake as disruption step 4 43
  44. OPERATING EXPERIENCE Failures explained in plain language $ kubectl in

    status lideployment go-weezy-pong Replica Status Rollout Status Reason Rollout Status Message InitContainers Status App Container Status Healthy replicas: 0/2 AppFailedToStart Deployment failed because the application failed to start. 2 pods unhealthy: CrashLoopBackOff, exit code 1 FailureCategory: App See go/<compute-ui>/errors/appfailedtostart AllReady 0/2 ready, CrashLoopBackOff TALK Making Application Rollouts Observable, Actionable and Boring 44
  45. GUARDRAILS With enough users, anything the API allows will happen

    So the API itself enforces the safe path. Delete protection Scale-down caps user-facing resources, non-empty namespaces, CRDs in use no dropping more than a set percentage at once Rollout history Alerts by default every action on an app, by humans or autoscalers dashboards and alerts wired to the owning team 45
  46. EXPLORATION Browse the fleet without touching API servers Workload cluster

    × hundreds API server Watcher streams CR, pod, node fields Regional store MySQL · gRPC Browsing UI regional view kubectl plugin live, app-centric 46
  47. THE MIGRATION >95% moved off a decade-old platform, with no

    live-site downtime Driven centrally Automated for stateless Legacy needs challenged 47
  48. WHAT'S NEXT One app, many clusters Today an app lives

    in one cluster. That's the trade-off we're removing. cluster A cluster B cluster C Multi-cluster native grow past one cluster one workload One API stateless + stateful Beyond 6,000 nodes bigger single clusters 48
  49. CHALLENGE 1 OF 4 Moving along the spectrum means switching

    APIs STATELESS STATEFUL Web service Cache Search index Quorum database keeps nothing working set it can rebuild local data that's expensive to copy can't lose a replica until another catches up LiDeployment LiStatefulSet moving right means a migration 49
  50. CHALLENGE 2 OF 4 An app can only grow as

    big as one cluster cluster a FULL search-index can't grow here cluster b cluster c room to spare room to spare 50
  51. CHALLENGE 3 OF 4 Moving an app between clusters happens

    out of band cluster c cluster d out-of-band operation 51
  52. CHALLENGE 4 OF 4 Teams want to run more than

    two versions at once TODAY stable canary 85% 15% WHAT TEAMS WANT v1 50% v2 30% v3 20% 52
  53. THE WORKLOAD API A composable workload API Revision Workload WorkloadPlacement

    written by the app team written by the app team written by the cluster admin Pod spec Replicas Clusters PVC templates Revision distribution Replicas per cluster Update strategy 53
  54. THE WORKLOAD API · 1 OF 3 A Revision holds

    a complete pod spec Revision Workload kind: Revision metadata: {name: v2} spec: template: spec: containers: - name: store image: store:2.0 volumeClaimTemplates: - metadata: {name: data} spec: {storageClassName: local-host} WorkloadPlacement Revisions are immutable. A change is a new Revision. 54
  55. THE WORKLOAD API · 1 OF 3 It can also

    give every pod its own PVC Revision Workload kind: Revision metadata: {name: v2} spec: template: spec: containers: - name: store image: store:2.0 volumeClaimTemplates: - metadata: {name: data} spec: {storageClassName: local-host} WorkloadPlacement Persistence is a field, not a different API. 55
  56. THE WORKLOAD API · 2 OF 3 A Workload sets

    how many replicas to run Revision Workload kind: Workload metadata: {name: store} spec: replicas: 9 replicaDistribution: - {revision: v1, allocation: 75%} - {revision: v2, allocation: 25%} updateStrategy: rollingUpdate: maxSurge: 0 maxUnavailable: 1 podReplacementPolicy: TerminatingOrDeleted WorkloadPlacement The count is for the whole workload, not one cluster. 56
  57. THE WORKLOAD API · 2 OF 3 It splits those

    replicas across revisions Revision Workload kind: Workload metadata: {name: store} spec: replicas: 9 replicaDistribution: - {revision: v1, allocation: 75%} - {revision: v2, allocation: 25%} updateStrategy: rollingUpdate: maxSurge: 0 maxUnavailable: 1 podReplacementPolicy: TerminatingOrDeleted WorkloadPlacement Any number of revisions, each with its own share. 57
  58. THE WORKLOAD API · 2 OF 3 It also says

    how pods get updated Revision Workload WorkloadPlacement kind: Workload metadata: {name: store} spec: replicas: 9 replicaDistribution: - {revision: v1, allocation: 75%} - {revision: v2, allocation: 25%} updateStrategy: rollingUpdate: maxSurge: 0 maxUnavailable: 1 podReplacementPolicy: TerminatingOrDeleted 58
  59. THE WORKLOAD API · 2 OF 3 It also says

    how pods get updated Revision Workload WorkloadPlacement kind: Workload metadata: {name: store} spec: replicas: 9 replicaDistribution: - {revision: v1, allocation: 75%} - {revision: v2, allocation: 25%} updateStrategy: rollingUpdate: maxSurge: 0 maxUnavailable: 1 podReplacementPolicy: Deleted 59
  60. THE WORKLOAD API · 2 OF 3 It also says

    how pods get updated Revision kind: Workload metadata: {name: store} spec: replicas: 9 replicaDistribution: - {revision: v1, allocation: 75%} - {revision: v2, allocation: 25%} updateStrategy: coordinator: name: store-coordinator Workload WorkloadPlacement For stateful workloads 60
  61. THE WORKLOAD API · 3 OF 3 A WorkloadPlacement says

    which clusters run it Revision Workload kind: WorkloadPlacement metadata: name: store # same as the Workload spec: allocationStrategy: Explicit clusterPlacements: - {clusterName: a, allocation: 50%} - {clusterName: b, allocation: 30%} - {clusterName: c, allocation: 20%} WorkloadPlacement Cluster admins write this, not app teams. 61
  62. HOW IT WORKS A hub cluster stores intent and spoke

    clusters run pods Hub cluster · no application pods Revision · Workload · Placement what you wrote Payload Workload controller layout · budget · status Payload per cluster WorkloadShard + Revisions status Spoke a Spoke b Dispatcher Spoke c Dispatcher Dispatcher applies · reports applies · reports applies · reports WorkloadShard controller WorkloadShard controller WorkloadShard controller 62
  63. DISRUPTIONS Every spoke's evictions check one budget on the hub

    Hub cluster WorkloadDisruptionBudget disruptionsAllowed: 1 · across all clusters claim a slot Spoke a Spoke b node drain evicts a pod Eviction webhook allowed: took the slot node drain evicts a pod Eviction webhook denied: budget spent 65
  64. TAKEAWAYS What we'd tell you to do Design fleet and

    workload management together Workloads say what they need; the fleet handles placement, capacity and maintenance. No app-team coordination: we patch the whole fleet in 30 days. Adopt a problem, not a project Ask what real problem a technology solves for you. Sometimes building it yourself is the simpler path. Design for what users want Have empathy for your users: build the interface they need, and abstract the rest 66