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.cybozu.com/capacity",
"ignoredByScheduler": true
}],
"nodeCacheCapable": false
}]
}
As it shown, only pods that request topolvm.cybozu.com/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 topolvm.cybozu.com/capacity
annotation.
This verb scores nodes. The score of a node is calculated by this formula:
min(10, max(0, log2(capacity >> 30 / divisor)))
divisor
can be changed with divisor
command-line flag.
Name | Type | Default | Description |
---|---|---|---|
listen |
string | :8000 |
HTTP listening address |
divisor |
float64 | 1 | A variable for node scoring |