From fb940bb9f40406e8ec774b51b3a5f1cf16057cae Mon Sep 17 00:00:00 2001 From: Yang Le Date: Wed, 8 Nov 2023 16:25:15 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20the=20wrong=20endpoint=20i?= =?UTF-8?q?ssue=20of=20the=20multiple=20hubs=20hosted=20solution=20(#309)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Yang Le --- solutions/multiple-hubs-hosted/README.md | 1 + solutions/multiple-hubs-hosted/setup-hub2.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/solutions/multiple-hubs-hosted/README.md b/solutions/multiple-hubs-hosted/README.md index 350a3f8df..5c9246536 100644 --- a/solutions/multiple-hubs-hosted/README.md +++ b/solutions/multiple-hubs-hosted/README.md @@ -13,6 +13,7 @@ The scripts provided in this doc help you to setup an Open Cluster Management (O sudo chmod +x /usr/local/bin/clusteradm ``` + Note: In order to run the scripts provided in this doc successfully, the clusteradm version must be > 0.7.1. You can also build it from the latest [source code](https://github.com/open-cluster-management-io/clusteradm) that contains the desired bug fixes. ## Setup the first hub cluster diff --git a/solutions/multiple-hubs-hosted/setup-hub2.sh b/solutions/multiple-hubs-hosted/setup-hub2.sh index e1df9250d..bcae1d5ca 100755 --- a/solutions/multiple-hubs-hosted/setup-hub2.sh +++ b/solutions/multiple-hubs-hosted/setup-hub2.sh @@ -18,11 +18,11 @@ joincmd=$(clusteradm init --use-bootstrap-token | grep clusteradm) kubectl wait --for=condition=HubRegistrationDegraded=false clustermanager cluster-manager --timeout=60s kubectl config use ${clusterctx} -kubectl config view --flatten --minify | sed "s/127.0.0.1:[0-9]\{5\}/${cluster}-control-plane:6443/" > kubeconfig.${cluster} +kubectl config view --flatten --minify > kubeconfig.${cluster} kubectl config use ${hostingctx} echo "Join ${cluster} to ${hub}" -$(echo ${joincmd} --singleton --force-internal-endpoint-lookup --mode hosted --managed-cluster-kubeconfig kubeconfig.${cluster} --wait | sed "s//$cluster/g") +$(echo ${joincmd} --singleton --force-internal-endpoint-lookup --mode hosted --force-internal-endpoint-lookup-managed --managed-cluster-kubeconfig kubeconfig.${cluster} --wait | sed "s//$cluster/g") rm kubeconfig.${cluster} kubectl config use ${hubctx}