Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Last active December 25, 2022 04:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save vfarcic/ebe4ad31d756b009b2e6544218c712e4 to your computer and use it in GitHub Desktop.
Save vfarcic/ebe4ad31d756b009b2e6544218c712e4 to your computer and use it in GitHub Desktop.
# 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