Skip to content

Instantly share code, notes, and snippets.

@josecastillolema
Last active December 27, 2022 11:10
Show Gist options
  • Save josecastillolema/c050c78e46b4a963bbf8dbf3f4213d7c to your computer and use it in GitHub Desktop.
Save josecastillolema/c050c78e46b4a963bbf8dbf3f4213d7c to your computer and use it in GitHub Desktop.
OCM start/cleanup scripts
kind delete cluster --name cluster1
kind delete cluster --name hub
kind create cluster --name hub
kind create cluster --name cluster1
clusteradm init --wait --context kind-hub
OUTPUT=$(clusteradm get token --context kind-hub | tail -1)
JOIN_COMMAND=$(echo $OUTPUT | sed 's/<cluster_name>/cluster1/')
eval "$JOIN_COMMAND --force-internal-endpoint-lookup --context kind-cluster1"
sleep 60
clusteradm accept --clusters cluster1 --context kind-hub
sleep 2
kubectl get managedcluster --context kind-hub
kubectx kind-hub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment