PodAffinityV1
Class sealed net10.0
Represents pod affinity rules for Kubernetes pod scheduling. This class defines the pod affinity and anti-affinity constraints that influence the placement of pods during scheduling.
namespace Aspire.Hosting.Kubernetes.Resources;
public sealed class PodAffinityV1{ // ...}Remarks
Section titled Remarks Pod affinity is used to dictate that certain pods should be scheduled either in the same topology (e.g., node or zone) as other specified pods or avoid the same topology. It supports both soft preferences and hard requirements for pod placement.
Constructors1
Section titled ConstructorsProperties2
Section titled PropertiesPreferredDuringSchedulingIgnoredDuringExecutionget Represents an optional list of weighted pod affinity terms that are considered during the scheduling phase of a pod's lifecycle, but ignored during the execution phase.
RequiredDuringSchedulingIgnoredDuringExecutionget Represents a collection of hard affinity rules used during pod scheduling in Kubernetes. The `RequiredDuringSchedulingIgnoredDuringExecution` property contains a list of `PodAffinityTermV1` objects, each defining strict constraints that must be met for pod placement during scheduling. These constraints are mandatory for scheduling but are not enforced once the pod is running. This allows for ensuring initial placement conditions while tolerating changes in the cluster environment after the pod is already scheduled.