Deploys a Kubernetes cluster across multiple cloud providers AWS, Azure, GKE and a local KinD cluster.
- Install Pulumi.
- Install Node.js.
- Install a package manager for Node.js, such as NPM or Yarn.
- Configure AWS Credentials.
- Install AWS IAM Authenticator for Kubernetes.
- Install
kubectl
. - Install a KinD cluster (optional)
-
Clone the repo:
git clone https://github.com/metral/multicloud-clusters cd multicloud-clusters
-
Install the dependencies.
npm install
-
Create a new Pulumi stack named
dev
.pulumi stack init dev
-
Export the KinD kubeconfig to create the
localProvider
for it around itskubeconfig
export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
-
Set the Pulumi configuration variables for the project.
Note: Select any valid Kubernetes regions for the providers.
pulumi config set aws:region us-west-2 pulumi config set azure:location westus2 pulumi config set gcp:zone us-west1-a pulumi config set gcp:project pulumi-development pulumi config set accountIdRoot arn:aws:iam::<AWS_ACCOUNT_ID>:root (optional - only needed for EKS dev role and group demo)
Create the cluster and deploy the workload by running an update:
pulumi up
The update takes ~15 minutes.
Once the update is complete, verify the cluster, node groups, and Pods are up and running:
pulumi stack output aksKubeconfig > kubeconfig-aks.json
pulumi stack output eksKubeconfig > kubeconfig-eks.json
pulumi stack output --show-secrets gkeKubeconfig > kubeconfig-gke.json
pulumi stack output localKubeconfig > kubeconfig-kind.json
<Choose a kubeconfig, then>
kubectl get nodes -o wide --show-labels
kubectl get pods --all-namespaces -o wide --show-labels
Run the following command to tear down the resources that are part of our stack.
-
Run
pulumi destroy
to tear down all resources. You'll be prompted to make sure you really want to delete these resources.pulumi destroy
-
To delete the stack, run the following command.
pulumi stack rm
Note: This command deletes all deployment history from the Pulumi Console and cannot be undone.