2026-02-28 20:24:55 +00:00
|
|
|
variable "ssh_public_key" {
|
|
|
|
|
description = "Path to SSH public key"
|
|
|
|
|
type = string
|
2026-04-22 03:02:13 +00:00
|
|
|
default = "~/.ssh/infra.pub"
|
2026-02-28 20:24:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "ssh_private_key" {
|
|
|
|
|
description = "Path to SSH private key"
|
|
|
|
|
type = string
|
2026-04-22 03:02:13 +00:00
|
|
|
default = "~/.ssh/infra"
|
2026-02-28 20:24:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "cluster_name" {
|
|
|
|
|
description = "Name of the Kubernetes cluster"
|
|
|
|
|
type = string
|
|
|
|
|
default = "k8s-cluster"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "control_plane_count" {
|
|
|
|
|
description = "Number of control plane nodes"
|
|
|
|
|
type = number
|
2026-03-23 02:39:39 +00:00
|
|
|
default = 3
|
2026-02-28 20:24:55 +00:00
|
|
|
}
|
|
|
|
|
|
2026-04-22 03:02:13 +00:00
|
|
|
variable "control_plane_cores" {
|
|
|
|
|
description = "vCPU count for control plane VMs"
|
|
|
|
|
type = number
|
|
|
|
|
default = 2
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "control_plane_memory_mb" {
|
|
|
|
|
description = "Dedicated memory for control plane VMs in MiB"
|
|
|
|
|
type = number
|
|
|
|
|
default = 4096
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "control_plane_disk_gb" {
|
|
|
|
|
description = "Disk size for control plane VMs in GiB"
|
|
|
|
|
type = number
|
|
|
|
|
default = 32
|
2026-02-28 20:24:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "worker_count" {
|
|
|
|
|
description = "Number of worker nodes"
|
|
|
|
|
type = number
|
2026-04-22 03:02:13 +00:00
|
|
|
default = 5
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "worker_cores" {
|
|
|
|
|
description = "vCPU count for worker VMs"
|
|
|
|
|
type = number
|
|
|
|
|
default = 4
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "worker_memory_mb" {
|
|
|
|
|
description = "Dedicated memory for worker VMs in MiB"
|
|
|
|
|
type = number
|
|
|
|
|
default = 8192
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "worker_disk_gb" {
|
|
|
|
|
description = "Disk size for worker VMs in GiB"
|
|
|
|
|
type = number
|
|
|
|
|
default = 64
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "proxmox_endpoint" {
|
|
|
|
|
description = "Proxmox API endpoint without /api2/json suffix"
|
|
|
|
|
type = string
|
|
|
|
|
default = "https://100.105.0.115:8006/"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "proxmox_api_token_id" {
|
|
|
|
|
description = "Proxmox API token ID"
|
|
|
|
|
type = string
|
|
|
|
|
sensitive = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "proxmox_api_token_secret" {
|
|
|
|
|
description = "Proxmox API token secret"
|
|
|
|
|
type = string
|
|
|
|
|
sensitive = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "proxmox_insecure" {
|
|
|
|
|
description = "Skip TLS verification for the Proxmox API"
|
|
|
|
|
type = bool
|
|
|
|
|
default = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "proxmox_node_name" {
|
|
|
|
|
description = "Fixed Proxmox node name for all cluster VMs"
|
|
|
|
|
type = string
|
|
|
|
|
default = "flex"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "proxmox_template_vm_id" {
|
|
|
|
|
description = "Template VM ID used for linked clones"
|
|
|
|
|
type = number
|
|
|
|
|
default = 9000
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "proxmox_clone_full" {
|
|
|
|
|
description = "Whether to use full clones instead of linked clones"
|
|
|
|
|
type = bool
|
|
|
|
|
default = false
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "proxmox_vm_storage_pool" {
|
|
|
|
|
description = "Proxmox datastore for VM disks"
|
|
|
|
|
type = string
|
|
|
|
|
default = "Flash"
|
2026-02-28 20:24:55 +00:00
|
|
|
}
|
|
|
|
|
|
2026-04-22 03:02:13 +00:00
|
|
|
variable "proxmox_cloud_init_storage_pool" {
|
|
|
|
|
description = "Proxmox datastore for cloud-init disks"
|
2026-02-28 20:24:55 +00:00
|
|
|
type = string
|
2026-04-22 03:02:13 +00:00
|
|
|
default = "Flash"
|
2026-02-28 20:24:55 +00:00
|
|
|
}
|
|
|
|
|
|
2026-04-22 03:02:13 +00:00
|
|
|
variable "proxmox_bridge" {
|
|
|
|
|
description = "Proxmox bridge for cluster VM interfaces"
|
2026-02-28 20:24:55 +00:00
|
|
|
type = string
|
2026-04-22 03:02:13 +00:00
|
|
|
default = "vmbr0"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "proxmox_ssh_username" {
|
|
|
|
|
description = "Cloud-init user injected into cloned VMs"
|
|
|
|
|
type = string
|
|
|
|
|
default = "ubuntu"
|
2026-02-28 20:24:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "allowed_ssh_ips" {
|
|
|
|
|
description = "IP ranges allowed for SSH access"
|
|
|
|
|
type = list(string)
|
2026-03-01 04:04:56 +00:00
|
|
|
default = []
|
2026-02-28 20:24:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "allowed_api_ips" {
|
|
|
|
|
description = "IP ranges allowed for Kubernetes API access"
|
|
|
|
|
type = list(string)
|
2026-03-01 04:04:56 +00:00
|
|
|
default = []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "restrict_api_ssh_to_tailnet" {
|
|
|
|
|
description = "Restrict SSH and Kubernetes API to tailnet CIDR"
|
|
|
|
|
type = bool
|
|
|
|
|
default = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "tailnet_cidr" {
|
|
|
|
|
description = "Tailnet CIDR used for SSH/API access"
|
|
|
|
|
type = string
|
|
|
|
|
default = "100.64.0.0/10"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "tailscale_tailnet" {
|
|
|
|
|
description = "Tailnet domain suffix, e.g. mytailnet.ts.net"
|
|
|
|
|
type = string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "enable_nodeport_public" {
|
|
|
|
|
description = "Allow public NodePort traffic"
|
|
|
|
|
type = bool
|
|
|
|
|
default = false
|
2026-02-28 20:24:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "network_cidr" {
|
|
|
|
|
description = "CIDR for private network"
|
|
|
|
|
type = string
|
2026-04-22 03:02:13 +00:00
|
|
|
default = "10.27.27.0/24"
|
2026-02-28 20:24:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "subnet_cidr" {
|
|
|
|
|
description = "CIDR for server subnet"
|
|
|
|
|
type = string
|
2026-04-22 03:02:13 +00:00
|
|
|
default = "10.27.27.0/24"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "proxmox_gateway" {
|
|
|
|
|
description = "Gateway for cluster VM networking"
|
|
|
|
|
type = string
|
|
|
|
|
default = "10.27.27.1"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "proxmox_dns_servers" {
|
|
|
|
|
description = "DNS servers configured through cloud-init"
|
|
|
|
|
type = list(string)
|
|
|
|
|
default = ["1.1.1.1", "8.8.8.8"]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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"]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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"]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "control_plane_vm_ids" {
|
|
|
|
|
description = "Fixed VMIDs for control plane VMs"
|
|
|
|
|
type = list(number)
|
|
|
|
|
default = [200, 201, 202]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "worker_vm_ids" {
|
|
|
|
|
description = "Fixed VMIDs for worker VMs"
|
|
|
|
|
type = list(number)
|
|
|
|
|
default = [210, 211, 212, 213, 214]
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "kube_api_vip" {
|
|
|
|
|
description = "Virtual IP advertised by kube-vip for the Kubernetes API"
|
|
|
|
|
type = string
|
|
|
|
|
default = "10.27.27.40"
|
2026-02-28 20:24:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "s3_access_key" {
|
|
|
|
|
description = "S3 access key for Terraform state"
|
|
|
|
|
type = string
|
|
|
|
|
sensitive = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "s3_secret_key" {
|
|
|
|
|
description = "S3 secret key for Terraform state"
|
|
|
|
|
type = string
|
|
|
|
|
sensitive = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "s3_endpoint" {
|
|
|
|
|
description = "S3 endpoint URL"
|
|
|
|
|
type = string
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
variable "s3_bucket" {
|
|
|
|
|
description = "S3 bucket name for Terraform state"
|
|
|
|
|
type = string
|
|
|
|
|
default = "k8s-terraform-state"
|
|
|
|
|
}
|