add examples

This commit is contained in:
0x1d
2025-02-23 15:06:15 +01:00
parent 50b60fb4d1
commit 2fd0ce23bf
5 changed files with 241 additions and 3 deletions

View File

@@ -4,7 +4,7 @@ This Terraform module provisions a [Talos Linux](https://www.talos.dev/) cluster
It is is based on a greate article by [Olav S. Thoresen: Talos cluster on Proxmox with Terraform](https://olav.ninja/talos-cluster-on-proxmox-with-terraform).
In addition to the configuration provided by the article, this module enables you to provision a HA control plane and any number of worker nodes.
## Setup
## Configuration
Configure `.env`:
```shell
@@ -13,16 +13,59 @@ export PROXMOX_VE_PASSWORD="super-secure-password"
export PROXMOX_VE_ENDPOINT="https://<proxmox-ip>:8006/"
```
Apply configuration:
Configure module (no-ha example):
```hcl
module "talos_cluster" {
source = "../../"
cluster_name = "homelab"
talos_version = "1.9.4"
default_gateway = "192.168.1.1"
proxmox_nodes = ["ms-01"]
talos_controlplane_config = [{
id = 101
name = "talos-cp-01"
ip = "192.168.1.181"
node = "ms-01"
cpu_cores = 2
memory = 2048
disk_size = 20
}]
talos_worker_config = [{
id = 111
name = "talos-worker-01"
ip = "192.168.1.191"
node = "ms-01"
cpu_cores = 4
memory = 4096
disk_size = 100
}]
}
output "kubeconfig" {
value = module.talos_cluster.kubeconfig
sensitive = true
}
```
## Provisioning
Apply configuration:
```shell
source .env
terraform init
terraform apply
```
Write Kubeconfig (caution, this will override you existing Kubeconfig):
```
```shell
terraform output -raw kubeconfig > ~/.kube/config
```
Verify:
```shell
kubectl get nodes
```
## Requirements
| Name | Version |