PodAntiAffinityV1
Class sealed net10.0
Represents the pod anti-affinity rules used in Kubernetes scheduling policies.
namespace Aspire.Hosting.Kubernetes.Resources;
public sealed class PodAntiAffinityV1{ // ...}Remarks
Section titled Remarks PodAntiAffinityV1 defines constraints for scheduling pods on nodes based on anti-affinity rules. Anti-affinity is used to avoid placing certain pods close to each other or restrict them from being scheduled on the same nodes within the cluster. This can enhance fault tolerance, resource allocation, or other layout requirements.
Constructors1
Section titled ConstructorsProperties2
Section titled PropertiesPreferredDuringSchedulingIgnoredDuringExecutionget A list of weighted pod affinity terms that are considered during scheduling. This property allows specifying optional pod anti-affinity preferences for scheduling decisions, while permitting the system to schedule pods in scenarios where the preferences cannot be met. Each term is associated with a weight that indicates its relative importance.
RequiredDuringSchedulingIgnoredDuringExecutionget Represents a list of PodAffinityTermV1 objects used to define required pod anti-affinity constraints that must be met during pod scheduling but are ignored during execution. This property ensures that certain pod placement rules are enforced when scheduling occurs; however, these rules can be relaxed if the constraints are violated at runtime, such as when a node becomes unavailable or pods are rescheduled for fault recovery.