Skip to content

Instantly share code, notes, and snippets.

@vfarcic

vfarcic/61-linode.sh

Last active Feb 14, 2021
Embed
What would you like to do?
# 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