This repository is a rapid-fire version of our in-depth tutorial for Terraforming Kubernetes on Linode with this post.
To get started:
git clone https://github.com/codingforentrepreneurs/terraforming-kubernetes-rapid
cd terraforming-kubernetes-rapid
Create an account on Linode and get an API Key in your linode account here.
Once you have a key, do the following:
echo "linode_api_token=\"YOUR_API_KEY\"" >> terraform.tfvars
terraform init
terraform apply
Use
terraform apply -auto-approve
if you're really in a hurry.
export KUBECONFIG="./.kube/kubeconfig.yaml"
If you are using VSCode, the
KUBECONFIG
variable is set intf-k8s.code-workspace
settings.
Verify your KUBECONFIG
is set correctly:
kubectl get nodes
kubectl apply -f k8s.yaml
kubectl get service cfe-nginx-service -o "jsonpath={.status.loadBalancer.ingress[0].ip}"
Or
export IP_ADDRESS=$(kubectl get service cfe-nginx-service -o "jsonpath={.status.loadBalancer.ingress[0].ip}")
open http://$IP_ADDRESS
P.S. Destroy everything with terraform apply -destroy -auto-approve
to avoid incurring any charges.