Created
August 19, 2019 18:08
-
-
Save chmeee/5935cf30ab416c53b4b5d8d10754eb12 to your computer and use it in GitHub Desktop.
Create federated Minikube clusters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create NUM_CLUSTER minikube clusters | |
if [[ -z $NUM_CLUSTER ]]; then | |
NUM_CLUSTER=2 | |
fi | |
if [[ -z $VERSION ]]; then | |
VERSION=0.1.0-rc5 | |
fi | |
seq -f cluster%g 1 $NUM_CLUSTER | xargs -n1 -P1 minikube start -p | |
# Switch to cluster1 | |
kubectx cluster1 | |
# Prepare RBAC for helm | |
kubectl apply -f ../helm/helm-rbac.yaml | |
# helm init | |
helm init --service-account tiller | |
# add helm repo | |
helm repo add kubefed-charts https://raw.githubusercontent.com/kubernetes-sigs/kubefed/master/charts | |
# helm install | |
while [[ ! $(kubectl get deploy tiller-deploy -n kube-system -o jsonpath='{.status.readyReplicas}') -eq 1 ]]; do sleep 1; done | |
helm install kubefed-charts/kubefed --name kubefed --version=0.1.0-rc5 --namespace kube-federation-system | |
# kubefedctl join | |
while [[ ! $(kubectl get deploy kubefed-admission-webhook -n kube-federation-system -o jsonpath='{.status.readyReplicas}') -eq 1 && \ | |
! $(kubectl get deploy kubefed-controller-manager -n kube-federation-system -o jsonpath='{.status.readyReplicas}') -eq 2 ]]; do sleep 1; done | |
seq -f cluster%g 1 $NUM_CLUSTER | while read cluster; do | |
kubefedctl join $cluster --cluster-context $cluster --host-cluster-context cluster1 --v=2 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment