Skip to content

create containers on nodes with least current containers#301

Merged
runleveldev merged 1 commit into
mainfrom
rgingras/299-distribute-containers-across-multiple-nodes
May 11, 2026
Merged

create containers on nodes with least current containers#301
runleveldev merged 1 commit into
mainfrom
rgingras/299-distribute-containers-across-multiple-nodes

Conversation

@runleveldev
Copy link
Copy Markdown
Collaborator

@runleveldev runleveldev commented May 11, 2026

You can see the node placement logic at work here. Manager and demo already existed on pve1, so pve2 got filled before pve1 started to be used again.

image

Copilot Summary

This pull request improves the logic for selecting a node when creating a new container, aiming to better balance the load across available nodes. Instead of picking any available node, the system now chooses the node with the fewest existing containers.

Load balancing improvements:

  • Updated the node selection query in containers.js to join with the Container model, group by node, and order by the number of containers, ensuring the least-loaded node is chosen for new containers.

Copy link
Copy Markdown
Collaborator

@cmyers-mieweb cmyers-mieweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, lets get it merged

@runleveldev runleveldev merged commit bdd4d20 into main May 11, 2026
5 checks passed
@runleveldev runleveldev deleted the rgingras/299-distribute-containers-across-multiple-nodes branch May 11, 2026 20:37
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.

Distribute containers across multiple nodes

2 participants