A tool to consider.
By Marco Neumann.
An practical example.
Cluster
Node
Node
Pod
Pod
Pod
Find a solution.
Variables
Constraints
Node 1 | Node 2 | ||
Pod A | ☐ | ☐ | |
Pod B | ☐ | ☐ | |
Pod C | ☐ | ☐ | |
∑=0 ≤ 5 | ∑=0 ≤ 5 |
Cluster
Node
Node
Node 1 | Node 2 | ||
Pod A | ☑ | ☐ | ∑=1 = 1 |
Pod B | ☐ | ☐ | |
Pod C | ☐ | ☐ | |
∑=1 ≤ 5 | ∑=0 ≤ 5 |
Cluster
Node
Node
Pod A
Node 1 | Node 2 | ||
Pod A | ☑ | ☑ | ∑=2 = 1 |
Pod B | ☐ | ☐ | |
Pod C | ☐ | ☐ | |
∑=1 ≤ 5 | ∑=0 ≤ 5 |
Cluster
Node
Node
Pod A
Pod A
Node 1 | Node 2 | ||
Pod A | ☑ | ☐ | ∑=0 = 1 |
Pod B | ☑ | ☐ | ∑=0 = 1 |
Pod C | ☑ | ☐ | ∑=0 = 1 |
∑=0 ≤ 5 |
Cluster
Node
Node
Pod B
Pod C
Pod A
Node 1 | Node 2 | ||
Pod A | ☑ | ☐ | ∑=1 = 1 |
Pod B | ☑ | ☐ | ∑=1 = 1 |
Pod C | ☐ | ☑ | ∑=1 = 1 |
∑=4 ≤ 5 | ∑=2 ≤ 5 |
Cluster
Node
Node
Pod B
Pod C
Pod A
Roughly: The problem is so hard that you have to enumerate all solutions.
Math: Exponential complexity.
😱
Knapsack is NP-complete.
Most real instances are NOT.
Solvers are VERY fast.
😅
Find best solution.
Constraints
Target Function
min/max equation:
Most solvers are numeric!
Weight-based
Unit-based
e.g. express cost in €
Cost of running nodes
Discruption by moving existing pods
Actually implementing it.
YAML
serde
Rust struct
good_lp
problem gen
SCIP
interprete
YAML
serde
Rust struct
⚠️ prototype code ⚠️
nodes:
n1:
cpu: 2.0
memory: 16.0
cost: 50.0
n2:
cpu: 1.0
memory: 32.0
cost: 200.0
n3:
cpu: 1.0
memory: 32.0
cost: 100.0
pods:
p1:
cpu: 0.5
memory: 10.0
movement_cost: 200.0
current_node: n2
p2:
cpu: 1.0
memory: 8.0
p3:
cpu: 1.0
memory: 8.0
p4:
cpu: 0.5
memory: 2.0
Wrap-up & alternatives.
Manual
Existing Optimizer
Open Source
Proprietary
Use the "tightest" fitting tool!
Alternatives
???