Created
October 7, 2020 23:06
-
-
Save vfarcic/d5c93afc83535f0b5fec93bd03e447f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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