PodAffinityTermV1 Properties
Class Properties 6 members
Represents a term used to define pod affinity/anti-affinity requirements in Kubernetes. The PodAffinityTermV1 specifies conditions such as label selectors, namespace selectors, and topology keys that determine the placement of pods in relation to other pods in a cluster.
Gets or sets the label selector used to filter Kubernetes resources based on their labels. The label selector enables dynamic selection of a specific set of objects by matching labels or expressions that satisfy the requirements.
public LabelSelectorV1 LabelSelector { get; set; }Remarks
The label selector may include the following components: - MatchLabels: A dictionary of key-value pairs where the labels of the resources must match exactly. - MatchExpressions: A collection of label selector requirements that define more advanced filtering conditions.
A list of label keys that should match for the associated Kubernetes resource. This property specifies a set of labels that must be present and match among a group of resources when certain constraints, such as affinity or anti-affinity rules, are applied.
public List<string> MatchLabelKeys { get; }Remarks
This property is intended to work in conjunction with label selectors to filter resources based on their labels. It helps define stricter conditions for selecting resources during workload scheduling and resource management in Kubernetes clusters.
Represents a list of label keys that must NOT be matched by the target resources. This property is used as part of the label-based selection mechanism to exclude resources that have specific labels from being selected.
public List<string> MismatchLabelKeys { get; }Remarks
MismatchLabelKeys is commonly used in conjunction with MatchLabelKeys and selectors like LabelSelector or NamespaceSelector to define precise inclusion and exclusion rules for Kubernetes resource selection. If a resource contains any of the labels specified in MismatchLabelKeys, it will not match the selector criteria.
The Namespaces property represents a list of strings that define the specific namespaces within which the label selector or namespace selector should apply. This property is particularly useful when specifying criteria for selecting pods or other Kubernetes resources constrained to particular namespaces.
public List<string> Namespaces { get; }Remarks
If the Namespaces property is null or empty, the selector will apply across all namespaces. This property enables fine-grained control over resource selection within the Kubernetes environment.
Gets or sets the namespace selector used to identify namespaces to which the label selector applies. This property specifies a label-based filter that restricts the namespaces considered by the associated label selector.
public LabelSelectorV1 NamespaceSelector { get; set; }Remarks
The namespace selector is utilized to dynamically select namespaces based on their labels, allowing for more flexible and dynamic configurations. It operates in conjunction with label selectors to refine Kubernetes resource targeting.
Specifies the key for the node's topology on which matching should occur. The value of this property is used to categorize nodes in a cluster based on specific characteristics, such as region or zone. This is commonly used in Kubernetes for pod affinity and anti-affinity rules to determine how pods are scheduled across nodes.
public string TopologyKey { get; set; }Remarks
The expected value must correspond to a label on the node that denotes the desired topology classification. It enables controlled distribution of pods across the nodes based on their topology attributes, ensuring improved resource utilization and failure isolation.