2023-12-15 04:36:58 -05:00
|
|
|
# Variables common to all CSPs
|
|
|
|
|
|
|
|
variable "name" {
|
|
|
|
type = string
|
|
|
|
default = "constellation"
|
|
|
|
description = "Name of the Constellation cluster."
|
|
|
|
}
|
|
|
|
|
2023-06-28 08:42:34 -04:00
|
|
|
variable "node_groups" {
|
|
|
|
type = map(object({
|
2023-06-30 04:53:00 -04:00
|
|
|
role = string
|
|
|
|
initial_count = number // number of instances in the node group
|
|
|
|
disk_size = number // size of state disk (GiB)
|
|
|
|
vcpus = number
|
|
|
|
memory = number // amount of memory per instance (MiB)
|
2023-06-28 08:42:34 -04:00
|
|
|
}))
|
|
|
|
validation {
|
|
|
|
condition = can([for group in var.node_groups : group.role == "control-plane" || group.role == "worker"])
|
|
|
|
error_message = "The role has to be 'control-plane' or 'worker'."
|
|
|
|
}
|
|
|
|
|
|
|
|
description = "A map of node group names to node group configurations."
|
|
|
|
}
|
|
|
|
|
2023-12-15 04:36:58 -05:00
|
|
|
variable "image_id" {
|
|
|
|
type = string
|
|
|
|
description = "Path to the OS image for the cluster's nodes."
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "custom_endpoint" {
|
|
|
|
type = string
|
|
|
|
default = ""
|
|
|
|
description = "Custom endpoint to use for the Kubernetes API server. If not set, the default endpoint will be used."
|
|
|
|
}
|
|
|
|
|
|
|
|
# QEMU-specific variables
|
|
|
|
|
2023-06-28 08:42:34 -04:00
|
|
|
variable "machine" {
|
|
|
|
type = string
|
|
|
|
default = "q35"
|
2023-12-15 04:36:58 -05:00
|
|
|
description = "Machine type. Use 'q35' for secure boot and 'pc' for non secure boot. See 'qemu-system-x86_64 -machine help'."
|
2023-06-28 08:42:34 -04:00
|
|
|
}
|
|
|
|
|
2022-10-05 03:11:30 -04:00
|
|
|
variable "libvirt_uri" {
|
|
|
|
type = string
|
2023-12-15 04:36:58 -05:00
|
|
|
description = "URI of the Libvirt socket."
|
2022-10-05 03:11:30 -04:00
|
|
|
}
|
|
|
|
|
2023-05-16 08:13:10 -04:00
|
|
|
variable "constellation_boot_mode" {
|
|
|
|
type = string
|
2023-12-15 04:36:58 -05:00
|
|
|
description = "Constellation boot mode. Can be 'uefi' or 'direct-linux-boot'."
|
2023-05-16 08:13:10 -04:00
|
|
|
validation {
|
|
|
|
condition = anytrue([
|
|
|
|
var.constellation_boot_mode == "uefi",
|
|
|
|
var.constellation_boot_mode == "direct-linux-boot",
|
|
|
|
])
|
2023-12-15 04:36:58 -05:00
|
|
|
error_message = "constellation_boot_mode must be 'uefi' or 'direct-linux-boot'."
|
2023-05-16 08:13:10 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "constellation_kernel" {
|
|
|
|
type = string
|
2023-12-15 04:36:58 -05:00
|
|
|
description = "Constellation Kernel file path."
|
2023-05-16 08:13:10 -04:00
|
|
|
default = ""
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "constellation_initrd" {
|
|
|
|
type = string
|
2023-12-15 04:36:58 -05:00
|
|
|
description = "Constellation initrd file path."
|
2023-05-16 08:13:10 -04:00
|
|
|
default = ""
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "constellation_cmdline" {
|
|
|
|
type = string
|
2023-12-15 04:36:58 -05:00
|
|
|
description = "Constellation kernel cmdline."
|
2023-05-16 08:13:10 -04:00
|
|
|
default = ""
|
|
|
|
}
|
|
|
|
|
2022-07-04 06:59:43 -04:00
|
|
|
variable "image_format" {
|
|
|
|
type = string
|
|
|
|
default = "qcow2"
|
2023-12-15 04:36:58 -05:00
|
|
|
description = "Image format."
|
2022-05-22 09:39:30 -04:00
|
|
|
}
|
2023-12-15 04:36:58 -05:00
|
|
|
|
2022-10-19 07:10:15 -04:00
|
|
|
variable "firmware" {
|
|
|
|
type = string
|
2023-11-28 04:52:37 -05:00
|
|
|
default = "/usr/share/OVMF/OVMF_CODE.fd"
|
2023-12-15 04:36:58 -05:00
|
|
|
description = "Path to UEFI firmware file. Use \"OVMF_CODE_4M.ms.fd\" on Ubuntu and \"OVMF_CODE.fd\" or \"OVMF_CODE.secboot.fd\" on Fedora."
|
2022-10-19 07:10:15 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "nvram" {
|
|
|
|
type = string
|
2023-12-15 04:36:58 -05:00
|
|
|
description = "Path to UEFI NVRAM template file. Used for secure boot."
|
2022-10-19 07:10:15 -04:00
|
|
|
}
|
|
|
|
|
2022-09-26 09:52:31 -04:00
|
|
|
variable "metadata_api_image" {
|
|
|
|
type = string
|
2023-12-15 04:36:58 -05:00
|
|
|
description = "Container image of the QEMU metadata API server."
|
2022-09-26 09:52:31 -04:00
|
|
|
}
|
|
|
|
|
2022-10-05 03:11:30 -04:00
|
|
|
variable "metadata_libvirt_uri" {
|
|
|
|
type = string
|
2023-12-15 04:36:58 -05:00
|
|
|
description = "Libvirt URI for the metadata API server."
|
2022-10-05 03:11:30 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "libvirt_socket_path" {
|
|
|
|
type = string
|
2023-12-15 04:36:58 -05:00
|
|
|
description = "Path to Libvirt socket in case of unix socket."
|
2023-07-21 10:43:51 -04:00
|
|
|
}
|