Skip to content

fix(imagejob): skip nodes with insufficient resources before scheduling pods - #1235

Open
AruneshDwivedi wants to merge 2 commits into
eraser-dev:mainfrom
AruneshDwivedi:fix/insufficient-resources-1005
Open

fix(imagejob): skip nodes with insufficient resources before scheduling pods#1235
AruneshDwivedi wants to merge 2 commits into
eraser-dev:mainfrom
AruneshDwivedi:fix/insufficient-resources-1005

Conversation

@AruneshDwivedi

Copy link
Copy Markdown

Fixes #1005

When a node doesn't have enough CPU or memory to run the eraser pod,
the controller still creates the pod, which then gets stuck in Pending
state (OutOfcpu/Outofmemory). This wastes reconcile cycles and creates
noisy logs.

Add a resource check before pod creation: compare the node's allocatable
resources against the pod's requested/limited resources. If the node
can't accommodate the pod, skip it and move to the next node.

When a PodTemplate is deleted before the imagejob-controller processes
the ImageJob, the controller logs a scary 'PodTemplate not found' error
and marks the job as failed, even though the job may have already
completed or been handled by another controller.

This change uses client.IgnoreNotFound to silently ignore missing
PodTemplates, matching the pattern already used elsewhere in the
controller.

Fixes eraser-dev#1051

Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>
…ng pods

When a node doesn't have enough CPU or memory to run the eraser pod,
the controller still creates the pod, which then gets stuck in
Pending state (OutOfcpu/Outofmemory). This wastes reconcile cycles
and creates noisy logs.

Add a resource check before pod creation: compare the node's
allocatable resources against the pod's requested/limited resources.
If the node can't accommodate the pod, skip it and move to the next
node.

Fixes eraser-dev#1005

Signed-off-by: Arunesh Dwivedi <arunesh.devops@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Controller tries to place pods on nodes with insufficient resources

1 participant