Skip to content

Commit

Permalink
Support Kaniko job in a outside-cluster jupyter. (#535)
Browse files Browse the repository at this point in the history
* Make kaniko job working in a outside-cluster jupyter.

* Also support in-cluster config.
  • Loading branch information
qimingj authored and k8s-ci-robot committed Dec 13, 2018
1 parent 6b315d4 commit 19e7ff2
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion sdk/python/kfp/compiler/_k8s_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ def __init__(self):
raise Exception('K8sHelper __init__ failure')

def _configure_k8s(self):
config.load_incluster_config()
try:
config.load_kube_config()
logging.info('Found local kubernetes config. Initialized with kube_config.')
except:
logging.info('Cannot Find local kubernetes config. Trying in-cluster config.')
config.load_incluster_config()
logging.info('Initialized with in-cluster config.')

self._api_client = k8s_client.ApiClient()
self._corev1 = k8s_client.CoreV1Api(self._api_client)
return True
Expand Down

0 comments on commit 19e7ff2

Please sign in to comment.