{
  "id": "kubernetes/insufficient-node-selector",
  "signature": "0/4 nodes are available: 4 node(s) didn't match Pod's node affinity/selector. preemption: 0/4 nodes are available: 4 No preemption victims found for incoming pod.",
  "signature_zh": "0/4 个节点可用：4 个节点不匹配 Pod 的节点亲和性/选择器。抢占：0/4 个节点可用：4 个未找到可抢占的受害者。",
  "regex": "\\d+ node\\(s\\) didn't match Pod's node affinity/selector",
  "domain": "kubernetes",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "The pod has node affinity rules or node selectors that do not match any available node's labels, and preemption cannot find victims because the pod's priority is too low or no lower-priority pods exist.",
  "root_cause_type": "generic",
  "root_cause_zh": "Pod 的节点亲和性规则或节点选择器与任何可用节点的标签都不匹配，并且抢占无法找到受害者，因为 Pod 的优先级太低或不存在更低优先级的 Pod。",
  "versions": [
    {
      "version": "Kubernetes 1.24",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kubernetes 1.27",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Increasing the pod's priority class does not help if no nodes match the affinity rules; it only affects preemption.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Adding more nodes without correct labels will not match the pod's selectors.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check the pod's node affinity/selector: `kubectl get pod <pod-name> -o yaml | grep -A 10 nodeAffinity`. Then verify node labels: `kubectl get nodes --show-labels`. Adjust the pod spec or node labels to match.",
      "success_rate": 0.9,
      "how": "Check the pod's node affinity/selector: `kubectl get pod <pod-name> -o yaml | grep -A 10 nodeAffinity`. Then verify node labels: `kubectl get nodes --show-labels`. Adjust the pod spec or node labels to match.",
      "condition": "",
      "sources": []
    },
    {
      "action": "If the pod uses nodeSelector, add the required label to a node: `kubectl label node <node-name> <key>=<value>`. For example, if nodeSelector has `disktype: ssd`, run `kubectl label node worker1 disktype=ssd`.",
      "success_rate": 0.85,
      "how": "If the pod uses nodeSelector, add the required label to a node: `kubectl label node <node-name> <key>=<value>`. For example, if nodeSelector has `disktype: ssd`, run `kubectl label node worker1 disktype=ssd`.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Remove or relax the node affinity rules by editing the pod/deployment spec: `kubectl edit deployment <deployment-name>` and remove the `nodeSelector` or `nodeAffinity` fields.",
      "success_rate": 0.8,
      "how": "Remove or relax the node affinity rules by editing the pod/deployment spec: `kubectl edit deployment <deployment-name>` and remove the `nodeSelector` or `nodeAffinity` fields.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Check the pod's node affinity/selector: `kubectl get pod <pod-name> -o yaml | grep -A 10 nodeAffinity`. Then verify node labels: `kubectl get nodes --show-labels`. Adjust the pod spec or node labels to match.",
    "If the pod uses nodeSelector, add the required label to a node: `kubectl label node <node-name> <key>=<value>`. For example, if nodeSelector has `disktype: ssd`, run `kubectl label node worker1 disktype=ssd`.",
    "Remove or relax the node affinity rules by editing the pod/deployment spec: `kubectl edit deployment <deployment-name>` and remove the `nodeSelector` or `nodeAffinity` fields."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-11-01",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}