fix: harden cluster rebuild determinism
This commit is contained in:
@@ -20,6 +20,11 @@ variable "control_plane_count" {
|
||||
description = "Number of control plane nodes"
|
||||
type = number
|
||||
default = 3
|
||||
|
||||
validation {
|
||||
condition = var.control_plane_count > 0
|
||||
error_message = "control_plane_count must be greater than zero."
|
||||
}
|
||||
}
|
||||
|
||||
variable "control_plane_cores" {
|
||||
@@ -44,6 +49,11 @@ variable "worker_count" {
|
||||
description = "Number of worker nodes"
|
||||
type = number
|
||||
default = 5
|
||||
|
||||
validation {
|
||||
condition = var.worker_count >= 0
|
||||
error_message = "worker_count must be zero or greater."
|
||||
}
|
||||
}
|
||||
|
||||
variable "worker_cores" {
|
||||
@@ -193,24 +203,44 @@ variable "control_plane_ips" {
|
||||
description = "Static IPv4 addresses for control plane VMs"
|
||||
type = list(string)
|
||||
default = ["10.27.27.30", "10.27.27.31", "10.27.27.32"]
|
||||
|
||||
validation {
|
||||
condition = length(var.control_plane_ips) == length(distinct(var.control_plane_ips))
|
||||
error_message = "control_plane_ips must be unique."
|
||||
}
|
||||
}
|
||||
|
||||
variable "worker_ips" {
|
||||
description = "Static IPv4 addresses for worker VMs"
|
||||
type = list(string)
|
||||
default = ["10.27.27.41", "10.27.27.42", "10.27.27.43", "10.27.27.44", "10.27.27.45"]
|
||||
|
||||
validation {
|
||||
condition = length(var.worker_ips) == length(distinct(var.worker_ips))
|
||||
error_message = "worker_ips must be unique."
|
||||
}
|
||||
}
|
||||
|
||||
variable "control_plane_vm_ids" {
|
||||
description = "Fixed VMIDs for control plane VMs"
|
||||
type = list(number)
|
||||
default = [200, 201, 202]
|
||||
|
||||
validation {
|
||||
condition = length(var.control_plane_vm_ids) == length(distinct(var.control_plane_vm_ids))
|
||||
error_message = "control_plane_vm_ids must be unique."
|
||||
}
|
||||
}
|
||||
|
||||
variable "worker_vm_ids" {
|
||||
description = "Fixed VMIDs for worker VMs"
|
||||
type = list(number)
|
||||
default = [210, 211, 212, 213, 214]
|
||||
|
||||
validation {
|
||||
condition = length(var.worker_vm_ids) == length(distinct(var.worker_vm_ids))
|
||||
error_message = "worker_vm_ids must be unique."
|
||||
}
|
||||
}
|
||||
|
||||
variable "kube_api_vip" {
|
||||
|
||||
Reference in New Issue
Block a user