From b06d9ad39ef70ac0350ac7c4873b62e9868348ca Mon Sep 17 00:00:00 2001 From: vandomej Date: Sun, 28 Sep 2025 17:52:27 -0700 Subject: [PATCH] Removing hash at end of cluster name --- control_plane/configs/controlplane.yaml | 2 +- control_plane/configs/talosconfig | 4 ++-- control_plane/configs/worker.yaml | 2 +- control_plane/main.tf | 24 +++--------------------- 4 files changed, 7 insertions(+), 25 deletions(-) diff --git a/control_plane/configs/controlplane.yaml b/control_plane/configs/controlplane.yaml index 3c7829c..79ee22f 100644 --- a/control_plane/configs/controlplane.yaml +++ b/control_plane/configs/controlplane.yaml @@ -381,7 +381,7 @@ cluster: # Provides control plane specific configuration options. controlPlane: endpoint: https://10.5.0.2:6443 # Endpoint is the canonical controlplane endpoint, which can be an IP address or a DNS hostname. - clusterName: evo-npcs-infra-96c16945 # Configures the cluster's name. + clusterName: evo-npcs-infra # Configures the cluster's name. # Provides cluster specific network configuration options. network: dnsDomain: cluster.local # The domain used by Kubernetes DNS. diff --git a/control_plane/configs/talosconfig b/control_plane/configs/talosconfig index a1883e7..07ce3c1 100644 --- a/control_plane/configs/talosconfig +++ b/control_plane/configs/talosconfig @@ -1,6 +1,6 @@ -context: evo-npcs-infra-96c16945 +context: evo-npcs-infra contexts: - evo-npcs-infra-96c16945: + evo-npcs-infra: endpoints: [] ca: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJQakNCOGFBREFnRUNBaEFEZWlMUlkxdXNWMURsc3VmOGh1Y2dNQVVHQXl0bGNEQVFNUTR3REFZRFZRUUsKRXdWMFlXeHZjekFlRncweU5UQTVNamt3TURFNU1UbGFGdzB6TlRBNU1qY3dNREU1TVRsYU1CQXhEakFNQmdOVgpCQW9UQlhSaGJHOXpNQ293QlFZREsyVndBeUVBcUpsMS9uNmRLVjNMazZwT01kN0pCU2RpMlljdGNaTnFDeFVtCjRSY0J5RHlqWVRCZk1BNEdBMVVkRHdFQi93UUVBd0lDaERBZEJnTlZIU1VFRmpBVUJnZ3JCZ0VGQlFjREFRWUkKS3dZQkJRVUhBd0l3RHdZRFZSMFRBUUgvQkFVd0F3RUIvekFkQmdOVkhRNEVGZ1FVOTQ2UUoreXdHNVFqMGpabApFWUZnbWdwZUd6a3dCUVlESzJWd0EwRUFYb2RmTHBtMnVrcmdzOFVqZDFOeWJpN2ZtWUVCTkQzZzFKbzhWMlVKCkZnWkR2aEFTSENpT3gvNkxSM2tPQVIybGtjbC95QktZai9YUUM3MWtzdmR5Qnc9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg== crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUJLRENCMjZBREFnRUNBaEFYaG85d1NYbHhIUEcvMHd0YkNER1NNQVVHQXl0bGNEQVFNUTR3REFZRFZRUUsKRXdWMFlXeHZjekFlRncweU5UQTVNamt3TURFNU1UbGFGdzB5TmpBNU1qa3dNREU1TVRsYU1CTXhFVEFQQmdOVgpCQW9UQ0c5ek9tRmtiV2x1TUNvd0JRWURLMlZ3QXlFQVZZbVpqOGZxYUNJb282NnNMZDAyWEdUL0dmNC90VW00ClpSOVNDY2VjbURtalNEQkdNQTRHQTFVZER3RUIvd1FFQXdJSGdEQVRCZ05WSFNVRUREQUtCZ2dyQmdFRkJRY0QKQWpBZkJnTlZIU01FR0RBV2dCVDNqcEFuN0xBYmxDUFNObVVSZ1dDYUNsNGJPVEFGQmdNclpYQURRUUJUd09hQgpOczVIM09Beld6bjVzTm9xT2pZNzY5MkxhRnhXV3hGWXRhZFpyS3ZhcWt5V0xHdWx1ZmR1ajFRTU0wU2lvdlhoCndZTkEzNWh5SWkwTzZjSUkKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo= diff --git a/control_plane/configs/worker.yaml b/control_plane/configs/worker.yaml index 3c9d73a..bf17dc3 100644 --- a/control_plane/configs/worker.yaml +++ b/control_plane/configs/worker.yaml @@ -384,7 +384,7 @@ cluster: # Provides control plane specific configuration options. controlPlane: endpoint: https://10.5.0.2:6443 # Endpoint is the canonical controlplane endpoint, which can be an IP address or a DNS hostname. - clusterName: evo-npcs-infra-96c16945 # Configures the cluster's name. + clusterName: evo-npcs-infra # Configures the cluster's name. # Provides cluster specific network configuration options. network: dnsDomain: cluster.local # The domain used by Kubernetes DNS. diff --git a/control_plane/main.tf b/control_plane/main.tf index c75b84c..7f98189 100644 --- a/control_plane/main.tf +++ b/control_plane/main.tf @@ -34,32 +34,14 @@ variable "talos_version" { default = "v1.11.1" } - -locals { - # Generate unique cluster name each time - unique_cluster_name = "${var.cluster_name}-${random_id.cluster_suffix.hex}" -} - -resource "random_id" "cluster_suffix" { - byte_length = 4 - keepers = { - # Regenerate when any of these values change - cluster_name = var.cluster_name - memory_mb = var.memory_mb - vcpu_count = var.vcpu_count - talos_version = var.talos_version - cleanup_script_hash = filesha1("${path.module}/cleanup.sh") - } -} - resource "null_resource" "talos_cluster" { triggers = { - cluster_name = local.unique_cluster_name + cluster_name = var.cluster_name memory_mb = var.memory_mb vcpu_count = var.vcpu_count talos_version = var.talos_version config_hash = sha1(join("", [ - local.unique_cluster_name, + var.cluster_name, tostring(var.memory_mb), tostring(var.vcpu_count), var.talos_version, @@ -89,7 +71,7 @@ resource "null_resource" "talos_cluster" { sudo --preserve-env=HOME talosctl cluster create \ --provisioner=qemu \ --name ${self.triggers.cluster_name} \ - --talosconfig ${path.module}/talosconfig \ + --talosconfig ${path.module}/config/talosconfig \ --controlplanes 1 \ --workers 0 \ --memory ${self.triggers.memory_mb} \