Last active
December 25, 2022 04:57
-
-
Save vfarcic/ebe4ad31d756b009b2e6544218c712e4 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/ebe4ad31d756b009b2e6544218c712e4 | |
#################### | |
# 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 ../../.. | |
####################### | |
# 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