Labels, Annotations and Environment Variables

A reference for all labels, annotations, and environment variables in LWS.

Labels

KeyDescriptionExampleApplies to
leaderworkerset.sigs.k8s.io/nameThe name of the LeaderWorkerSet object to which these resources belong.leaderworkerset-multi-templatePod, StatefulSet, Service
leaderworkerset.sigs.k8s.io/template-revision-hashHash used to track the controller revision that matches a LeaderWorkerSet object.5c5fcdfb44Pod, StatefulSet
leaderworkerset.sigs.k8s.io/group-indexThe group to which it belongs.0Pod, StatefulSet (only worker)
leaderworkerset.sigs.k8s.io/group-keyUnique key identifying the group.689ce1b5…b07Pod, StatefulSet (only worker)
leaderworkerset.sigs.k8s.io/worker-indexThe index or identity of the pod within the group.0Pod
leaderworkerset.sigs.k8s.io/subgroup-indexTracks which subgroup the pod is part of.0Pod (only if SubGroup is set)
leaderworkerset.sigs.k8s.io/subgroup-keyPods that are part of the same subgroup will have the same unique hash value.92904e74…801Pod (only if SubGroup is set)
disaggregatedset.x-k8s.io/nameThe name of the DisaggregatedSet object to which these resources belong.disaggregatedset-sampleLeaderWorkerSet, Service, Pod
disaggregatedset.x-k8s.io/roleThe DisaggregatedSet role for the resource.prefillLeaderWorkerSet, Service, Pod
disaggregatedset.x-k8s.io/sliceSlice index for the resource within the DisaggregatedSet.0LeaderWorkerSet, Service, Pod
disaggregatedset.x-k8s.io/revisionRevision hash used to track a DisaggregatedSet rollout.a1b2c3d4LeaderWorkerSet, Service, Pod

Annotations

KeyDescriptionExampleApplies to
leaderworkerset.sigs.k8s.io/sizeThe total number of pods in each group.4Pod
leaderworkerset.sigs.k8s.io/replicasReplicas Number of leader-workers groups.3StatefulSet (only leader)
leaderworkerset.sigs.k8s.io/leader-nameThe name of the leader pod.leaderworkerset-multi-template-0Pod (only worker)
leaderworkerset.sigs.k8s.io/exclusive-topologySpecifies the topology for exclusive 1:1 scheduling.cloud.google.com/gke-nodepoolLeaderWorkerSet, Pod (only if exclusive-topology is used)
leaderworkerset.sigs.k8s.io/subdomainPolicyDetermines what type of domain will be injected.UniquePerReplicaPod (only if leader and subdomainPolicy set to UniquePerReplica)
leaderworkerset.sigs.k8s.io/subgroup-sizeThe number of pods per subgroup.2Pod (only if SubGroup is set)
leaderworkerset.sigs.k8s.io/subgroup-exclusive-topologySpecifies the topology for exclusive 1:1 scheduling within a subgroup.topologyKeyLeaderWorkerSet, Pod (only if SubGroup is set and subgroup-exclusive-topology is used)
leaderworkerset.sigs.k8s.io/leader-requests-tpusIndicates if the leader pod requests TPU.truePod (only if leader pod requests TPU)
leaderworkerset.sigs.k8s.io/group-restart-countsStores restart budget consumed by each revision and replica group.{"abc123/0":3}LeaderWorkerSet (only if maxGroupRestarts is set)
leaderworkerset.sigs.k8s.io/group-restart-budget-exhaustedMarks the retained leader after its group exhausts its restart budget.truePod (only leader)
leaderworkerset.sigs.k8s.io/recoverSet to true on a retained leader to explicitly recover its exhausted group.truePod (only an exhausted leader)
disaggregatedset.x-k8s.io/initial-replicasReplica baseline used by the controller when the DisaggregatedSet revision becomes old.2LeaderWorkerSet

Environment Variables

KeyDescriptionExampleApplies to
LWS_LEADER_ADDRESSThe address of the leader via the headless service.leaderworkerset-multi-template-0.leaderworkerset-multi-template.defaultPod
LWS_GROUP_SIZETracks the size of the LWS group.4Pod
LWS_WORKER_INDEXThe index or identity of the pod within the group.2Pod
DISAGGREGATEDSET_NAMEThe name of the parent DisaggregatedSet.disaggregatedset-samplePod (only if managed by a DisaggregatedSet)
DISAGGREGATEDSET_ROLEThe role of the pod within the DisaggregatedSet.prefillPod (only if managed by a DisaggregatedSet)
DISAGGREGATEDSET_SLICEThe slice index of the pod within the DisaggregatedSet.0Pod (only if managed by a DisaggregatedSet)
DISAGGREGATEDSET_REVISIONThe revision hash used to identify the DisaggregatedSet rollout.a1b2c3d4Pod (only if managed by a DisaggregatedSet)
TPU_WORKER_HOSTNAMESHostnames of TPU workers only in the same subgroup.test-sample-1-5.default,test-sample-1-6.default,test-sample-1-7.default,test-sample-1-8.defaultPod (only if TPU enabled)
TPU_WORKER_IDID of the TPU worker.0Pod (only if TPU enabled)
TPU_NAMEName of the TPU.test-sample-1Pod (only if TPU enabled)

Other labels and annotations can be exposed to a container with the Downward API.

Feedback

Was this page helpful?