feat(k8s): multi-node Talos cluster

This commit is contained in:
Vegard Hagen
2024-05-23 18:21:38 +02:00
parent 854b6ce6a2
commit fbdccd7731
35 changed files with 1018 additions and 16 deletions

View File

@@ -0,0 +1,11 @@
resource "proxmox_virtual_environment_file" "haos_generic_image" {
provider = proxmox.euclid
node_name = var.euclid.node_name
content_type = "iso"
datastore_id = "local"
source_file {
path = "images/haos_ova-12.3.qcow2"
file_name = "haos_ova-12.3.img"
}
}

View File

@@ -0,0 +1,2 @@
wget https://github.com/home-assistant/operating-system/releases/download/12.3/haos_ova-12.3.qcow2.xz
xz -d haos_ova-12.3.qcow2.xz

View File

@@ -0,0 +1,9 @@
terraform {
required_providers {
proxmox = {
source = "bpg/proxmox"
version = ">= 0.57.0"
}
}
}

View File

@@ -0,0 +1 @@
../machines/euclid.tf

View File

@@ -0,0 +1,57 @@
resource "proxmox_virtual_environment_vm" "home_assistant" {
provider = proxmox.euclid
node_name = var.euclid.node_name
name = "Home-Assistant"
description = "Managed by OpenTofu"
tags = ["home-assistant"]
on_boot = true
bios = "ovmf"
scsi_hardware = "virtio-scsi-single"
vm_id = 1000
tablet_device = false
cpu {
cores = 2
type = "host"
}
memory {
dedicated = 4096
}
network_device {
bridge = "vmbr0"
mac_address = "BC:24:11:50:A6:33"
}
agent {
enabled = true
}
efi_disk {
datastore_id = "local-zfs"
file_format = "raw" // To support qcow2 format
type = "4m"
}
disk {
datastore_id = "local-zfs"
file_id = proxmox_virtual_environment_file.haos_generic_image.id
interface = "scsi0"
cache = "writethrough"
discard = "on"
ssd = true
size = 64
}
operating_system {
type = "l26" # Linux Kernel 2.6 - 5.X.
}
lifecycle {
prevent_destroy = true
}
}