NodeAffinity

pydantic model controller.models.domain.kubernetes.NodeAffinity

Node affinity rules.

Parameters:

data (Any)

Show JSON schema
{
   "title": "NodeAffinity",
   "description": "Node affinity rules.",
   "type": "object",
   "properties": {
      "preferredDuringSchedulingIgnoredDuringExecution": {
         "default": [],
         "description": "Preference rules used for scheduling and ignored afterwards",
         "items": {
            "$ref": "#/$defs/PreferredSchedulingTerm"
         },
         "title": "Scheduling terms",
         "type": "array"
      },
      "requiredDuringSchedulingIgnoredDuringExecution": {
         "anyOf": [
            {
               "$ref": "#/$defs/NodeSelector"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "Required node selection rules",
         "title": "Node selectors"
      }
   },
   "$defs": {
      "NodeSelector": {
         "additionalProperties": false,
         "description": "Matching terms for nodes.",
         "properties": {
            "nodeSelectorTerms": {
               "default": [],
               "description": "Matching terms for nodes",
               "items": {
                  "$ref": "#/$defs/NodeSelectorTerm"
               },
               "title": "Terms",
               "type": "array"
            }
         },
         "title": "NodeSelector",
         "type": "object"
      },
      "NodeSelectorOperator": {
         "description": "Match operations for node selectors.",
         "enum": [
            "In",
            "NotIn",
            "Exists",
            "DoesNotExist",
            "Gt",
            "Lt"
         ],
         "title": "NodeSelectorOperator",
         "type": "string"
      },
      "NodeSelectorRequirement": {
         "additionalProperties": false,
         "description": "Individual match rule for nodes.",
         "properties": {
            "key": {
               "description": "Label key to match",
               "title": "Key",
               "type": "string"
            },
            "operator": {
               "allOf": [
                  {
                     "$ref": "#/$defs/NodeSelectorOperator"
                  }
               ],
               "description": "Match operation to use",
               "title": "Operator"
            },
            "values": {
               "default": [],
               "description": "For ``In`` and ``NotIn``, matches any value in this list. For ``Gt`` or ``Lt``, must contain a single member interpreted as an integer. For ``Exists`` or ``DoesNotExist``, must be empty.",
               "items": {
                  "type": "string"
               },
               "title": "Matching values",
               "type": "array"
            }
         },
         "required": [
            "key",
            "operator"
         ],
         "title": "NodeSelectorRequirement",
         "type": "object"
      },
      "NodeSelectorTerm": {
         "additionalProperties": false,
         "description": "Term to match nodes.",
         "properties": {
            "matchExpressions": {
               "default": [],
               "description": "Matching rules applied to node labels",
               "items": {
                  "$ref": "#/$defs/NodeSelectorRequirement"
               },
               "title": "Rules for node labels",
               "type": "array"
            },
            "matchFields": {
               "default": [],
               "description": "Matching rules applied to node fields",
               "items": {
                  "$ref": "#/$defs/NodeSelectorRequirement"
               },
               "title": "Rules for node fields",
               "type": "array"
            }
         },
         "title": "NodeSelectorTerm",
         "type": "object"
      },
      "PreferredSchedulingTerm": {
         "additionalProperties": false,
         "description": "Scheduling term with a weight, used to find preferred nodes.",
         "properties": {
            "preference": {
               "allOf": [
                  {
                     "$ref": "#/$defs/NodeSelectorTerm"
                  }
               ],
               "description": "Selector term for a node",
               "title": "Node selector"
            },
            "weight": {
               "description": "Weight to assign to nodes matching this term",
               "title": "Weight",
               "type": "integer"
            }
         },
         "required": [
            "preference",
            "weight"
         ],
         "title": "PreferredSchedulingTerm",
         "type": "object"
      }
   },
   "additionalProperties": false
}

Fields:
field preferredDuringSchedulingIgnoredDuringExecution: list[PreferredSchedulingTerm] = [] (name 'preferred')

Preference rules used for scheduling and ignored afterwards

field requiredDuringSchedulingIgnoredDuringExecution: NodeSelector | None = None (name 'required')

Required node selection rules

to_kubernetes()

Convert to the corresponding Kubernetes model.

Return type:

V1NodeAffinity