Merge pull request #9 from max-pfeiffer/bugfix/dns

Fixed host DNS for Talos nodes
This commit is contained in:
Max Pfeiffer
2026-01-04 08:42:09 +01:00
committed by GitHub
7 changed files with 42 additions and 46 deletions

View File

@@ -2,34 +2,18 @@
# Manual edits may be lost in future updates. # Manual edits may be lost in future updates.
provider "registry.opentofu.org/hashicorp/helm" { provider "registry.opentofu.org/hashicorp/helm" {
version = "3.1.0" version = "3.1.1"
constraints = "3.1.0" constraints = "3.1.1"
hashes = [ hashes = [
"h1:vORgIBuTBOxVX2zePdQkvOiiQYjVLIKVS22KmJRDxoU=", "h1:brfn5YltnzexsfqpWKw+5gS9U/m77e0An3hZQamlEZk=",
"zh:06a22880bb89397d0a99a66e887e1e3b80868ff000bceddf1454e8272b17dc2c", "zh:09b38905e234c2e0b185332819614224660050b7e4b25e9e858b593ab01adafe",
"zh:3c50a2b50911a0ff165532b11105b09537402c752c138902882264b58c0ac8be", "zh:09fed1b19b8bcded169fb76304e06c5b1216d5ceba92948c23384f34ddbf1fac",
"zh:516c64e23146d2ed4c033d33064ae79c7e29cd47ec18a71ef2158b009f7d7748", "zh:2e0af220f3fe79048d82f6de91752ba9929c215819d3de4f82ccb473bcd9e5df",
"zh:84aed195b24cc9c32f7e387b1fc40d1f4ac67ab6ab32d84e4eeeca2b0c20b851", "zh:5fe8657cbf6aca769b9565a4fb4605d7b441c2c558d915b067c0adf6f77c58d4",
"zh:b87f6146284dc745b32b9612583ed9ebd9488e932ca2c210afb29a351be2dfec", "zh:713943f797be3a4c6fc6bb5f1306c4f74762bfaa663f98fd8b4c49d28ee54ecf",
"zh:cbba392b7e9ec83299e37999c779f744ef4ca8b4abe0ba19e5feaadf2aee6580", "zh:b426458c0bbad64f9000c11af7e74a24ce9e0adb3037c05dadf80c0c3e757931",
"zh:dd82576699bca89f503b9d1328e0194fb24cf7e99194df98844e8cc127dfc45f", "zh:c0664866280a42156484a48f6c461d0ddb2d212da9b6e930c721ef577ab75270",
"zh:e78fa0476d67623c252672e01b81192c7df07c1416433136f4f82ce451d533ce", "zh:e4f9d0ebb70d63d8ac3ccee00a4d8cdb15b97aaa390f95ed65921e9d0f65bfa0",
"zh:eac219620b2abfe12a4b392f75d90bcb209d9734c8c6f63917f808881ec6ce30", "zh:f6fe7ecfafc344f4e6aecacf5ae12ac73b94389b9679dcd0f04fc5ff45bdc066",
]
}
provider "registry.opentofu.org/hashicorp/kubernetes" {
version = "2.38.0"
hashes = [
"h1:ems+O2dA7atxMWpbtqIrsH7Oa+u+ERWSfpMaFnZPbh0=",
"zh:1096b41c4e5b2ee6c1980916fb9a8579bc1892071396f7a9432be058aabf3cbc",
"zh:2959fde9ae3d1deb5e317df0d7b02ea4977951ee6b9c4beb083c148ca8f3681c",
"zh:5082f98fcb3389c73339365f7df39fc6912bf2bd1a46d5f97778f441a67fd337",
"zh:620fd5d0fbc2d7a24ac6b420a4922e6093020358162a62fa8cbd37b2bac1d22e",
"zh:7f47c2de179bba35d759147c53082cad6c3449d19b0ec0c5a4ca8db5b06393e1",
"zh:89c3aa2a87e29febf100fd21cead34f9a4c0e6e7ae5f383b5cef815c677eb52a",
"zh:96eecc9f94938a0bc35b8a63d2c4a5f972395e44206620db06760b730d0471fc",
"zh:e15567c1095f898af173c281b66bffdc4f3068afdd9f84bb5b5b5521d9f29584",
"zh:ecc6b912629734a9a41a7cf1c4c73fb13b4b510afc9e7b2e0011d290bcd6d77f",
] ]
} }

View File

@@ -2,7 +2,7 @@ terraform {
required_providers { required_providers {
helm = { helm = {
source = "hashicorp/helm" source = "hashicorp/helm"
version = "3.1.0" version = "3.1.1"
} }
} }
} }

View File

