#121 show and honor node allocatable

This commit is contained in:
Henning Jacobs
2017-02-12 14:11:33 +01:00
parent ba1443def5
commit ea27747666
4 changed files with 21 additions and 7 deletions

View File

@@ -16,6 +16,7 @@ def map_node_status(status: dict):
return {
'addresses': status.get('addresses'),
'capacity': status.get('capacity'),
'allocatable': status.get('allocatable')
}

View File

@@ -67,7 +67,9 @@ def query_mock_cluster(cluster):
else:
pod = generate_mock_pod(index, i, j)
pods['{}/{}'.format(pod['namespace'], pod['name'])] = pod
node = {'name': 'node-{}'.format(i), 'labels': labels, 'status': {'capacity': {'cpu': '4', 'memory': '32Gi', 'pods': '110'}}, 'pods': pods}
node = {'name': 'node-{}'.format(i), 'labels': labels, 'status': {
'capacity': {'cpu': '4', 'memory': '32Gi', 'pods': '110'},
'allocatable': {'cpu': '3800m', 'memory': '31Gi'}}, 'pods': pods}
nodes[node['name']] = node
pod = generate_mock_pod(index, 11, index)
unassigned_pods = {'{}/{}'.format(pod['namespace'], pod['name']): pod}