TECHNOLOGY

Preserve distributed-worker identity with StatefulSet ordinals

In this article
THE QUICK TAKE

Map ordinal, application rank and Pod incarnation separately; stable identity does not preserve live execution state.

A distributed serving worker is replaced and receives a new Pod UID, yet its StatefulSet name and ordinal remain familiar. This stable identity can support shard assignment, but it does not automatically restore in-memory state or establish the model framework’s rank. Define the mapping explicitly.

Read the ordinal range

StatefulSet assigns a unique ordinal within the configured set. Current Kubernetes also supports a configured start ordinal, so code should not assume the range always begins at zero. Inspect the effective specification and supported version. A replica count alone does not identify every valid worker index when a nondefault start is used.

Bind a worker role deliberately

Use the controller’s supported identity labels or stable Pod naming to derive the application mapping. Distinguish the ordinal from a framework rank, shard identifier or GPU-local index. A tensor-parallel group may require its own membership protocol. Matching numbers in two systems are not proof that they refer to the same communication role.

Separate stable name from incarnation

A replacement can reuse the stable name while being a different Pod object with a new UID. Correlate incidents and external leases with the incarnation where needed. Otherwise a late completion or stale registration from the previous process can be mistaken for the current worker. Stable network identity is useful precisely because process identity can change underneath it.

Keep storage and memory distinct

Volume-claim templates can preserve storage associated with an ordinal under the configured lifecycle. They do not preserve a live CUDA context or arbitrary host memory after replacement. Validate the checkpoint or cache revision on disk before using it. An old shard path with the expected worker name may contain an incompatible artifact.

Test replacement of one role

In an isolated fixture, assign distinguishable synthetic shard roles, replace one worker and verify its name, UID, storage association and application rank separately. Confirm peer rediscovery with the actual resolver. Acceptance means a stable, documented mapping that recognizes replacement. It does not guarantee distributed engine recovery or safe simultaneous ownership if an external system ignores incarnation and fencing requirements.

Primary references

Kubernetes StatefulSets.

DNS for Services and Pods.

Labels and Selectors.

Related reading: GPUs in Kubernetes: scheduling CPU, RAM and accelerators together; NUMA in GPU servers: why resource placement matters.

Earn rental income from GPUs

Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.

Explore GPU hosting
← All articles