update
This commit is contained in:
@@ -3,61 +3,53 @@ locals {
|
|||||||
prd = {
|
prd = {
|
||||||
dnsserver = "192.168.11.1"
|
dnsserver = "192.168.11.1"
|
||||||
tags = "k3s_prd"
|
tags = "k3s_prd"
|
||||||
|
vlan = 11
|
||||||
k3master = {
|
k3master = {
|
||||||
count = 1
|
count = 1
|
||||||
name = ["master-prd"]
|
name = ["master-prd"]
|
||||||
cores = 4
|
cores = 4
|
||||||
memory = "4096"
|
memory = "4096"
|
||||||
drive = "20G"
|
drive = "20G"
|
||||||
storage = "cache-domains"
|
node = ["overlord"]
|
||||||
template = ["Debian12-Template"]
|
ip = ["10"]
|
||||||
node = ["overlord"]
|
|
||||||
ip = ["10"]
|
|
||||||
vlan = 11
|
|
||||||
}
|
}
|
||||||
k3server = {
|
k3server = {
|
||||||
count = 2
|
count = 2
|
||||||
name = ["node01-prd", "node02-prd"]
|
name = ["node01-prd", "node02-prd"]
|
||||||
cores = 4
|
cores = 4
|
||||||
memory = "4096"
|
memory = "4096"
|
||||||
drive = "80G"
|
drive = "80G"
|
||||||
storage = "cache-domains"
|
node = ["mothership", "mothership"]
|
||||||
template = ["Debian12-Template", "Debian12-Template"]
|
ip = ["20", "21"]
|
||||||
node = ["mothership", "mothership"]
|
|
||||||
ip = ["20", "21"]
|
|
||||||
vlan = 11
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
dev = {
|
dev = {
|
||||||
dnsserver = "192.168.10.1"
|
dnsserver = "192.168.10.1"
|
||||||
tags = "k3s_dev"
|
tags = "k3s_dev"
|
||||||
|
vlan = 10
|
||||||
k3master = {
|
k3master = {
|
||||||
count = 1
|
count = 1
|
||||||
name = ["master-dev"]
|
name = ["master-dev"]
|
||||||
cores = 4
|
cores = 4
|
||||||
memory = "4096"
|
memory = "4096"
|
||||||
drive = "20G"
|
drive = "20G"
|
||||||
storage = "cache-domains"
|
node = ["overlord"]
|
||||||
template = ["Debian12-Template"]
|
ip = ["10"]
|
||||||
node = ["overlord"]
|
|
||||||
ip = ["10"]
|
|
||||||
vlan = 10
|
|
||||||
}
|
}
|
||||||
k3server = {
|
k3server = {
|
||||||
count = 2
|
count = 2
|
||||||
name = ["node01-dev", "node02-dev"]
|
name = ["node01-dev", "node02-dev"]
|
||||||
cores = 4
|
cores = 4
|
||||||
memory = "4096"
|
memory = "4096"
|
||||||
drive = "60G"
|
drive = "60G"
|
||||||
storage = "cache-domains"
|
node = ["mothership", "mothership"]
|
||||||
template = ["Debian12-Template", "Debian12-Template"]
|
ip = ["20", "21"]
|
||||||
node = ["mothership", "mothership"]
|
|
||||||
ip = ["20", "21"]
|
|
||||||
vlan = 10
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
default = {
|
default = {
|
||||||
sshkeys = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL88nWIyxN4aYTJCxz2/MiorLeNtoVwir995tOXzdzCr laptop"
|
sshkeys = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIL88nWIyxN4aYTJCxz2/MiorLeNtoVwir995tOXzdzCr laptop"
|
||||||
|
template = "Debian12-Template"
|
||||||
|
storage = "cache-domains"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,7 +60,7 @@ resource "proxmox_vm_qemu" "k3master" {
|
|||||||
vmid = "${local.config.k3master.vlan}${local.config.k3master.ip[count.index]}"
|
vmid = "${local.config.k3master.vlan}${local.config.k3master.ip[count.index]}"
|
||||||
name = local.config.k3master.name[count.index]
|
name = local.config.k3master.name[count.index]
|
||||||
target_node = local.config.k3master.node[count.index]
|
target_node = local.config.k3master.node[count.index]
|
||||||
clone = local.config.k3master.template[count.index]
|
clone = local.config.template
|
||||||
tags = local.config.tags
|
tags = local.config.tags
|
||||||
qemu_os = "l26"
|
qemu_os = "l26"
|
||||||
full_clone = true
|
full_clone = true
|
||||||
@@ -89,7 +81,7 @@ resource "proxmox_vm_qemu" "k3master" {
|
|||||||
ide {
|
ide {
|
||||||
ide2 {
|
ide2 {
|
||||||
cloudinit {
|
cloudinit {
|
||||||
storage = local.config.k3master.storage
|
storage = local.config.storage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,7 +90,7 @@ resource "proxmox_vm_qemu" "k3master" {
|
|||||||
disk {
|
disk {
|
||||||
size = local.config.k3master.drive
|
size = local.config.k3master.drive
|
||||||
format = "raw"
|
format = "raw"
|
||||||
storage = local.config.k3master.storage
|
storage = local.config.storage
|
||||||
emulatessd = true
|
emulatessd = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -115,7 +107,7 @@ resource "proxmox_vm_qemu" "k3master" {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
#Cloud Init Settings
|
#Cloud Init Settings
|
||||||
ipconfig0 = "ip=192.168.${local.config.k3master.vlan}.${local.config.k3master.ip[count.index]}/24,gw=192.168.10.1"
|
ipconfig0 = "ip=192.168.${local.config.vlan}.${local.config.k3master.ip[count.index]}/24,gw=${local.dnsserver}"
|
||||||
searchdomain = "durp.loc"
|
searchdomain = "durp.loc"
|
||||||
nameserver = local.config.dnsserver
|
nameserver = local.config.dnsserver
|
||||||
}
|
}
|
||||||
@@ -126,7 +118,7 @@ resource "proxmox_vm_qemu" "k3server" {
|
|||||||
vmid = "${local.config.k3server.vlan}${local.config.k3server.ip[count.index]}"
|
vmid = "${local.config.k3server.vlan}${local.config.k3server.ip[count.index]}"
|
||||||
name = local.config.k3server.name[count.index]
|
name = local.config.k3server.name[count.index]
|
||||||
target_node = local.config.k3server.node[count.index]
|
target_node = local.config.k3server.node[count.index]
|
||||||
clone = local.config.k3server.template[count.index]
|
clone = local.config.template
|
||||||
tags = local.config.tags
|
tags = local.config.tags
|
||||||
qemu_os = "l26"
|
qemu_os = "l26"
|
||||||
full_clone = true
|
full_clone = true
|
||||||
@@ -147,7 +139,7 @@ resource "proxmox_vm_qemu" "k3server" {
|
|||||||
ide {
|
ide {
|
||||||
ide2 {
|
ide2 {
|
||||||
cloudinit {
|
cloudinit {
|
||||||
storage = local.config.k3master.storage
|
storage = local.config.storage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -156,7 +148,7 @@ resource "proxmox_vm_qemu" "k3server" {
|
|||||||
disk {
|
disk {
|
||||||
size = local.config.k3master.drive
|
size = local.config.k3master.drive
|
||||||
format = "raw"
|
format = "raw"
|
||||||
storage = local.config.k3master.storage
|
storage = local.config.storage
|
||||||
emulatessd = true
|
emulatessd = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -172,7 +164,7 @@ resource "proxmox_vm_qemu" "k3server" {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
#Cloud Init Settings
|
#Cloud Init Settings
|
||||||
ipconfig0 = "ip=192.168.${local.config.k3server.vlan}.${local.config.k3server.ip[count.index]}/24,gw=192.168.10.1"
|
ipconfig0 = "ip=192.168.${local.config.vlan}.${local.config.k3server.ip[count.index]}/24,gw=${local.config.dnsserver}"
|
||||||
searchdomain = "durp.loc"
|
searchdomain = "durp.loc"
|
||||||
nameserver = local.config.dnsserver
|
nameserver = local.config.dnsserver
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user