This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
This repository contains Terraform configurations for setting up a Kubernetes cluster on Civo's K3s platform. It enables you to spin up a simple k3s cluster in the Civo cloud. It is great for courses such as Nigel Poulton's "Quick Start Kubernetes". If you don't have a copy of the book, you can purchase one from Leanpub. I highly recommend it!
The repository consists of three main Terraform files:
main.tf
: This file contains the main resources for the Kubernetes cluster.provider.tf
: This file sets up the Civo provider for Terraform.variables.tf
: This file contains the variables used in the Terraform configurations. You can modify the values in this file to suit your needs.
- Terraform: You will need Terraform installed on your local machine to use these configurations.
- An active API Key in your Civo Cloud.
- There are numerous ways to configure authentication for the Civo Terraform Provider for this lab environment, but I simply store the API key in a variable e.g.
export CIVO_TOKEN=<your token>
- Clone this repository.
- Modify the
variables.tf
file as needed. - Run
terraform init
to initialize your Terraform configuration. - Run
terraform apply
to create your Kubernetes cluster.
For more detailed instructions, please refer to the comments in each file.