Toleration#
- pydantic model controller.models.domain.kubernetes.Toleration#
Represents a single pod toleration rule.
Toleration rules describe what Kubernetes node taints a pod will tolerate, meaning that the pod can still be scheduled on that node even though the node is marked as tained.
- Parameters:
data (
Any)
Show JSON schema
{ "title": "Toleration", "description": "Represents a single pod toleration rule.\n\nToleration rules describe what Kubernetes node taints a pod will tolerate,\nmeaning that the pod can still be scheduled on that node even though the\nnode is marked as tained.", "type": "object", "properties": { "effect": { "anyOf": [ { "$ref": "#/$defs/TaintEffect" }, { "type": "null" } ], "default": null, "description": "Taint effect to match. If ``None``, match all taint effects.", "title": "Taint effect" }, "key": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Taint key to match. If ``None``, ``operator`` must be ``Exists``, and this combination is used to match all taints.", "title": "Taint key" }, "operator": { "$ref": "#/$defs/TolerationOperator", "default": "Equal", "description": "``Exists`` is equivalent to a wildcard for value and matches all possible taints of a given catgory.", "title": "Match operator" }, "tolerationSeconds": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "Defines the length of time a ``NoExecute`` taint is tolerated and is ignored for other taint effects. The pod will be evicted this number of seconds after the taint is added, rather than immediately (the default with no toleration). ``None`` says to tolerate the taint forever.", "title": "Duration of toleration" }, "value": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Taint value to match. Must be ``None`` if the operator is ``Exists``.", "title": "Taint value" } }, "$defs": { "TaintEffect": { "description": "Possible effects of a pod toleration.", "enum": [ "NoSchedule", "PreferNoSchedule", "NoExecute" ], "title": "TaintEffect", "type": "string" }, "TolerationOperator": { "description": "Possible operators for a toleration.", "enum": [ "Equal", "Exists" ], "title": "TolerationOperator", "type": "string" } }, "additionalProperties": false }
- Fields:
- Validators:
_validate»all fields
-
field effect: Annotated[TaintEffect | None, Field(title='Taint effect', description='Taint effect to match. If
None, match all taint effects.')] = None# Taint effect to match. If
None, match all taint effects.- Validated by:
_validate
-
field key: Annotated[str | None, Field(title='Taint key', description='Taint key to match. If
None,operatormust beExists, and this combination is used to match all taints.')] = None# Taint key to match. If
None,operatormust beExists, and this combination is used to match all taints.- Validated by:
_validate
-
field operator: Annotated[TolerationOperator, Field(title='Match operator', description='
Existsis equivalent to a wildcard for value and matches all possible taints of a given catgory.')] = TolerationOperator.EQUAL# Existsis equivalent to a wildcard for value and matches all possible taints of a given catgory.- Validated by:
_validate
-
field tolerationSeconds: Annotated[int | None, Field(title='Duration of toleration', description='Defines the length of time a
NoExecutetaint is tolerated and is ignored for other taint effects. The pod will be evicted this number of seconds after the taint is added, rather than immediately (the default with no toleration).Nonesays to tolerate the taint forever.')] = None (name 'toleration_seconds')# Defines the length of time a
NoExecutetaint is tolerated and is ignored for other taint effects. The pod will be evicted this number of seconds after the taint is added, rather than immediately (the default with no toleration).Nonesays to tolerate the taint forever.- Validated by:
_validate
-
field value: Annotated[str | None, Field(title='Taint value', description='Taint value to match. Must be
Noneif the operator isExists.')] = None# Taint value to match. Must be
Noneif the operator isExists.- Validated by:
_validate
- to_kubernetes()#
Convert to the corresponding Kubernetes resource.
- Return type:
V1Toleration