From 3a0e31c35bc5274b7e1d18a31b2e49829ddd6dca Mon Sep 17 00:00:00 2001 From: David Boreham Date: Sun, 19 Nov 2023 06:26:55 -0700 Subject: [PATCH] Pick up kube config file --- stack_orchestrator/deploy/k8s/deploy_k8s.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stack_orchestrator/deploy/k8s/deploy_k8s.py b/stack_orchestrator/deploy/k8s/deploy_k8s.py index 973d31ce..75964cb4 100644 --- a/stack_orchestrator/deploy/k8s/deploy_k8s.py +++ b/stack_orchestrator/deploy/k8s/deploy_k8s.py @@ -48,7 +48,11 @@ class K8sDeployer(Deployer): self.cluster_info.int(compose_files, compose_env_file) def connect_api(self): - config.load_kube_config(context=f"kind-{self.kind_cluster_name}") + if self.is_kind(): + config.load_kube_config(context=f"kind-{self.kind_cluster_name}") + else: + # Get the config file and pass to load_kube_config() + config.load_kube_config(config_file=self.deployment_dir.joinpath(constants.kube_config_filename)) self.core_api = client.CoreV1Api() self.apps_api = client.AppsV1Api()