k3s: debian vm and manifest
This commit is contained in:
66
tofu/k3s.tf
Normal file
66
tofu/k3s.tf
Normal file
@@ -0,0 +1,66 @@
|
||||
resource "proxmox_virtual_environment_download_file" "latest_debian_13_trixie_qcow2_img" {
|
||||
content_type = "import"
|
||||
datastore_id = "local"
|
||||
node_name = var.node_name
|
||||
url = "https://cloud.debian.org/images/cloud/trixie/latest/debian-13-genericcloud-amd64.qcow2"
|
||||
}
|
||||
|
||||
resource "proxmox_virtual_environment_vm" "debian_13_vm_for_k3s" {
|
||||
name = "k3s"
|
||||
description = "Debian 13 vm for k3s"
|
||||
tags = ["opentofu", "debian"]
|
||||
|
||||
node_name = var.node_name
|
||||
vm_id = var.k3s_id
|
||||
|
||||
agent {
|
||||
enabled = false
|
||||
}
|
||||
stop_on_destroy = true
|
||||
|
||||
startup {
|
||||
order = "3"
|
||||
up_delay = "60"
|
||||
down_delay = "60"
|
||||
}
|
||||
|
||||
cpu {
|
||||
cores = 2
|
||||
type = "host"
|
||||
}
|
||||
|
||||
memory {
|
||||
dedicated = 4096
|
||||
floating = 4096
|
||||
}
|
||||
|
||||
disk {
|
||||
datastore_id = "local-lvm"
|
||||
import_from = proxmox_virtual_environment_download_file.latest_debian_13_trixie_qcow2_img.id
|
||||
interface = "scsi0"
|
||||
size = 20
|
||||
}
|
||||
|
||||
initialization {
|
||||
ip_config {
|
||||
ipv4 {
|
||||
address = var.k3s_ip
|
||||
gateway = var.gateway
|
||||
}
|
||||
}
|
||||
|
||||
user_account {
|
||||
keys = [trimspace(file(var.ssh_public_key_path))]
|
||||
password = var.k3s_password
|
||||
username = "debian"
|
||||
}
|
||||
}
|
||||
|
||||
network_device {
|
||||
bridge = "vmbr0"
|
||||
}
|
||||
|
||||
operating_system {
|
||||
type = "l26"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user