Class V1NodeAffinity
java.lang.Object
io.kubernetes.client.openapi.models.V1NodeAffinity
@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen",
date="2025-05-20T20:47:13.890592Z[Etc/UTC]",
comments="Generator version: 7.13.0")
public class V1NodeAffinity
extends Object
Node affinity is a group of node affinity scheduling rules.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPreferredDuringSchedulingIgnoredDuringExecutionItem
(V1PreferredSchedulingTerm preferredDuringSchedulingIgnoredDuringExecutionItem) boolean
static V1NodeAffinity
Create an instance of V1NodeAffinity given an JSON stringThe scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions.Get requiredDuringSchedulingIgnoredDuringExecutionint
hashCode()
preferredDuringSchedulingIgnoredDuringExecution
(List<V1PreferredSchedulingTerm> preferredDuringSchedulingIgnoredDuringExecution) requiredDuringSchedulingIgnoredDuringExecution
(V1NodeSelector requiredDuringSchedulingIgnoredDuringExecution) void
setPreferredDuringSchedulingIgnoredDuringExecution
(List<V1PreferredSchedulingTerm> preferredDuringSchedulingIgnoredDuringExecution) void
setRequiredDuringSchedulingIgnoredDuringExecution
(V1NodeSelector requiredDuringSchedulingIgnoredDuringExecution) toJson()
Convert an instance of V1NodeAffinity to an JSON stringtoString()
static void
validateJsonElement
(com.google.gson.JsonElement jsonElement) Validates the JSON Element and throws an exception if issues found
-
Field Details
-
SERIALIZED_NAME_PREFERRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION
- See Also:
-
SERIALIZED_NAME_REQUIRED_DURING_SCHEDULING_IGNORED_DURING_EXECUTION
- See Also:
-
openapiFields
-
openapiRequiredFields
-
-
Constructor Details
-
V1NodeAffinity
public V1NodeAffinity()
-
-
Method Details
-
preferredDuringSchedulingIgnoredDuringExecution
public V1NodeAffinity preferredDuringSchedulingIgnoredDuringExecution(@Nullable List<V1PreferredSchedulingTerm> preferredDuringSchedulingIgnoredDuringExecution) -
addPreferredDuringSchedulingIgnoredDuringExecutionItem
public V1NodeAffinity addPreferredDuringSchedulingIgnoredDuringExecutionItem(V1PreferredSchedulingTerm preferredDuringSchedulingIgnoredDuringExecutionItem) -
getPreferredDuringSchedulingIgnoredDuringExecution
@Nullable public List<V1PreferredSchedulingTerm> getPreferredDuringSchedulingIgnoredDuringExecution()The scheduler will prefer to schedule pods to nodes that satisfy the affinity expressions specified by this field, but it may choose a node that violates one or more of the expressions. The node that is most preferred is the one with the greatest sum of weights, i.e. for each node that meets all of the scheduling requirements (resource request, requiredDuringScheduling affinity expressions, etc.), compute a sum by iterating through the elements of this field and adding \"weight\" to the sum if the node matches the corresponding matchExpressions; the node(s) with the highest sum are the most preferred.- Returns:
- preferredDuringSchedulingIgnoredDuringExecution
-
setPreferredDuringSchedulingIgnoredDuringExecution
public void setPreferredDuringSchedulingIgnoredDuringExecution(@Nullable List<V1PreferredSchedulingTerm> preferredDuringSchedulingIgnoredDuringExecution) -
requiredDuringSchedulingIgnoredDuringExecution
public V1NodeAffinity requiredDuringSchedulingIgnoredDuringExecution(@Nullable V1NodeSelector requiredDuringSchedulingIgnoredDuringExecution) -
getRequiredDuringSchedulingIgnoredDuringExecution
Get requiredDuringSchedulingIgnoredDuringExecution- Returns:
- requiredDuringSchedulingIgnoredDuringExecution
-
setRequiredDuringSchedulingIgnoredDuringExecution
public void setRequiredDuringSchedulingIgnoredDuringExecution(@Nullable V1NodeSelector requiredDuringSchedulingIgnoredDuringExecution) -
equals
-
hashCode
public int hashCode() -
toString
-
validateJsonElement
Validates the JSON Element and throws an exception if issues found- Parameters:
jsonElement
- JSON Element- Throws:
IOException
- if the JSON Element is invalid with respect to V1NodeAffinity
-
fromJson
Create an instance of V1NodeAffinity given an JSON string- Parameters:
jsonString
- JSON string- Returns:
- An instance of V1NodeAffinity
- Throws:
IOException
- if the JSON string is invalid with respect to V1NodeAffinity
-
toJson
Convert an instance of V1NodeAffinity to an JSON string- Returns:
- JSON string
-