Topology key
A topology key is a Kubernetes node-label key whose values define the topology domains used to constrain or spread workload placement.
Google Anthos in Action
A topology key is a Kubernetes pod-affinity field that identifies the node-label domain, such as a hostname or zone, used for comparing placement.
- How it is used
- Defines the node-label domain for comparing placement under Pod affinity and anti-affinity rules.
- How deep it goes
- Explains the field through required hostname affinity and preferred zone anti-affinity, without detailing scheduler internals.
- Examples
- Uses a per-node software license and manifests with hostname and zone topology keys.
- What you can do after
- Operate/configure it to group matching Pods on one node or prefer separation across zones.
Kubernetes for Developers
A topology key is a node-label key whose values define the topology domains considered equivalent for spreading workloads.
- How it is used
- Defines equivalent topology domains for spreading workload Pods across nodes.
- How deep it goes
- Explains node-level placement, label verification, imbalance limits, and unsatisfied-constraint behavior.
- Examples
- Uses kubernetes.io/hostname in a three-replica timeserver Deployment and verifies placement with kubectl.
- What you can do after
- Configure node-level workload spreading and verify the required node labels before deployment.
Related concepts
- anti-affinityused by · Anti-affinity is a scheduling constraint that discourages or prevents selected workloads from sharing a node or topology domain with matching workloads.
- spread topologyconfigures · A spread topology is a scheduling constraint that distributes Pods across specified topology domains such as zones or nodes.
- affinitypart of · Node affinity is a Kubernetes scheduling constraint that requires or prefers placing a pod on nodes whose labels match specified expressions.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

