diff --git a/python-clusters/attach-gke-cluster/cluster.py b/python-clusters/attach-gke-cluster/cluster.py index a189437..1287018 100644 --- a/python-clusters/attach-gke-cluster/cluster.py +++ b/python-clusters/attach-gke-cluster/cluster.py @@ -31,7 +31,7 @@ def start(self): kube_config_path = os.path.join(os.getcwd(), 'kube_config') create_kube_config_file(cluster.name, is_regional, kube_config_path) - # add the admin role so that we can do the managed kubernetes stuff for spark + # add the admin role so that we can do the managed kubernetes stuff for Spark create_admin_binding(self.config.get("userName", None), kube_config_path) # collect and prepare the overrides so that DSS can know where and how to use the cluster diff --git a/python-lib/dku_kube/role.py b/python-lib/dku_kube/role.py index 0a7515a..58f1bba 100644 --- a/python-lib/dku_kube/role.py +++ b/python-lib/dku_kube/role.py @@ -9,9 +9,10 @@ def create_admin_binding(user_name=None, kube_config_path=None): env = os.environ.copy() if not _is_none_or_blank(kube_config_path): env['KUBECONFIG'] = kube_config_path - logging.info("Checking clusterrolebinding with KUBECONFIG=%s" % kube_config_path) + logging.info("Checking ClusterRoleBinding existence with KUBECONFIG=%s" % kube_config_path) out = subprocess.check_output(["kubectl", "get", "clusterrolebinding", "cluster-admin-binding", "--ignore-not-found"], env=env) if not _is_none_or_blank(out): - logging.info("Clusterrolebinding already exist") + logging.info("ClusterRoleBinding already exists") else: + logging.info("Creating ClusterRoleBinding with KUBECONFIG=%s" % kube_config_path) subprocess.check_call(["kubectl", "create", "clusterrolebinding", "cluster-admin-binding", "--clusterrole", "cluster-admin", "--user", user_name], env=env)