From d16a24988befb5032b39188d75f195b0c2c20b44 Mon Sep 17 00:00:00 2001 From: Allen Rohner Date: Mon, 17 Oct 2016 12:33:16 -0500 Subject: [PATCH] Use the env var KUBERNETES_SERVICE_HOST if present --- utils/kubeutil.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/kubeutil.py b/utils/kubeutil.py index 2dc9dc1c70..242b5be22a 100644 --- a/utils/kubeutil.py +++ b/utils/kubeutil.py @@ -63,7 +63,7 @@ def __init__(self, instance=None): self.kubelet_api_url = '%s://%s:%d' % (self.method, self.host, self.kubelet_port) self.cadvisor_url = '%s://%s:%d' % (self.method, self.host, self.cadvisor_port) - self.kubernetes_api_url = 'https://%s/api/v1' % self.DEFAULT_MASTER_NAME + self.kubernetes_api_url = 'https://%s/api/v1' % (os.environ.get('KUBERNETES_SERVICE_HOST') or self.DEFAULT_MASTER_NAME) self.metrics_url = urljoin(self.cadvisor_url, KubeUtil.METRICS_PATH) self.pods_list_url = urljoin(self.kubelet_api_url, KubeUtil.PODS_LIST_PATH)