2018-08-20 03:48:22 +02:00
|
|
|
variable "cluster_name" {
|
2019-05-28 06:43:08 +02:00
|
|
|
type = string
|
2018-08-20 03:48:22 +02:00
|
|
|
description = "Unique cluster name (prepended to dns_zone)"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Azure
|
|
|
|
|
|
|
|
variable "region" {
|
2019-05-28 06:43:08 +02:00
|
|
|
type = string
|
2018-08-20 03:48:22 +02:00
|
|
|
description = "Azure Region (e.g. centralus , see `az account list-locations --output table`)"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "dns_zone" {
|
2019-05-28 06:43:08 +02:00
|
|
|
type = string
|
2018-08-20 03:48:22 +02:00
|
|
|
description = "Azure DNS Zone (e.g. azure.example.com)"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "dns_zone_group" {
|
2019-05-28 06:43:08 +02:00
|
|
|
type = string
|
2018-08-20 03:48:22 +02:00
|
|
|
description = "Resource group where the Azure DNS Zone resides (e.g. global)"
|
|
|
|
}
|
|
|
|
|
|
|
|
# instances
|
|
|
|
|
|
|
|
variable "controller_count" {
|
2019-10-01 07:18:15 +02:00
|
|
|
type = number
|
2018-08-20 03:48:22 +02:00
|
|
|
description = "Number of controllers (i.e. masters)"
|
2019-10-01 07:18:15 +02:00
|
|
|
default = 1
|
2018-08-20 03:48:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "worker_count" {
|
2019-10-01 07:18:15 +02:00
|
|
|
type = number
|
2018-08-20 03:48:22 +02:00
|
|
|
description = "Number of workers"
|
2019-10-01 07:18:15 +02:00
|
|
|
default = 1
|
2018-08-20 03:48:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "controller_type" {
|
2019-05-28 06:43:08 +02:00
|
|
|
type = string
|
2018-08-20 03:48:22 +02:00
|
|
|
description = "Machine type for controllers (see `az vm list-skus --location centralus`)"
|
2019-10-01 07:18:15 +02:00
|
|
|
default = "Standard_B2s"
|
2018-08-20 03:48:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "worker_type" {
|
2019-05-28 06:43:08 +02:00
|
|
|
type = string
|
2018-08-20 03:48:22 +02:00
|
|
|
description = "Machine type for workers (see `az vm list-skus --location centralus`)"
|
2022-10-13 18:47:45 +02:00
|
|
|
default = "Standard_D2as_v5"
|
2018-08-20 03:48:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "os_image" {
|
2019-05-28 06:43:08 +02:00
|
|
|
type = string
|
2021-02-21 00:36:52 +01:00
|
|
|
description = "Channel for a Container Linux derivative (flatcar-stable, flatcar-beta, flatcar-alpha)"
|
2020-05-10 02:37:35 +02:00
|
|
|
default = "flatcar-stable"
|
2020-11-17 20:30:01 +01:00
|
|
|
|
|
|
|
validation {
|
2021-02-21 00:36:52 +01: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 20:30:01 +01:00
|
|
|
}
|
2018-08-20 03:48:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "disk_size" {
|
2019-10-01 07:18:15 +02:00
|
|
|
type = number
|
2018-08-20 03:48:22 +02:00
|
|
|
description = "Size of the disk in GB"
|
2021-04-26 20:04:30 +02:00
|
|
|
default = 30
|
2018-08-20 03:48:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "worker_priority" {
|
2019-05-28 06:43:08 +02:00
|
|
|
type = string
|
2020-04-13 00:49:48 +02:00
|
|
|
description = "Set worker priority to Spot to use reduced cost surplus capacity, with the tradeoff that instances can be deallocated at any time."
|
2019-10-01 07:18:15 +02:00
|
|
|
default = "Regular"
|
2018-08-20 03:48:22 +02:00
|
|
|
}
|
|
|
|
|
2020-03-29 20:46:22 +02:00
|
|
|
variable "controller_snippets" {
|
2019-05-28 06:43:08 +02:00
|
|
|
type = list(string)
|
2018-08-20 03:48:22 +02:00
|
|
|
description = "Controller Container Linux Config snippets"
|
|
|
|
default = []
|
|
|
|
}
|
|
|
|
|
2020-03-29 20:46:22 +02:00
|
|
|
variable "worker_snippets" {
|
2019-05-28 06:43:08 +02:00
|
|
|
type = list(string)
|
2018-08-20 03:48:22 +02:00
|
|
|
description = "Worker Container Linux Config snippets"
|
|
|
|
default = []
|
|
|
|
}
|
|
|
|
|
|
|
|
# configuration
|
|
|
|
|
|
|
|
variable "ssh_authorized_key" {
|
2019-05-28 06:43:08 +02:00
|
|
|
type = string
|
2018-08-20 03:48:22 +02: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 = ""
|
|
|
|
}
|
|
|
|
|
2019-05-06 09:38:23 +02:00
|
|
|
variable "networking" {
|
2019-05-28 06:43:08 +02:00
|
|
|
type = string
|
2022-02-07 16:44:09 +01:00
|
|
|
description = "Choice of networking provider (flannel, calico, or cilium)"
|
|
|
|
default = "cilium"
|
2019-05-06 09:38:23 +02:00
|
|
|
}
|
|
|
|
|
2024-02-25 03:48:06 +01:00
|
|
|
variable "install_container_networking" {
|
|
|
|
type = bool
|
|
|
|
description = "Install the chosen networking provider during cluster bootstrap (use false to self-manage)"
|
|
|
|
default = true
|
|
|
|
}
|
|
|
|
|
2018-08-20 03:48:22 +02:00
|
|
|
variable "host_cidr" {
|
2019-05-28 06:43:08 +02:00
|
|
|
type = string
|
2019-10-01 07:18:15 +02:00
|
|
|
description = "CIDR IPv4 range to assign to instances"
|
2018-08-20 03:48:22 +02:00
|
|
|
default = "10.0.0.0/16"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "pod_cidr" {
|
2019-05-28 06:43:08 +02:00
|
|
|
type = string
|
2019-10-01 07:18:15 +02:00
|
|
|
description = "CIDR IPv4 range to assign Kubernetes pods"
|
2018-08-20 03:48:22 +02:00
|
|
|
default = "10.2.0.0/16"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "service_cidr" {
|
2019-11-14 08:44:02 +01:00
|
|
|
type = string
|
2018-08-20 03:48:22 +02: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-14 08:44:02 +01:00
|
|
|
default = "10.3.0.0/16"
|
2018-08-20 03:48:22 +02:00
|
|
|
}
|
|
|
|
|
2018-11-20 07:45:02 +01:00
|
|
|
variable "enable_reporting" {
|
2019-11-14 08:44:02 +01:00
|
|
|
type = bool
|
2018-11-20 07:45:02 +01:00
|
|
|
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
2019-11-14 08:44:02 +01:00
|
|
|
default = false
|
2018-11-20 07:45:02 +01:00
|
|
|
}
|
2019-04-07 11:29:07 +02:00
|
|
|
|
|
|
|
variable "enable_aggregation" {
|
2019-11-14 08:44:02 +01:00
|
|
|
type = bool
|
2021-12-10 02:25:35 +01:00
|
|
|
description = "Enable the Kubernetes Aggregation Layer"
|
|
|
|
default = true
|
2019-04-07 11:29:07 +02:00
|
|
|
}
|
2019-05-28 06:43:08 +02:00
|
|
|
|
2019-09-28 23:59:24 +02:00
|
|
|
variable "worker_node_labels" {
|
2019-11-14 08:44:02 +01:00
|
|
|
type = list(string)
|
2019-09-29 00:01:14 +02:00
|
|
|
description = "List of initial worker node labels"
|
2019-11-14 08:44:02 +01:00
|
|
|
default = []
|
2019-09-28 23:59:24 +02:00
|
|
|
}
|
|
|
|
|
2022-10-14 05:49:01 +02: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."
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-10-13 18:47:45 +02:00
|
|
|
variable "daemonset_tolerations" {
|
|
|
|
type = list(string)
|
|
|
|
description = "List of additional taint keys kube-system DaemonSets should tolerate (e.g. ['custom-role', 'gpu-role'])"
|
|
|
|
default = []
|
|
|
|
}
|
|
|
|
|
2019-10-01 07:18:15 +02:00
|
|
|
# unofficial, undocumented, unsupported
|
|
|
|
|
|
|
|
variable "cluster_domain_suffix" {
|
2019-11-14 08:44:02 +01:00
|
|
|
type = string
|
2019-10-01 07:18:15 +02:00
|
|
|
description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
|
2019-11-14 08:44:02 +01:00
|
|
|
default = "cluster.local"
|
2019-10-01 07:18:15 +02:00
|
|
|
}
|
2024-05-13 06:03:40 +02:00
|
|
|
|
|
|
|
variable "components" {
|
|
|
|
description = "Configure pre-installed cluster components"
|
|
|
|
# Component configs are passed through to terraform-render-bootstrap,
|
|
|
|
# which handles type enforcement and defines defaults
|
|
|
|
# https://github.com/poseidon/terraform-render-bootstrap/blob/main/variables.tf#L95
|
|
|
|
type = object({
|
|
|
|
enable = optional(bool)
|
|
|
|
coredns = optional(map(any))
|
|
|
|
kube_proxy = optional(map(any))
|
|
|
|
})
|
|
|
|
default = null
|
|
|
|
}
|