Share via


PodAffinityV1 Class

Definition

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.

[YamlDotNet.Serialization.YamlSerializable]
public sealed class PodAffinityV1
[<YamlDotNet.Serialization.YamlSerializable>]
type PodAffinityV1 = class
Public NotInheritable Class PodAffinityV1
Inheritance
PodAffinityV1
Attributes
YamlDotNet.Serialization.YamlSerializableAttribute

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.

Constructors

PodAffinityV1()

Properties

PreferredDuringSchedulingIgnoredDuringExecution

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.

RequiredDuringSchedulingIgnoredDuringExecution

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.

Applies to