Watch Aspire live streamsDocsTry Aspire
Watch Aspire live streamsDocsTry

TopologySpreadConstraintV1

Classsealednet10.0
📦 Aspire.Hosting.Kubernetes v13.6.0-preview.1.26478.8
Represents the topology spread constraints for distributing pods across a Kubernetes cluster. These constraints define policies for balancing pods across different node topologies such as zones or regions. The constraints aim to ensure high availability and resilience by spreading pods evenly based on the specified rules.
namespace Aspire.Hosting.Kubernetes.Resources;
public sealed class TopologySpreadConstraintV1
{
// ...
}
The following properties define the rules for the constraint: - `WhenUnsatisfiable`: Defines the behavior when the constraint is unsatisfiable. For example, it can be set to "DoNotSchedule" to prevent scheduling pods if the rule cannot be satisfied. - `LabelSelector`: Specifies the selector to identify the set of target pods for applying the constraint. - `MatchLabelKeys`: A list of label key names that must exist on nodes to be considered during the spread calculation. - `MinDomains`: Specifies the minimum number of topology domains that must satisfy the spread constraint. - `MaxSkew`: Defines the maximum skew, which is the difference in the number of pods across the topology domains. An uneven skew would trigger balancing of pods. - `NodeAffinityPolicy`: Determines the policy for using node affinity to influence pod placement. - `NodeTaintsPolicy`: Specifies the policy regarding node taints when scheduling the pods. - `TopologyKey`: Represents the key of a label that defines the topology domains for spreading, such as "zone" or "rack".
View all constructors
View all properties