-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: start building out multi-cluster example
- Loading branch information
1 parent
f14e473
commit 05a0cfa
Showing
7 changed files
with
47 additions
and
12 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.kubeconfig |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
|
||
CLUSTER_NAME_PREFIX=${CLUSTER_NAME_PREFIX:-multi-cluster} | ||
|
||
set -ex | ||
|
||
# Create the clusters | ||
|
||
kind create cluster \ | ||
--name ${CLUSTER_NAME_PREFIX}-one \ | ||
--config ./cluster-one.yaml \ | ||
--kubeconfig ./cluster-one.kubeconfig | ||
kubectl --kubeconfig ./cluster-one.kubeconfig \ | ||
config set-context --current --namespace kube-system | ||
|
||
kind create cluster \ | ||
--name ${CLUSTER_NAME_PREFIX}-two \ | ||
--config ./cluster-two.yaml \ | ||
--kubeconfig ./cluster-two.kubeconfig | ||
kubectl --kubeconfig ./cluster-two.kubeconfig \ | ||
config set-context --current --namespace kube-system | ||
|
||
# Install the kubernetes configurations to each cluster | ||
|
||
kubectl --kubeconfig ./cluster-one.kubeconfig \ | ||
--namespace kube-system \ | ||
create secret generic cluster-two-credentials \ | ||
--from-file=kubeconfig=./cluster-two.kubeconfig | ||
|
||
kubectl --kubeconfig ./cluster-two.kubeconfig \ | ||
--namespace kube-system \ | ||
create secret generic cluster-one-credentials \ | ||
--from-file=kubeconfig=./cluster-one.kubeconfig |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
CLUSTER_NAME_PREFIX=${CLUSTER_NAME_PREFIX:-multi-cluster} | ||
|
||
set -ex | ||
|
||
kind delete cluster --name ${CLUSTER_NAME_PREFIX}-one | ||
kind delete cluster --name ${CLUSTER_NAME_PREFIX}-two | ||
rm -f cluster-one.kubeconfig cluster-two.kubeconfig |