@@ -8,11 +8,11 @@ proxmox_storage_device = "samsung-ssd"
# Talos Linux # Talos Linux
# Talos version needs to correspond to the install_image version in node_data # 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 # See: https://github.com/siderolabs/terraform-provider-talos/blob/main/docs/data-sources/machine_configuration.md
talos_version = "1.11.4" talos_version = "1.11.6"
kubernetes_version = "1.34.1" kubernetes_version = "1.34.2"
# With these variables you can configure the ISO images which are uploaded to Proxmox for initially booting the VMs # 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.4/nocloud-amd64.iso" talos_linux_iso_image_url = "https://factory.talos.dev/image/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515/v1.11.6/nocloud-amd64.iso"
talos_linux_iso_image_filename = "talos-linux-v1.11.4-qemu-guest-agent-amd64.iso" talos_linux_iso_image_filename = "talos-linux-v1.11.6-qemu-guest-agent-amd64.iso"
# Name of the cluster # Name of the cluster
cluster_name = "your cluster name" cluster_name = "your cluster name"
# VIP address for the control planes, see https://www.talos.dev/v1.11/talos-guides/network/vip/ # VIP address for the control planes, see https://www.talos.dev/v1.11/talos-guides/network/vip/
@@ -22,33 +22,33 @@ node_data = {
controlplanes = { controlplanes = {
"192.168.10.101" = { "192.168.10.101" = {
install_disk = "/dev/vda" install_disk = "/dev/vda"
install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.4" install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.6"
}, },
"192.168.10.102" = { "192.168.10.102" = {
install_disk = "/dev/vda" install_disk = "/dev/vda"
install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.4" install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.6"
}, },
"192.168.10.103" = { "192.168.10.103" = {
install_disk = "/dev/vda" install_disk = "/dev/vda"
install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.4" install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.6"
}, },
} }
workers = { workers = {
"192.168.10.104" = { "192.168.10.104" = {
install_disk = "/dev/vda" install_disk = "/dev/vda"
install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.4" install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.6"
}, },
"192.168.10.105" = { "192.168.10.105" = {
install_disk = "/dev/vda" install_disk = "/dev/vda"
install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.4" install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.6"
}, },
"192.168.10.106" = { "192.168.10.106" = {
install_disk = "/dev/vda" install_disk = "/dev/vda"
install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.4" install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.6"
}, },
"192.168.10.107" = { "192.168.10.107" = {
install_disk = "/dev/vda" install_disk = "/dev/vda"
install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.4" install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.6"
}, },
} }
} }

View File

@@ -35,6 +35,7 @@ resource "talos_machine_configuration_apply" "controlplane" {
hostname = each.value.hostname == null ? format("%s-cp-%s", var.cluster_name, index(keys(var.node_data.controlplanes), each.key)) : each.value.hostname hostname = each.value.hostname == null ? format("%s-cp-%s", var.cluster_name, index(keys(var.node_data.controlplanes), each.key)) : each.value.hostname
install_disk = each.value.install_disk install_disk = each.value.install_disk
install_image = each.value.install_image install_image = each.value.install_image
dns = var.domain_name_server
ip_address = "${each.key}/24" ip_address = "${each.key}/24"
network = var.network network = var.network
network_gateway = var.network_gateway network_gateway = var.network_gateway
@@ -56,6 +57,7 @@ resource "talos_machine_configuration_apply" "worker" {
hostname = each.value.hostname == null ? format("%s-worker-%s", var.cluster_name, index(keys(var.node_data.workers), each.key)) : each.value.hostname hostname = each.value.hostname == null ? format("%s-worker-%s", var.cluster_name, index(keys(var.node_data.workers), each.key)) : each.value.hostname
install_disk = each.value.install_disk install_disk = each.value.install_disk
install_image = each.value.install_image install_image = each.value.install_image
dns = var.domain_name_server
ip_address = "${each.key}/24" ip_address = "${each.key}/24"
network = var.network network = var.network
network_gateway = var.network_gateway network_gateway = var.network_gateway

View File

@@ -1,9 +1,14 @@
machine: machine:
features:
hostDNS:
forwardKubeDNSToHost: false
install: install:
disk: ${install_disk} disk: ${install_disk}
image: ${install_image} image: ${install_image}
network: network:
hostname: ${hostname} hostname: ${hostname}
nameservers:
- ${dns}
interfaces: interfaces:
- deviceSelector: - deviceSelector:
physical: true physical: true

View File

@@ -1,9 +1,14 @@
machine: machine:
features:
hostDNS:
forwardKubeDNSToHost: false
install: install:
disk: ${install_disk} disk: ${install_disk}
image: ${install_image} image: ${install_image}
network: network:
hostname: ${hostname} hostname: ${hostname}
nameservers:
- ${dns}
interfaces: interfaces:
- deviceSelector: - deviceSelector:
physical: true physical: true

View File

@@ -22,24 +22,24 @@ variable "proxmox_storage_device" {
variable "talos_version" { variable "talos_version" {
type = string type = string
default = "1.11.4" default = "1.11.6"
} }
variable "kubernetes_version" { variable "kubernetes_version" {
type = string type = string
default = "1.34.1" default = "1.34.2"
} }
variable "talos_linux_iso_image_url" { variable "talos_linux_iso_image_url" {
description = "URL of the Talos ISO image for initially booting the VM" description = "URL of the Talos ISO image for initially booting the VM"
type = string type = string
default = "https://factory.talos.dev/image/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515/v1.11.4/nocloud-amd64.iso" default = "https://factory.talos.dev/image/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515/v1.11.6/nocloud-amd64.iso"
} }
variable "talos_linux_iso_image_filename" { variable "talos_linux_iso_image_filename" {
description = "Filename of the Talos ISO image for initially booting the VM" description = "Filename of the Talos ISO image for initially booting the VM"
type = string type = string
default = "talos-linux-v1.11.4-qemu-guest-agent-amd64.iso" default = "talos-linux-v1.11.6-qemu-guest-agent-amd64.iso"
} }
variable "cluster_name" { variable "cluster_name" {
@@ -72,13 +72,13 @@ variable "node_data" {
controlplanes = { controlplanes = {
"192.168.1.101" = { "192.168.1.101" = {
install_disk = "/dev/vda" install_disk = "/dev/vda"
install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.4" install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.6"
}, },
} }
workers = { workers = {
"192.168.1.102" = { "192.168.1.102" = {
install_disk = "/dev/vda" install_disk = "/dev/vda"
install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.4" install_image = "factory.talos.dev/nocloud-installer/ce4c980550dd2ab1b17bbf2b08801c7eb59418eafe8f279833297925d67c7515:v1.11.6"
}, },
} }
} }