Example of running portainer-k8s on civo-k3s using pure terraform
Prerequisites
Steps:
-
Clone repo:
git clone git@github.com:jhole89/terraform-k8s-example.git
-
Change to this directory:
cd civo-portainer-k3s
-
Initialise terraform:
terraform init
-
Copy tfvars template:
cp terraform.tfvars.template terraform.tfvars
-
Fill in
terraform.tfvars
with your Civo API key (found athttps://www.civo.com/account/security
) -
Apply terraform plan:
terraform apply --auto-approve
- you should see the following outputmodule.cluster.civo_kubernetes_cluster.k3s: Creating... ... ... ... Apply complete! Resources: 6 added, 0 changed, 0 destroyed.
-
Log into your Civo account and grab the dns name:
Portainer will be published on port 9000:
Create the admin user and connect to the civo kubernetes cluster:
You can now use portainer to deploy kubernetes applications into civo-k3s:
-
Once no longer required you can remove all resources:
terraform destroy --auto-approve