Reverting to old patch routing

This commit is contained in:
vandomej 2025-09-29 16:36:18 -07:00
parent 4be6e4da19
commit e4cf3bcae7
2 changed files with 18 additions and 62 deletions

View file

@ -1,15 +1,5 @@
terraform { terraform {
required_version = ">= 1.0" required_version = ">= 1.0"
required_providers {
talos = {
source = "siderolabs/talos"
version = "~> 0.4"
}
}
}
provider "talos" {
# Configuration options
} }
# Load variables from a .tfvars file # Load variables from a .tfvars file
@ -94,56 +84,21 @@ resource "null_resource" "talos_cluster" {
} }
} }
resource "talos_machine_secrets" "this" {} resource "null_resource" "talos_cluster_patches" {
data "talos_machine_configuration" "this" {
cluster_name = "${var.cluster_name}"
machine_type = "controlplane"
cluster_endpoint = "https://10.5.0.1:6443"
machine_secrets = talos_machine_secrets.this.machine_secrets
}
data "talos_client_configuration" "this" {
cluster_name = "${var.cluster_name}"
client_configuration = talos_machine_secrets.this.client_configuration
nodes = ["10.5.0.2"]
}
resource "talos_machine_configuration_apply" "this" {
depends_on = [null_resource.talos_cluster] depends_on = [null_resource.talos_cluster]
client_configuration = talos_machine_secrets.this.client_configuration triggers = {
machine_configuration_input = data.talos_machine_configuration.this.machine_configuration patches_hash = filesha1("${path.module}/patches/controlplane-patch.yaml")
node = "10.5.0.2"
config_patches = [
yamlencode({
machine = {
network = {
nameservers = [
"1.1.1.1",
"10.0.0.0"
]
}
}
})
]
} }
# resource "null_resource" "talos_cluster_patches" { provisioner "local-exec" {
# depends_on = [null_resource.talos_cluster] command = <<EOT
# triggers = { # Apply ONLY your custom patches (not the full config)
# patches_hash = filesha1("${path.module}/patches/controlplane-patch.yaml") talosctl patch machineconfig \
# } --patch-file patches/controlplane-patch.yaml \
--nodes 10.5.0.2
# provisioner "local-exec" { EOT
# command = <<EOT }
# # Apply ONLY your custom patches (not the full config) }
# talosctl patch machineconfig \
# --patch-file patches/controlplane-patch.yaml \
# --nodes 10.5.0.2 \
# --mode reboot
# EOT
# }
# }
output "next_steps" { output "next_steps" {
value = <<EOT value = <<EOT

View file

@ -1,4 +1,5 @@
cluster: machine:
apiServer: network:
certSANs: nameservers:
- 10.5.0.2 - 1.1.1.1
- 8.8.8.8