Package org.cdk8s.plus25.k8s
Class PodAffinityTerm.Builder
- java.lang.Object
-
- org.cdk8s.plus25.k8s.PodAffinityTerm.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<PodAffinityTerm>
- Enclosing interface:
- PodAffinityTerm
@Stability(Stable) public static final class PodAffinityTerm.Builder extends Object implements software.amazon.jsii.Builder<PodAffinityTerm>
A builder forPodAffinityTerm
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PodAffinityTermbuild()Builds the configured instance.PodAffinityTerm.BuilderlabelSelector(LabelSelector labelSelector)Sets the value ofPodAffinityTerm.getLabelSelector()PodAffinityTerm.Buildernamespaces(List<String> namespaces)Sets the value ofPodAffinityTerm.getNamespaces()PodAffinityTerm.BuildernamespaceSelector(LabelSelector namespaceSelector)Sets the value ofPodAffinityTerm.getNamespaceSelector()PodAffinityTerm.BuildertopologyKey(String topologyKey)Sets the value ofPodAffinityTerm.getTopologyKey()
-
-
-
Method Detail
-
topologyKey
@Stability(Stable) public PodAffinityTerm.Builder topologyKey(String topologyKey)
Sets the value ofPodAffinityTerm.getTopologyKey()- Parameters:
topologyKey- This pod should be co-located (affinity) or not co-located (anti-affinity) with the pods matching the labelSelector in the specified namespaces, where co-located is defined as running on a node whose value of the label with key topologyKey matches that of any node on which any of the selected pods is running. This parameter is required. Empty topologyKey is not allowed.- Returns:
this
-
labelSelector
@Stability(Stable) public PodAffinityTerm.Builder labelSelector(LabelSelector labelSelector)
Sets the value ofPodAffinityTerm.getLabelSelector()- Parameters:
labelSelector- A label query over a set of resources, in this case pods.- Returns:
this
-
namespaces
@Stability(Stable) public PodAffinityTerm.Builder namespaces(List<String> namespaces)
Sets the value ofPodAffinityTerm.getNamespaces()- Parameters:
namespaces- namespaces specifies a static list of namespace names that the term applies to. The term is applied to the union of the namespaces listed in this field and the ones selected by namespaceSelector. null or empty namespaces list and null namespaceSelector means "this pod's namespace".- Returns:
this
-
namespaceSelector
@Stability(Stable) public PodAffinityTerm.Builder namespaceSelector(LabelSelector namespaceSelector)
Sets the value ofPodAffinityTerm.getNamespaceSelector()- Parameters:
namespaceSelector- A label query over the set of namespaces that the term applies to. The term is applied to the union of the namespaces selected by this field and the ones listed in the namespaces field. null selector and null or empty namespaces list means "this pod's namespace". An empty selector ({}) matches all namespaces.- Returns:
this
-
build
@Stability(Stable) public PodAffinityTerm build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<PodAffinityTerm>- Returns:
- a new instance of
PodAffinityTerm - Throws:
NullPointerException- if any required attribute was not provided
-
-