Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Last active January 18, 2022 00:16
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/e0c7d7048b881c902a406b574f13a631 to your computer and use it in GitHub Desktop.
Save vfarcic/e0c7d7048b881c902a406b574f13a631 to your computer and use it in GitHub Desktop.
# Source: https://gist.github.com/e0c7d7048b881c902a406b574f13a631
########################################
# Linode #
# The Fastest Cloud Computing Provider #
# https://youtu.be/rAg2o6Bpi9A #
########################################
###########################################
# Create a Kubernetes cluster from the UI #
###########################################
export KUBECONFIG=$PWD/kubeconfig.yaml
# Create kubeconfig.yaml and paste the config retrieved from Linode Web UI
kubectl get nodes
###############################################
# Create a Kubernetes cluster using Terraform #
###############################################
git clone https://github.com/vfarcic/devops-catalog-code.git
cd devops-catalog-code/terraform-lke/simple
terraform init
cat main.tf
# Open https://cloud.linode.com/profile/tokens, create a *Personal Access Token*, and replace `[...]` in the command that follows with it
export TF_VAR_token=[...]
# NOTE: k8s_version 1.18 might not be available any more
export TF_VAR_k8s_version=1.18
terraform apply
export KUBECONFIG=$PWD/kubeconfig
kubectl get nodes
#######################################
# Upgrade the cluster using Terraform #
#######################################
export TF_VAR_k8s_version=1.19
terraform apply
#######################################
# Destroy the cluster using Terraform #
#######################################
terraform destroy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment