mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-02-14 18:09:57 +00:00
Update local-up.sh (#124)
Signed-off-by: xuezhaojun <zxue@redhat.com> Signed-off-by: xuezhaojun <zxue@redhat.com>
This commit is contained in:
@@ -16,20 +16,17 @@ kind create cluster --name "${hub}"
|
||||
kind create cluster --name "${c1}"
|
||||
kind create cluster --name "${c2}"
|
||||
|
||||
kubectl config use ${hubctx}
|
||||
echo "Initialize the ocm hub cluster"
|
||||
joincmd=$(clusteradm init --use-bootstrap-token | grep clusteradm)
|
||||
echo "Initialize the ocm hub cluster\n"
|
||||
clusteradm init --wait --context ${hubctx}
|
||||
joincmd=$(clusteradm get token --context ${hubctx} | grep clusteradm)
|
||||
|
||||
kubectl config use ${c1ctx}
|
||||
echo "Join cluster1 to hub"
|
||||
$(echo ${joincmd} --force-internal-endpoint-lookup --wait | sed "s/<cluster_name>/$c1/g")
|
||||
echo "Join cluster1 to hub\n"
|
||||
$(echo ${joincmd} --force-internal-endpoint-lookup --wait --context ${c1ctx} | sed "s/<cluster_name>/$c1/g")
|
||||
|
||||
kubectl config use ${c2ctx}
|
||||
echo "Join cluster2 to hub"
|
||||
$(echo ${joincmd} --force-internal-endpoint-lookup --wait | sed "s/<cluster_name>/$c2/g")
|
||||
echo "Join cluster2 to hub\n"
|
||||
$(echo ${joincmd} --force-internal-endpoint-lookup --wait --context ${c2ctx} | sed "s/<cluster_name>/$c2/g")
|
||||
|
||||
kubectl config use ${hubctx}
|
||||
echo "Accept join of cluster1 and cluster2"
|
||||
clusteradm accept --clusters ${c1},${c2} --wait
|
||||
clusteradm accept --context ${hubctx} --clusters ${c1},${c2} --wait
|
||||
|
||||
kubectl get managedclusters --all-namespaces
|
||||
kubectl get managedclusters --all-namespaces --context ${hubctx}
|
||||
|
||||
Reference in New Issue
Block a user