kubeCDN: Deploy Clusters
March 4, 2019 ยท View on GitHub
Follow instructions below to setup clusters in multiple regions.
Please note that by default this repo sets up clustesr in the us-west-2 and us-east-1 AWS regions. This can changed or extended by editing the main.tf file located in this directory before proceeding to the instructions below.
Instructions
- Make sure you are in the
terraformrepo - Run:
terraform init - Create a file named
terraform.tfvarsand insert the following. Read more about AWS Keypairs here
keypair_name="<enter-your-aws-keypair-name-here-without-extensions>"
- Run:
terraform apply -auto-approve. This process takes about 15 minutes to setup two regions. - After the terraform process above has completed, run
./setup.sh. This script performs the following tasks:
- Generates
kubedconfigfiles for each deployment region.kubeconfigfiles are used to connect to different clusters for service deployments and other tasks. - Generates and applies config map to each cluster.
- Install Kubernetes dashboard.
- Install
helm - Install heapster using
helmto enable graphs in Kubernetes Dashboard
After running the steps above, your current directory should contain *-kubeconfig files for each region. These files will be used by other scripts and components of the kubeCDN project for various setup and deployment procedures. Do not delete these files or move them to a different location. Doing so will prevent you from running subsequent instructions successfully.
Connect to Kubernetes Dashboard
Following are instructions to connect to the Kubernetes Dashboard (installed in steps shown above):
- Set your
KUBECONFIGenvironment variable to point to thekubeconfigfile of the cluster you would like to connect to (kubeconfigfiles are generated in step 5 of the instructions section). For example, if you are in theterraform/directory and you would like to connect to the cluster deployed to the west coast:
export KUBECONFIG=$(PWD)/west-kubeconfig
- Generate and copy dashboard access code to your clipboard (example below is specific to macOS, Linux systems should use
xclipinstead ofpbcopy):
aws-iam-authenticator token -i <ENTER-YOUR-CLUSTER-NAME> --token-only | pbcopy
- Set up proxy connection to cluster. Note that this command will run in the foreground.
kubectl proxy
- Navigate to the following URL to view dashboard: http://localhost:8001/api/v1/namespaces/kube-system/services/https:kubernetes-dashboard:/proxy/