Package org.cdk8s.plus25.k8s
Class Affinity.Builder
- java.lang.Object
-
- org.cdk8s.plus25.k8s.Affinity.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Affinitybuild()Builds the configured instance.Affinity.BuildernodeAffinity(NodeAffinity nodeAffinity)Sets the value ofAffinity.getNodeAffinity()Affinity.BuilderpodAffinity(PodAffinity podAffinity)Sets the value ofAffinity.getPodAffinity()Affinity.BuilderpodAntiAffinity(PodAntiAffinity podAntiAffinity)Sets the value ofAffinity.getPodAntiAffinity()
-
-
-
Method Detail
-
nodeAffinity
@Stability(Stable) public Affinity.Builder nodeAffinity(NodeAffinity nodeAffinity)
Sets the value ofAffinity.getNodeAffinity()- Parameters:
nodeAffinity- Describes node affinity scheduling rules for the pod.- Returns:
this
-
podAffinity
@Stability(Stable) public Affinity.Builder podAffinity(PodAffinity podAffinity)
Sets the value ofAffinity.getPodAffinity()- Parameters:
podAffinity- Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).- Returns:
this
-
podAntiAffinity
@Stability(Stable) public Affinity.Builder podAntiAffinity(PodAntiAffinity podAntiAffinity)
Sets the value ofAffinity.getPodAntiAffinity()- Parameters:
podAntiAffinity- Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).- Returns:
this
-
build
@Stability(Stable) public Affinity build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<Affinity>- Returns:
- a new instance of
Affinity - Throws:
NullPointerException- if any required attribute was not provided
-
-