adding kub test

This commit is contained in:
Matt Reeves 2024-06-13 23:34:21 -04:00
parent 8b5c0c6d3b
commit 3c63705cf5
3 changed files with 192 additions and 0 deletions

64
k3s-master.tf Normal file
View file

@ -0,0 +1,64 @@
resource "proxmox_virtual_environment_vm" "K3s-Master" {
# VM General Settings
node_name = "prox"
vm_id = 300
name = "K3s-Master"
description = "Kubernetes master"
tags = ["tofu", "ubuntu-22", "auto-homelab-repo", "infrastructure"]
agent {
enabled = false # read 'Qemu guest agent' section, change to true only when ready
}
clone {
vm_id = 8000
}
# VM CPU Settings
cpu {
cores = 4
type = "host"
}
# VM Memory Settings
memory {
dedicated = 4096
}
# VM Network Settings
network_device {
bridge = "vmbr0"
vlan_id = 1
}
# VM Disk Settings
disk {
datastore_id = "Fast2Tb"
size = 100
interface = "scsi0"
}
vga {
type = "serial0"
}
initialization {
ip_config {
ipv4 {
address = "dhcp"
}
}
user_account {}
}
lifecycle {
ignore_changes = [
initialization[0].user_account[0].keys,
initialization[0].user_account[0].password,
initialization[0].user_account[0].username,
]
}
}

64
k3s-worker1.tf Normal file
View file

@ -0,0 +1,64 @@
resource "proxmox_virtual_environment_vm" "K3s-Worker1" {
# VM General Settings
node_name = "prox"
vm_id = 310
name = "K3s-Worker1"
description = "Kubernetes worker"
tags = ["tofu", "ubuntu-22", "auto-homelab-repo", "infrastructure"]
agent {
enabled = false # read 'Qemu guest agent' section, change to true only when ready
}
clone {
vm_id = 8000
}
# VM CPU Settings
cpu {
cores = 4
type = "host"
}
# VM Memory Settings
memory {
dedicated = 4096
}
# VM Network Settings
network_device {
bridge = "vmbr0"
vlan_id = 1
}
# VM Disk Settings
disk {
datastore_id = "Fast2Tb"
size = 100
interface = "scsi0"
}
vga {
type = "serial0"
}
initialization {
ip_config {
ipv4 {
address = "dhcp"
}
}
user_account {}
}
lifecycle {
ignore_changes = [
initialization[0].user_account[0].keys,
initialization[0].user_account[0].password,
initialization[0].user_account[0].username,
]
}
}

64
k3s-worker2.tf Normal file
View file

@ -0,0 +1,64 @@
resource "proxmox_virtual_environment_vm" "K3s-Worker2" {
# VM General Settings
node_name = "prox"
vm_id = 320
name = "K3s-Worker2"
description = "Kubernetes worker"
tags = ["tofu", "ubuntu-22", "auto-homelab-repo", "infrastructure"]
agent {
enabled = false # read 'Qemu guest agent' section, change to true only when ready
}
clone {
vm_id = 8000
}
# VM CPU Settings
cpu {
cores = 4
type = "host"
}
# VM Memory Settings
memory {
dedicated = 4096
}
# VM Network Settings
network_device {
bridge = "vmbr0"
vlan_id = 1
}
# VM Disk Settings
disk {
datastore_id = "Fast2Tb"
size = 100
interface = "scsi0"
}
vga {
type = "serial0"
}
initialization {
ip_config {
ipv4 {
address = "dhcp"
}
}
user_account {}
}
lifecycle {
ignore_changes = [
initialization[0].user_account[0].keys,
initialization[0].user_account[0].password,
initialization[0].user_account[0].username,
]
}
}