mirror of
https://github.com/0x1d/terraform-proxmox-talos.git
synced 2025-12-16 06:34:32 +01:00
add examples
This commit is contained in:
49
README.md
49
README.md
@@ -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 |
|
||||
|
||||
Reference in New Issue
Block a user