Skip to content

Commit

Permalink
topology-updater: Track new resources not present during startup
Browse files Browse the repository at this point in the history
If a device plugin registers itself with kubelet after NFD topology-updater
is already running the NRT will never be updated with new resources.

Signed-off-by: Oleg Zhurakivskyy <[email protected]>
  • Loading branch information
ozhuraki committed Oct 7, 2024
1 parent d963cd3 commit 230fc67
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pkg/resourcemonitor/noderesourcesaggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,29 @@ func (noderesourceData *nodeResources) Aggregate(podResData []PodResources) topo
available: int64(0),
capacity: int64(len(noderesourceData.reservedCPUIDPerNUMA[nodeID])),
}

for resName, allocatable := range nodeRes {
perNuma[nodeID][resName] = &resourceData{
allocatable: allocatable,
available: allocatable,
capacity: allocatable,
}

rn := string(resName)
noderesourceData.resourceID2NUMAID[rn] = make(map[string]int)

for _, podRes := range podResData {
for _, contRes := range podRes.Containers {
for _, res := range contRes.Resources {
if res.Name == resName {
for _, deviceID := range res.Data {
noderesourceData.resourceID2NUMAID[rn][deviceID] = nodeID
}
}
}
}
}
}
}
}

Expand Down

0 comments on commit 230fc67

Please sign in to comment.