Last active
January 18, 2022 00:16
-
-
Save vfarcic/81bef768d6cdd0ac85e8bd862f1f8ea6 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/81bef768d6cdd0ac85e8bd862f1f8ea6 | |
#################### | |
# 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-lke/simple | |
# 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.19 might not be available any more | |
export TF_VAR_k8s_version=1.19 | |
terraform init | |
terraform apply \ | |
--var ingress_nginx=true | |
export KUBECONFIG=$PWD/kubeconfig | |
kubectl get nodes | |
cd ../../.. | |
###################### | |
# Ingress Controller # | |
###################### | |
export INGRESS_HOSTNAME=$(kubectl \ | |
--namespace ingress-nginx \ | |
get svc ingress-nginx-controller \ | |
--output jsonpath="{.status.loadBalancer.ingress[0].hostname}") | |
export INGRESS_HOST=$(\ | |
dig +short $INGRESS_HOSTNAME) | |
echo $INGRESS_HOST | |
# Repeat the `export` commands if the output is empty | |
####################### | |
# Destroy The Cluster # | |
####################### | |
cd devops-catalog-code/terraform-lke/simple | |
terraform destroy | |
cd ../../../ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment