Commit 3a28a13b authored by Daniele Venzano's avatar Daniele Venzano

Use only IP addresses as keys in node_dict (fixes #62 on github)

parent 41c6cdf4
......@@ -16,8 +16,9 @@
"""Interface to the low-level Kubernetes API."""
import logging
from argparse import Namespace
import socket
from typing import Dict, Any, List
import humanfriendly
import pykube
......@@ -413,7 +414,7 @@ class KubernetesClient:
nss.cores_total = float(node.obj['status']['allocatable']['cpu'])
nss.memory_total = humanfriendly.parse_size(node.obj['status']['allocatable']['memory'])
nss.labels = node.obj['metadata']['labels']
node_dict[node.name] = nss
node_dict[str(socket.gethostbyname(node.name))] = nss
# Get information from all running pods, then accumulate to nodes
pod_list = pykube.Pod.objects(self.api).filter(namespace=pykube.all).iterator()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment