109 lines
2.7 KiB
HCL
109 lines
2.7 KiB
HCL
variable "cluster_name" {
|
|
description = "A name prefix for the cluster resources."
|
|
type = string
|
|
default = "k3s"
|
|
}
|
|
|
|
variable "libvirt_uri" {
|
|
description = "Libvirt connection URI."
|
|
type = string
|
|
default = "qemu:///system"
|
|
}
|
|
|
|
# --- Base Image ---
|
|
variable "base_image_url" {
|
|
description = "URL of the cloud image to download (e.g., Fedora Cloud Base)."
|
|
type = string
|
|
default = "https://download.fedoraproject.org/pub/fedora/linux/releases/42/Cloud/x86_64/images/Fedora-Cloud-Base-Generic-42-1.1.x86_64.qcow2"
|
|
}
|
|
|
|
variable "base_image_name" {
|
|
description = "Name for the base image volume in libvirt pool."
|
|
type = string
|
|
default = "fedora-cloud-base.qcow2"
|
|
}
|
|
|
|
variable "libvirt_pool" {
|
|
description = "Name of the libvirt storage pool to use."
|
|
type = string
|
|
default = "default"
|
|
}
|
|
|
|
# --- SSH & User ---
|
|
variable "ssh_public_key_path" {
|
|
description = "Path to your public SSH key for accessing the VMs."
|
|
type = string
|
|
default = "~/.ssh/id_cluster.pub"
|
|
}
|
|
|
|
variable "vm_user" {
|
|
description = "Default user to create in the VMs via cloud-init."
|
|
type = string
|
|
default = "fedora"
|
|
}
|
|
|
|
# --- Network ---
|
|
variable "libvirt_network_name" {
|
|
description = "Name of the libvirt network to connect VMs to."
|
|
type = string
|
|
default = "default"
|
|
}
|
|
|
|
# --- Server spezifisch ---
|
|
variable "server_hostname" {
|
|
description = "Hostname für den K3s Server."
|
|
type = string
|
|
default = "k3s-server"
|
|
}
|
|
variable "server_memory" {
|
|
description = "RAM für den Server (in MiB)"
|
|
type = number
|
|
default = 4096
|
|
}
|
|
variable "server_vcpu" {
|
|
description = "vCPUs für den Server"
|
|
type = number
|
|
default = 4
|
|
}
|
|
variable "server_disk_size" {
|
|
description = "Diskgröße für den Server (in Bytes)"
|
|
type = number
|
|
default = 32212254720 # 30 GB
|
|
}
|
|
variable "server_ip" {
|
|
description = "Feste IP für den Server"
|
|
type = string
|
|
default = "192.168.124.100"
|
|
}
|
|
|
|
# --- Agent spezifisch ---
|
|
variable "agent_count" {
|
|
description = "Anzahl der Agenten"
|
|
type = number
|
|
default = 2
|
|
}
|
|
variable "agent_memory" {
|
|
description = "RAM pro Agent (in MiB)"
|
|
type = number
|
|
default = 3072
|
|
}
|
|
variable "agent_vcpu" {
|
|
description = "vCPUs pro Agent"
|
|
type = number
|
|
default = 2
|
|
}
|
|
variable "agent_disk_size" {
|
|
description = "Diskgröße pro Agent (in Bytes)"
|
|
type = number
|
|
default = 32212254720 # 30 GB
|
|
}
|
|
variable "agent_hostname_prefix" {
|
|
description = "Prefix für Agent Hostnamen"
|
|
type = string
|
|
default = "k3s-agent"
|
|
}
|
|
variable "agent_ips" {
|
|
description = "Feste IPs für die Agenten"
|
|
type = list(string)
|
|
default = ["192.168.124.101", "192.168.124.102"]
|
|
}
|