diff --git a/proxmox/credentials.auto.tfvars.example b/proxmox/credentials.auto.tfvars.example index c17518d..7660228 100644 --- a/proxmox/credentials.auto.tfvars.example +++ b/proxmox/credentials.auto.tfvars.example @@ -6,6 +6,8 @@ proxmox_target_node = "your proxmox node" proxmox_storage_device = "samsung-ssd" # Talos Linux +# Talos version needs to correspond to the install_image version in node_data +# See: https://github.com/siderolabs/terraform-provider-talos/blob/main/docs/data-sources/machine_configuration.md talos_version = "1.11.1" # With these variables you can configure the ISO images which are uploaded to Proxmox for initially booting the VMs talos_linux_iso_image_url = "https://factory.talos.dev/image/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515/v1.11.1/nocloud-amd64.iso" diff --git a/proxmox/talos_linux.tf b/proxmox/talos_linux.tf index 37809ab..b557741 100644 --- a/proxmox/talos_linux.tf +++ b/proxmox/talos_linux.tf @@ -70,4 +70,5 @@ resource "talos_cluster_kubeconfig" "this" { depends_on = [talos_machine_bootstrap.this] client_configuration = talos_machine_secrets.this.client_configuration node = [for k, v in var.node_data.controlplanes : k][0] + endpoint = var.cluster_vip_shared_ip } \ No newline at end of file diff --git a/proxmox/variables.tf b/proxmox/variables.tf index b9832e5..495729c 100644 --- a/proxmox/variables.tf +++ b/proxmox/variables.tf @@ -40,6 +40,7 @@ variable "talos_linux_iso_image_filename" { variable "cluster_name" { description = "A name to provide for the Talos cluster" type = string + default = "talos" } variable "cluster_vip_shared_ip" { @@ -81,16 +82,19 @@ variable "node_data" { variable "network" { description = "Network for all nodes" type = string + default = "192.168.10.0/24" } variable "network_gateway" { description = "Network gateway for all nodes" type = string + default = "192.168.10.1" } variable "domain_name_server" { description = "DNS for all nodes" type = string + default = "192.168.10.1" } variable "vlan_tag" { diff --git a/proxmox/virtual_machines.tf b/proxmox/virtual_machines.tf index 0d860d3..06793f5 100644 --- a/proxmox/virtual_machines.tf +++ b/proxmox/virtual_machines.tf @@ -1,7 +1,7 @@ resource "proxmox_vm_qemu" "kubernetes_control_plane" { depends_on = [proxmox_storage_iso.talos_linux_iso_image] for_each = var.node_data.controlplanes - name = format("kubernetes-control-plane-%s", index(keys(var.node_data.controlplanes), each.key)) + name = format("%s-kubernetes-control-plane-%s", var.cluster_name, index(keys(var.node_data.controlplanes), each.key)) description = "Kubernetes Control Plane" target_node = var.proxmox_target_node agent = 1 @@ -33,7 +33,7 @@ resource "proxmox_vm_qemu" "kubernetes_control_plane" { slot = "virtio0" type = "disk" storage = var.proxmox_storage_device - size = "10240M" + size = "50G" discard = true } @@ -53,7 +53,7 @@ resource "proxmox_vm_qemu" "kubernetes_control_plane" { resource "proxmox_vm_qemu" "kubernetes_worker" { depends_on = [proxmox_storage_iso.talos_linux_iso_image] for_each = var.node_data.workers - name = format("kubernetes-worker-%s", index(keys(var.node_data.workers), each.key)) + name = format("%s-kubernetes-worker-%s", var.cluster_name, index(keys(var.node_data.workers), each.key)) description = "Kubernetes Worker Node" target_node = var.proxmox_target_node agent = 1 @@ -85,7 +85,7 @@ resource "proxmox_vm_qemu" "kubernetes_worker" { slot = "virtio0" type = "disk" storage = var.proxmox_storage_device - size = "10240M" + size = "50G" discard = true }