topolvm-scheduler
is a Kubernetes scheduler extender for TopoLVM.
It filters and prioritizes Nodes based on the amount of free space in their volume groups.
topolvm-scheduler
need to be configured in scheduler policy as follows:
{
...
"extenders": [{
"urlPrefix": "http://...",
"filterVerb": "predicate",
"prioritizeVerb": "prioritize",
"managedResources":
[{
"name": "topolvm.io/capacity",
"ignoredByScheduler": true
}],
"nodeCacheCapable": false
}]
}
As shown above, only pods that request topolvm.io/capacity
resource are
managed by topolvm-scheduler
.
The extender provides two verbs:
predicate
to filter nodesprioritize
to score nodes
This verb filters out nodes whose volume groups have not enough free space.
Volume group capacity is identified from the value of capacity.topolvm.io/<device-class>
annotation.
This verb scores nodes. The score of a node is calculated by this formula:
For example, the default of divisor
is 1
, then if a node has the free disk capacity more than 1024GiB
, topolvm-scheduler
scores the node as 10
. divisor
should be adjusted to suit each environment.
divisor
can be given through the configuration file.
Name | Type | Default | Description |
---|---|---|---|
config |
string | `` | Config file path |
The divisor parameter can be specified in YAML file:
default-divisor: 10
divisors:
ssd: 5
hdd: 10
Name | Type | Default | Description |
---|---|---|---|
listen |
string | :8000 |
HTTP listening address |
default-divisor |
float64 | 1 |
A default value of the variable for node scoring. |
divisors |
map[string]float64 |
{} |
A variable for node scoring per device-class. |