# 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.

- **ID:** `kubernetes/insufficient-node-selector`
- **Domain:** kubernetes
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## 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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Kubernetes 1.24 | active | — | — |
| Kubernetes 1.27 | active | — | — |

## Workarounds

1. **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.** (90% success)
   ```
   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.
   ```
2. **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`.** (85% success)
   ```
   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`.
   ```
3. **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.** (80% success)
   ```
   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.
   ```

## Dead Ends

- **** — Increasing the pod's priority class does not help if no nodes match the affinity rules; it only affects preemption. (70% fail)
- **** — Adding more nodes without correct labels will not match the pod's selectors. (80% fail)
