this demo will iterate through all the kubeconfig and demonstrate that you can use a generic kubeconfig to import multiple clusters
├── approve-import.sh
├── az-get-kubeconfig.sh
├── configs
│ ├── bootstrap-kubeconfig.yaml
│ └── dockerconfig.json.b64
├── demo
├── demo-cleanup.sh
├── demo-magic
├── generic-import-hub-cleanup.sh
├── generic-import-hub-setup.sh
├── generic-import.sh
├── kubeconfigs
│ ├── kubeconfig-1
│ ├── kubeconfig-1
│ └── kubeconfig-...
└── templates
├── bootstrap-kubeconfig.yaml
├── crds.yaml
├── import.yaml
└── managedcluster.yaml
demo
: run the main demodemo-magic
: magic that drives the demodemo-cleanup.sh
: cleanup after demogeneric-import-hub-setup.sh
: setup script to run against hub before demo.generic-import-hub-cleanup.sh
: cleanup script for after the demo.generate-import.sh
: heart of this demo to execute the import flow.approve-import.sh
: script for SRE to approve ManagedCluster join to the hub.az-get-kubeconfig.sh
: helper script to get AKS kubeconfig from Azure.configs
: directory containing stuff generated by setup script.templates
: directory containing templates use by setup and import scripts.kubeconfigs
: directory containing the kubeconfigs for the managedcluster
Before running demo script run generic-import-hub-setup.sh against
the hub
generic-import-hub-setup.sh
perform the following setup:
- create
generic-import
namespace - setup
generic-import
serviceaccount with permission - generate
configs/bootstrap-kubeconfig.yaml
- (optional) extract image pull-secret from hub
Place kubeconfig files in the kubeconfigs
directory, kubeconfig file name will be use for the ManagedCluster name
./demo
./demo-cleanup.sh
./generic-import-hub-cleanup.sh