Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Anthos GKE on AWS (cluster)
#!/usr/bin/env bash
# https://cloud.google.com/anthos/gke/docs/aws/how-to/creating-user-cluster
# from setup-02-mgmt.sh
unset HTTP_PROXY # reset
export NODE_KEY_PATH=$(PWD)/node-key.json
export GOOGLE_APPLICATION_CREDENTIALS=$NODE_KEY_PATH
# create example user cluster config
terraform output cluster_example > cluster-0.yaml
# make sure bastion_tunnel.sh is running
./bastion-tunnel.sh -N &
# set HTTP_PROXY env var (for kubectl operations)
export HTTP_PROXY=http://localhost:8118 # you will have to unset this if running TF
# create first cluster from manifest generated above
kubectl apply -f cluster-0.yaml
sleep 600 # give time for cluster to reconcile
# create kubeconfig for new cluster (make sure bastion_tunnel.sh and HTTP_PROXY var set)
anthos-gke aws clusters get-credentials cluster-0
# get cluster-0 info and test kubeconfig
kubectl cluster-info
#################################################################
# OPTIONALLY VIEW CLUSTER STATUS (SWITCH BACK TO MGMT)
#
# anthos-gke aws management get-credentials
# kubectl get AWSClusters
#################################################################
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment