2018-08-19 18:48:22 -07:00
|
|
|
variable "name" {
|
2019-05-27 21:43:08 -07:00
|
|
|
type = string
|
2018-08-19 18:48:22 -07:00
|
|
|
description = "Unique name for the worker pool"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Azure
|
|
|
|
|
2024-07-08 21:20:46 -07:00
|
|
|
variable "location" {
|
2019-05-27 21:43:08 -07:00
|
|
|
type = string
|
2024-07-08 21:20:46 -07:00
|
|
|
description = "Must be set to the Azure location of cluster"
|
2018-08-19 18:48:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "resource_group_name" {
|
2019-05-27 21:43:08 -07:00
|
|
|
type = string
|
2018-08-19 18:48:22 -07:00
|
|
|
description = "Must be set to the resource group name of cluster"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "subnet_id" {
|
2019-05-27 21:43:08 -07:00
|
|
|
type = string
|
2018-08-19 18:48:22 -07:00
|
|
|
description = "Must be set to the `worker_subnet_id` output by cluster"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "security_group_id" {
|
2019-05-27 21:43:08 -07:00
|
|
|
type = string
|
2018-08-19 18:48:22 -07:00
|
|
|
description = "Must be set to the `worker_security_group_id` output by cluster"
|
|
|
|
}
|
|
|
|
|
2024-07-05 17:21:50 -07:00
|
|
|
variable "backend_address_pool_ids" {
|
|
|
|
type = object({
|
|
|
|
ipv4 = list(string)
|
|
|
|
ipv6 = list(string)
|
|
|
|
})
|
|
|
|
description = "Must be set to the `backend_address_pool_ids` output by cluster"
|
2018-08-19 18:48:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
# instances
|
|
|
|
|
2019-05-27 16:33:21 -07:00
|
|
|
variable "worker_count" {
|
2019-09-30 22:18:15 -07:00
|
|
|
type = number
|
2018-08-19 18:48:22 -07:00
|
|
|
description = "Number of instances"
|
2019-09-30 22:18:15 -07:00
|
|
|
default = 1
|
2018-08-19 18:48:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "vm_type" {
|
2019-05-27 21:43:08 -07:00
|
|
|
type = string
|
2018-08-19 18:48:22 -07:00
|
|
|
description = "Machine type for instances (see `az vm list-skus --location centralus`)"
|
2022-10-13 09:47:45 -07:00
|
|
|
default = "Standard_D2as_v5"
|
2018-08-19 18:48:22 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "os_image" {
|
2019-05-27 21:43:08 -07:00
|
|
|
type = string
|
2021-02-20 15:36:52 -08:00
|
|
|
description = "Channel for a Container Linux derivative (flatcar-stable, flatcar-beta, flatcar-alpha)"
|
2020-04-11 14:52:30 -07:00
|
|
|
default = "flatcar-stable"
|
2020-11-17 11:30:01 -08:00
|
|
|
|
|
|
|
validation {
|
2021-02-20 15:36:52 -08:00
|
|
|
condition = contains(["flatcar-stable", "flatcar-beta", "flatcar-alpha"], var.os_image)
|
|
|
|
error_message = "The os_image must be flatcar-stable, flatcar-beta, or flatcar-alpha."
|
2020-11-17 11:30:01 -08:00
|
|
|
}
|
2018-08-19 18:48:22 -07:00
|
|
|
}
|
|
|
|
|
2024-07-09 07:53:41 -07:00
|
|
|
variable "disk_type" {
|
|
|
|
type = string
|
|
|
|
description = "Type of managed disk"
|
|
|
|
default = "Standard_LRS"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "disk_size" {
|
|
|
|
type = number
|
|
|
|
description = "Size of the managed disk in GB"
|
|
|
|
default = 30
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "ephemeral_disk" {
|
|
|
|
type = bool
|
|
|
|
description = "Use ephemeral local disk instead of managed disk (requires vm_type with local storage)"
|
|
|
|
default = false
|
|
|
|
}
|
|
|
|
|
2018-08-19 18:48:22 -07:00
|
|
|
variable "priority" {
|
2019-05-27 21:43:08 -07:00
|
|
|
type = string
|
2020-04-12 15:49:48 -07:00
|
|
|
description = "Set priority to Spot to use reduced cost surplus capacity, with the tradeoff that instances can be evicted at any time."
|
2019-09-30 22:18:15 -07:00
|
|
|
default = "Regular"
|
2018-08-19 18:48:22 -07:00
|
|
|
}
|
|
|
|
|
2020-03-29 11:46:22 -07:00
|
|
|
variable "snippets" {
|
2019-05-27 21:43:08 -07:00
|
|
|
type = list(string)
|
2018-08-19 18:48:22 -07:00
|
|
|
description = "Container Linux Config snippets"
|
|
|
|
default = []
|
|
|
|
}
|
|
|
|
|
|
|
|
# configuration
|
|
|
|
|
|
|
|
variable "kubeconfig" {
|
2019-05-27 21:43:08 -07:00
|
|
|
type = string
|
2018-08-19 18:48:22 -07:00
|
|
|
description = "Must be set to `kubeconfig` output by cluster"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "ssh_authorized_key" {
|
2019-05-27 21:43:08 -07:00
|
|
|
type = string
|
2018-08-19 18:48:22 -07:00
|
|
|
description = "SSH public key for user 'core'"
|
|
|
|
}
|
|
|
|
|
2023-09-17 23:21:42 +02:00
|
|
|
variable "azure_authorized_key" {
|
|
|
|
type = string
|
|
|
|
description = "Optionally, pass a dummy RSA key to satisfy Azure validations (then use an ed25519 key set above)"
|
|
|
|
default = ""
|
|
|
|
}
|
|
|
|
|
2018-08-19 18:48:22 -07:00
|
|
|
variable "service_cidr" {
|
2019-11-13 23:44:02 -08:00
|
|
|
type = string
|
2018-08-19 18:48:22 -07:00
|
|
|
description = <<EOD
|
|
|
|
CIDR IPv4 range to assign Kubernetes services.
|
|
|
|
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
|
|
|
EOD
|
2019-11-13 23:44:02 -08:00
|
|
|
default = "10.3.0.0/16"
|
2018-08-19 18:48:22 -07:00
|
|
|
}
|
|
|
|
|
2019-09-30 22:18:15 -07:00
|
|
|
variable "node_labels" {
|
2019-11-13 23:44:02 -08:00
|
|
|
type = list(string)
|
2019-09-30 22:18:15 -07:00
|
|
|
description = "List of initial node labels"
|
2019-11-13 23:44:02 -08:00
|
|
|
default = []
|
2019-09-30 22:18:15 -07:00
|
|
|
}
|
|
|
|
|
2021-04-11 12:08:56 -07:00
|
|
|
variable "node_taints" {
|
|
|
|
type = list(string)
|
|
|
|
description = "List of initial node taints"
|
|
|
|
default = []
|
|
|
|
}
|
|
|
|
|
2022-10-13 20:49:01 -07:00
|
|
|
variable "arch" {
|
|
|
|
type = string
|
|
|
|
description = "Container architecture (amd64 or arm64)"
|
|
|
|
default = "amd64"
|
|
|
|
|
|
|
|
validation {
|
|
|
|
condition = var.arch == "amd64" || var.arch == "arm64"
|
|
|
|
error_message = "The arch must be amd64 or arm64."
|
|
|
|
}
|
|
|
|
}
|