kubernetes.client.models.v1_pod_affinity_term module

Kubernetes

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

The version of the OpenAPI document: release-1.36 Generated by OpenAPI Generator (https://openapi-generator.tech)

Do not edit the class manually.

class kubernetes.client.models.v1_pod_affinity_term.V1PodAffinityTerm(*, label_selector: V1LabelSelector | None = None, match_label_keys: List[Annotated[str, Strict(strict=True)]] | None = None, mismatch_label_keys: List[Annotated[str, Strict(strict=True)]] | None = None, namespace_selector: V1LabelSelector | None = None, namespaces: List[Annotated[str, Strict(strict=True)]] | None = None, topology_key: Annotated[str, Strict(strict=True)])

Bases: BaseModel

Defines a set of pods (namely those matching the labelSelector relative to the given namespace(s)) that this pod should be co-located (affinity) or not co-located (anti-affinity) with, 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 a pod of the set of pods is running

Attributes:
openapi_types (dict): The key is attribute name

and the value is attribute type.

attribute_map (dict): The key is attribute name

and the value is json key in definition.

attribute_map: ClassVar[Dict[str, str]] = {'label_selector': 'labelSelector', 'match_label_keys': 'matchLabelKeys', 'mismatch_label_keys': 'mismatchLabelKeys', 'namespace_selector': 'namespaceSelector', 'namespaces': 'namespaces', 'topology_key': 'topologyKey'}
classmethod from_dict(obj: Dict[str, Any] | None) Self | None

Create an instance of V1PodAffinityTerm from a dict

classmethod from_json(json_str: str) Self | None

Create an instance of V1PodAffinityTerm from a JSON string

label_selector: V1LabelSelector | None
match_label_keys: List[StrictStr] | None
mismatch_label_keys: List[StrictStr] | None
model_config = {'extra': 'forbid', 'protected_namespaces': (), 'validate_assignment': True, 'validate_by_alias': True, 'validate_by_name': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

namespace_selector: V1LabelSelector | None
namespaces: List[StrictStr] | None
openapi_types: ClassVar[Dict[str, str]] = {'label_selector': 'V1LabelSelector', 'match_label_keys': 'List[str]', 'mismatch_label_keys': 'List[str]', 'namespace_selector': 'V1LabelSelector', 'namespaces': 'List[str]', 'topology_key': 'str'}
to_dict(serialize: bool = False) Dict[str, Any]

Return all declared model fields using public or wire names.

to_json() str

Returns the JSON representation of the model using alias

to_str() str

Returns the string representation of the model

topology_key: StrictStr