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": {
         "allOf": [
            {
               "$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: TaintEffect | None = None#

Taint effect to match. If None, match all taint effects.

Validated by:
  • _validate

field key: str | None = None#

Taint key to match. If None, operator must be Exists, and this combination is used to match all taints.

Validated by:
  • _validate

field operator: TolerationOperator = TolerationOperator.EQUAL#

Exists is equivalent to a wildcard for value and matches all possible taints of a given catgory.

Validated by:
  • _validate

field tolerationSeconds: int | None = None (name 'toleration_seconds')#

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.

Validated by:
  • _validate

field value: str | None = None#

Taint value to match. Must be None if the operator is Exists.

Validated by:
  • _validate

to_kubernetes()#

Convert to the corresponding Kubernetes resource. :rtype: V1Toleration