liveBook · Manning

Max skew

As explained in Kubernetes for Developers

Max skew is a topology-spread setting that limits the permitted difference in Pod counts between topology domains.

Max skew limits how unevenly Kubernetes spreads a workload’s Pods across topology domains. A value of 1 permits at most one more Pod in any domain than in the others. section 8.2.1

Use max skew together with the other topology-spread settings:

  • Set topologyKey to define the domains being compared; kubernetes.io/hostname targets individual nodes. section 8.2.1
  • Set whenUnsatisfiable to DoNotSchedule for strict placement or ScheduleAnyway for a softer production preference. section 8.2.1
  • Match labelSelector with the Deployment’s Pod labels so Kubernetes spreads the intended workload. section 8.2.1
  • Verify that nodes actually carry the selected topology label before deploying. section 8.2.1

Three replicas across three nodes

A Deployment with replicas: 3, topologyKey: kubernetes.io/hostname, and maxSkew: 1 asks Kubernetes to keep replica counts nearly even across nodes. kubectl get pods -o wide lets you inspect the resulting placement.

How Kubernetes for Developers covers it

How deep it goes
Defines the smallest imbalance value and explains scheduling consequences, but stops short of scheduler internals.
Examples
Uses a three-replica Deployment, three-node Minikube cluster, YAML configuration, and kubectl placement inspection.
What it assumes
Assumes familiarity with Deployments, Pods, node labels, and label selectors; reinforces label verification before deployment.
What you can do after
Operate/configure it by setting maxSkew, selecting topology domains, choosing failure behavior, and checking Pod placement.
How it connects
Connects max skew with topology spread constraints, topology keys, label selectors, Deployments, and scheduling policies.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes for Developers. The section links point to the parts of the book it draws on.