Core Concepts of Workload Map
This page explains the concepts that you need to understand before you use Workload Map. For the full definition syntax, refer to the Workload Definition Spec.
Workload Definition and Components
A workload definition describes the structure of one workload type. It is stored as a Karta resource in a cluster or as a built-in catalog entry. A definition describes a workload as a hierarchy of components.
A definition can also list the kinds of other objects that the workload creates but that are not components. This list is used for permission management.
Instances and Replicas
A component can contain more than one entry, such as the roles of a distributed workload. Workload Map uses two concepts to tell them apart.
Pod attribution ties a live pod to the component, instance, and replica that it belongs to. A definition can declare pod selectors for this purpose. A component type selector matches a label or annotation key on the pod. An instance selector reads the instance identifier from the pod. Paths in pod selectors refer to the manifest of the pod, not to the workload object.
Status
Each workload type reports its status in its own way. A definition maps those native conditions or phases to a common set of statuses.
A definition can match a status by conditions, by phase, or by a jq expression. If a mapping provides both a phase and conditions, both must match. Status mappings are not mutually exclusive, so a workload can match more than one status at the same time, such as Running and Degraded. If nothing matches, the status is Undefined.
Workload Tree
The workload tree is the hierarchy of a workload as Workload Map reads it. It holds the components, their instances, and the normalized status. The library builds the tree from a definition and a workload object.
You can also build a tree from a manifest that you have not yet submitted. In that case the structure and the desired scale are present, but the live status and pods are not.
Optimization Instructions
Optimization instructions tell a consumer, such as a scheduler, how to treat the pods of a workload. The supported instruction is gang scheduling, which describes how to group the pods of a distributed workload so that they are placed together.
The gangScheduling.podGroup field defines a pod group with subgroups for components.
Paths in optimization instructions refer to the manifest of the pod, not to the workload object.