Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Created October 7, 2020 23:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vfarcic/d5c93afc83535f0b5fec93bd03e447f4 to your computer and use it in GitHub Desktop.
Save vfarcic/d5c93afc83535f0b5fec93bd03e447f4 to your computer and use it in GitHub Desktop.
# Source: https://gist.github.com/d5c93afc83535f0b5fec93bd03e447f4
####################
# Create a Cluster #
####################
# Only if you did not yet clone that repository
git clone \
https://github.com/vfarcic/devops-catalog-code.git
cd devops-catalog-code
git pull
cd terraform-gke/simple
# Only if you are not already logged in
gcloud auth application-default login
gcloud container get-server-config \
--region us-east1
# Replace `[...]` with a valid master version from the previous output.
# It must be at least 1.16 or newer (e.g., 1.16.13-gke.1).
export K8S_VERSION=[...]
terraform init
terraform apply \
--var k8s_version=$K8S_VERSION
export KUBECONFIG=$PWD/kubeconfig
kubectl get nodes
cd ../../..
#################
# Install Istio #
#################
istioctl install --skip-confirmation
export ISTIO_HOST=$(kubectl \
--namespace istio-system \
get svc istio-ingressgateway \
--output jsonpath="{.status.loadBalancer.ingress[0].ip}")
echo $ISTIO_HOST
# Repeat the `export` commands if the output is empty
#######################
# Destroy The Cluster #
#######################
cd devops-catalog-code/terraform-gke/simple
terraform destroy \
--var k8s_version=$K8S_VERSION
cd ../../..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment