mirror of
https://github.com/wahyd4/home-docker.git
synced 2026-08-09 04:15:52 +10:00
845 B
845 B
K3s Cluster Setup with Terraform
This Terraform configuration sets up a k3s cluster on an existing virtual machine.
Prerequisites
- Terraform installed on your local machine
- SSH access to the target machine
- SSH private key configured
Usage
- Initialize Terraform:
terraform init
- Apply the configuration:
terraform apply
- To destroy the cluster:
terraform destroy
Configuration
The main configuration is in main.tf. It uses the SSH provider to:
- Install k3s on the target machine
- Retrieve the node token
- Verify the node is running
Important Notes
- Make sure your SSH private key has the correct permissions (600)
- The k3s token will be output after successful installation
- You can access the cluster using
kubectlafter copying the kubeconfig from the server