Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to modify this to span across 2 or more proxmox nodes #4

Open
alex-w-k opened this issue Apr 6, 2024 · 4 comments
Open

how to modify this to span across 2 or more proxmox nodes #4

alex-w-k opened this issue Apr 6, 2024 · 4 comments

Comments

@alex-w-k
Copy link

alex-w-k commented Apr 6, 2024

hello, great repo and info here, but my question is what is the best way to have a kube cluster that spans 2 proxmox nodes, i would like to be able to have some resiliency and span both of my nodes

@kubebn
Copy link
Owner

kubebn commented Apr 6, 2024

Hi, do you mean 2 proxmox hosts for mngmt cluster and sidero clusters? In that case, you would just need to add additional variables for target_node and proxmox_hosts.

@alex-w-k
Copy link
Author

alex-w-k commented Apr 6, 2024

i would like two proxmox hosts but the same cluster, so it would look like:
node 1: 3 mgmt nodes, 3 worker nodes
node 2: 3 mgmt nodes, 3 worker nodes

@lucacalcaterra
Copy link

i would like two proxmox hosts but the same cluster, so it would look like: node 1: 3 mgmt nodes, 3 worker nodes node 2: 3 mgmt nodes, 3 worker nodes

@alex-w-k I would like to achieve same goals .. not sure if going right direction but seems i need to use SDN , EVPN with VXLAN.. my configuration it's quite crazy and cheap, on hetzner. Depend which network infrastructure you have..

@rdeberry-sms
Copy link

rdeberry-sms commented Apr 17, 2024

Here is an example of how to do it

`resource "proxmox_vm_qemu" "controlplanes" {
for_each = var.control_plane_nodes
name = each.value.name
target_node = each.value.target_node
clone = each.value.os_type
vmid = random_integer.control_hosts[each.key].result
agent = var.agent
os_type = var.os_type
ipconfig0 = "ip=${each.value.ip1_address}/${each.value.ip1_netmask},gw=${each.value.gw}"
ipconfig1 = can(each.value["ip2_address"]) ? "ip=${each.value.ip2_address}/${each.value.ip2_netmask}" : null
cloudinit_cdrom_storage = var.storage_name
vm_state = var.vm_state
onboot = var.onboot
cpu = var.cpu
sockets = each.value.sockets
cores = each.value.cores
memory = each.value.memory
scsihw = var.scsihw
tags = var.cp_tags

network {
model = var.virtual_interface
bridge = var.network_bridge
tag = var.primary_vlan
}
dynamic "network" {
for_each = can(each.value["ip2_address"]) ? [1] : []
content {
model = var.virtual_interface
bridge = var.network_bridge
tag = var.secondary_vlan
}
}
nameserver = var.dns_server

boot = var.boot_order
disks {
scsi {
scsi0 {
disk {

      size    = each.value.disk_size
      storage = var.storage_name
    }
  }
  dynamic "scsi1" {
    for_each = can(each.value["second_disk_size"]) ? [1] : []
    content {
      disk {
        size    = each.value.second_disk_size
        storage = var.storage_name
      }
    }
  }
}

}

lifecycle {
ignore_changes = [
boot,
network,
desc,
numa,
agent,
ipconfig0,
ipconfig1,
define_connection_info,
]
}
}

resource "random_integer" "control_hosts" {
for_each = var.control_plane_nodes
max = var.random_integer_ceiling_master
min = var.random_integer_floor_master
}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants