kubernetes-sigs / kubernetes-sigs/scheduler-plugins

[NodeTopologyMatch] Scheduler compute PFP for pod with resources which are not exclusive

Open
#985 1 comment 0 reactions 0 assignees View on GitHub
kind/bug
Dominant language
Go
Stars
1.3k
Forks
614
Avg merge
12h 45m
Merged PRs (30d)
6

Description

### Area

- [x] Scheduler
- [ ] Controller
- [ ] Helm Chart
- [ ] Documents

### Other components

_No response_

### What happened?

**Problem**
The NodeResourceTopology plugin treats all non-native resources as exclusive:

``` go
if !v1helper.IsNativeResource(resource) {
return true
}

```
That assumes every non-native resource name - typically anything with a `/` that is not under `kubernetes.io/` - represents non-shareable, topology-bound hardware.

That is not true in general. [Extended resources](https://kubernetes.io/docs/tasks/administer-cluster/extended-resource-node/) are often not tied to actual hardware from a topology perspective: they may be logical quotas, cluster-level extensions.
Same goes for device-plugin resources that the topology exporter does not place on NUMA nodes. Those resources are not exclusive in the sense the scheduler cache and pod fingerprint logic care about.

Conflating “extended resource” with “topology-exclusive resource” leads to incorrect behavior anywhere `AreExclusiveForPod` / `IsExclusive` function is used.

**Impact**
Scheduler-side logic uses exclusive-resource detection to decide which pods matter for node state reconciliation:

Pod fingerprint (PFP) resync — with `CacheResyncMethod: OnlyExclusiveResources`, only pods with exclusive resources are included in the computed fingerprint. Pods requesting extended resources that are not topology-relevant are wrongly included, causing fingerprint mismatches and incorrect cache resync.

Foreign pod detection — with `ForeignPodsDetect: OnlyExclusiveResources`, foreign pods with such resources are incorrectly flagged, marking nodes dirty and preventing use of cached topology data.

### What did you expect to happen?

The scheduler should count only for pod which are requesting native resources or devices which are backed by device plugin and are actually bound to the hardware topology, i.e. non-shareable.

### How can we reproduce it (as minimally and precisely as possible)?

1. Creating an extended resource using the procedure from: https://kubernetes.io/docs/tasks/administer-cluster/extended-resource-node/
2. Create a pod with a request only for that specific resource.
3. The scheduler will count the pod in its fingerprint computation even though the pod is neither Guaranteed nor requesting native resources nor requesting exclusive device.

### Anything else we need to know?

_No response_

### Kubernetes version

```console
$ kubectl version
Kubernetes Version: v1.35.5
```

### Scheduler Plugins version

This issue is in NodeTopologyMatch scheduler since day 1.

Contributor guide

Open the contributing guide

Research direction

Start at the NodeTopologyMatch scheduler logic around AreExclusiveForPod and IsExclusive, then reproduce the issue with an extended resource and a pod requesting only that resource. Done means non-topology-backed extended resources no longer affect pod fingerprint resync or foreign-pod detection, while native and topology-backed exclusive devices still do.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.