Skip to content
Docs Try Aspire

AffinityV1

Class sealed net10.0
📦 Aspire.Hosting.Kubernetes v13.1.2-preview.1.26125.13
Represents the affinity configuration for a pod, including node affinity, pod affinity, and pod anti-affinity settings. This class defines rules to influence pod scheduling based on various criteria, such as node labels or inter-pod relationships.
namespace Aspire.Hosting.Kubernetes.Resources;
public sealed class AffinityV1
{
// ...
}
View all constructors
NodeAffinityget; set
Represents the node affinity property that defines node affinity scheduling rules. This property allows specifying preferred or required nodes for scheduling pods.
PodAffinityget; set
Represents inter-pod affinity scheduling rules to influence the placement of pods relative to other pods. This property defines constraints for scheduling pods to be either co-located or not co-located with specified pods, based on labels and topology.
PodAntiAffinityget; set
Represents the pod anti-affinity configuration for scheduling in Kubernetes. Pod anti-affinity allows specifying rules to avoid placing certain pods together on the same node or in a specific topology domain. This ensures Pods are scheduled in a manner that prevents tightly coupling their placement.
View all properties