Merge pull request #879 from mjibson/k8s-endpoint

Use env vars to set k8s endpoint URL
This commit is contained in:
Matt Jibson 2015-11-16 15:41:40 -05:00
commit a8a61cb80d

View file

@ -10,7 +10,10 @@ from util.config.provider.fileprovider import FileConfigProvider
logger = logging.getLogger(__name__)
KUBERNETES_API_HOST = 'kubernetes.default.svc.cluster.local'
KUBERNETES_API_HOST = os.environ.get('KUBERNETES_SERVICE_HOST', '')
port = os.environ.get('KUBERNETES_SERVICE_PORT')
if port:
KUBERNETES_API_HOST += ':' + port
SERVICE_ACCOUNT_TOKEN_PATH = '/var/run/secrets/kubernetes.io/serviceaccount/token'