2017-09-17 21:40:33 -07:00
|
|
|
variable "cluster_name" {
|
2019-05-27 20:42:48 -07:00
|
|
|
type = string
|
2018-03-25 21:36:10 -07:00
|
|
|
description = "Unique cluster name (prepended to dns_zone)"
|
2017-09-17 21:40:33 -07:00
|
|
|
}
|
|
|
|
|
2018-03-25 21:36:10 -07:00
|
|
|
# AWS
|
|
|
|
|
2017-09-17 21:40:33 -07:00
|
|
|
variable "dns_zone" {
|
2019-05-27 20:42:48 -07:00
|
|
|
type = string
|
2018-03-25 21:36:10 -07:00
|
|
|
description = "AWS Route53 DNS Zone (e.g. aws.example.com)"
|
2017-09-17 21:40:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "dns_zone_id" {
|
2019-05-27 20:42:48 -07:00
|
|
|
type = string
|
2018-03-25 21:36:10 -07:00
|
|
|
description = "AWS Route53 DNS Zone ID (e.g. Z3PAABBCFAKEC0)"
|
2017-09-17 21:40:33 -07:00
|
|
|
}
|
|
|
|
|
2018-03-25 21:36:10 -07:00
|
|
|
# instances
|
2017-09-17 21:40:33 -07:00
|
|
|
|
2018-03-25 21:36:10 -07:00
|
|
|
variable "controller_count" {
|
2019-09-29 11:14:36 -07:00
|
|
|
type = number
|
2018-03-25 21:36:10 -07:00
|
|
|
description = "Number of controllers (i.e. masters)"
|
2019-09-29 11:14:36 -07:00
|
|
|
default = 1
|
2017-09-17 21:40:33 -07:00
|
|
|
}
|
|
|
|
|
2018-03-25 21:36:10 -07:00
|
|
|
variable "worker_count" {
|
2019-09-29 11:14:36 -07:00
|
|
|
type = number
|
2018-03-25 21:36:10 -07:00
|
|
|
description = "Number of workers"
|
2019-09-29 11:14:36 -07:00
|
|
|
default = 1
|
2017-09-17 21:40:33 -07:00
|
|
|
}
|
|
|
|
|
2018-03-25 21:36:10 -07:00
|
|
|
variable "controller_type" {
|
2019-05-27 20:42:48 -07:00
|
|
|
type = string
|
2018-03-25 21:36:10 -07:00
|
|
|
description = "EC2 instance type for controllers"
|
2019-09-29 11:14:36 -07:00
|
|
|
default = "t3.small"
|
2017-09-17 21:40:33 -07:00
|
|
|
}
|
|
|
|
|
2018-03-25 21:36:10 -07:00
|
|
|
variable "worker_type" {
|
2019-05-27 20:42:48 -07:00
|
|
|
type = string
|
2018-03-25 21:36:10 -07:00
|
|
|
description = "EC2 instance type for workers"
|
2019-09-29 11:14:36 -07:00
|
|
|
default = "t3.small"
|
2017-09-17 21:40:33 -07:00
|
|
|
}
|
|
|
|
|
2018-05-08 22:38:05 -07:00
|
|
|
variable "os_image" {
|
2019-05-27 20:42:48 -07:00
|
|
|
type = string
|
2021-02-20 15:36:52 -08:00
|
|
|
description = "AMI 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
|
|
|
}
|
2017-09-17 21:40:33 -07:00
|
|
|
}
|
|
|
|
|
2018-03-25 21:36:10 -07:00
|
|
|
variable "disk_size" {
|
2019-09-29 11:14:36 -07:00
|
|
|
type = number
|
2018-03-25 21:36:10 -07:00
|
|
|
description = "Size of the EBS volume in GB"
|
2021-04-26 11:04:30 -07:00
|
|
|
default = 30
|
2017-09-17 21:40:33 -07:00
|
|
|
}
|
|
|
|
|
2018-03-29 00:24:07 -07:00
|
|
|
variable "disk_type" {
|
2019-05-27 20:42:48 -07:00
|
|
|
type = string
|
2021-07-04 10:41:53 -07:00
|
|
|
description = "Type of the EBS volume (e.g. standard, gp2, gp3, io1)"
|
|
|
|
default = "gp3"
|
2018-03-29 00:24:07 -07:00
|
|
|
}
|
|
|
|
|
2018-10-15 09:59:35 -05:00
|
|
|
variable "disk_iops" {
|
2019-09-29 11:14:36 -07:00
|
|
|
type = number
|
2021-12-07 16:52:55 -08:00
|
|
|
description = "IOPS of the EBS volume (e.g. 3000)"
|
|
|
|
default = 3000
|
2018-10-15 09:59:35 -05:00
|
|
|
}
|
|
|
|
|
2018-04-29 13:19:00 -07:00
|
|
|
variable "worker_price" {
|
2019-09-29 11:14:36 -07:00
|
|
|
type = number
|
|
|
|
description = "Spot price in USD for worker instances or 0 to use on-demand instances"
|
|
|
|
default = 0
|
2018-04-29 13:19:00 -07:00
|
|
|
}
|
|
|
|
|
2019-03-31 23:22:47 -07:00
|
|
|
variable "worker_target_groups" {
|
2019-05-27 20:42:48 -07:00
|
|
|
type = list(string)
|
2019-03-31 23:22:47 -07:00
|
|
|
description = "Additional target group ARNs to which worker instances should be added"
|
|
|
|
default = []
|
|
|
|
}
|
|
|
|
|
2020-03-29 11:46:22 -07:00
|
|
|
variable "controller_snippets" {
|
2019-05-27 20:42:48 -07:00
|
|
|
type = list(string)
|
2018-02-20 08:36:21 -08:00
|
|
|
description = "Controller Container Linux Config snippets"
|
|
|
|
default = []
|
|
|
|
}
|
|
|
|
|
2020-03-29 11:46:22 -07:00
|
|
|
variable "worker_snippets" {
|
2019-05-27 20:42:48 -07:00
|
|
|
type = list(string)
|
2018-02-20 08:36:21 -08:00
|
|
|
description = "Worker Container Linux Config snippets"
|
|
|
|
default = []
|
|
|
|
}
|
|
|
|
|
2018-03-25 21:36:10 -07:00
|
|
|
# configuration
|
|
|
|
|
|
|
|
variable "ssh_authorized_key" {
|
2019-05-27 20:42:48 -07:00
|
|
|
type = string
|
2018-03-25 21:36:10 -07:00
|
|
|
description = "SSH public key for user 'core'"
|
|
|
|
}
|
2017-09-17 21:40:33 -07:00
|
|
|
|
|
|
|
variable "networking" {
|
2019-05-27 20:42:48 -07:00
|
|
|
type = string
|
2022-02-07 07:44:09 -08:00
|
|
|
description = "Choice of networking provider (flannel, calico, or cilium)"
|
|
|
|
default = "cilium"
|
2017-09-17 21:40:33 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "network_mtu" {
|
2019-09-29 11:14:36 -07:00
|
|
|
type = number
|
2017-09-17 21:40:33 -07:00
|
|
|
description = "CNI interface MTU (applies to calico only). Use 8981 if using instances types with Jumbo frames."
|
2019-09-29 11:14:36 -07:00
|
|
|
default = 1480
|
2017-09-17 21:40:33 -07:00
|
|
|
}
|
|
|
|
|
2018-03-25 21:36:10 -07:00
|
|
|
variable "host_cidr" {
|
2019-05-27 20:42:48 -07:00
|
|
|
type = string
|
2019-09-29 11:14:36 -07:00
|
|
|
description = "CIDR IPv4 range to assign to EC2 nodes"
|
2018-03-25 21:36:10 -07:00
|
|
|
default = "10.0.0.0/16"
|
|
|
|
}
|
|
|
|
|
2017-09-17 21:40:33 -07:00
|
|
|
variable "pod_cidr" {
|
2019-05-27 20:42:48 -07:00
|
|
|
type = string
|
2019-09-29 11:14:36 -07:00
|
|
|
description = "CIDR IPv4 range to assign Kubernetes pods"
|
2017-09-17 21:40:33 -07:00
|
|
|
default = "10.2.0.0/16"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "service_cidr" {
|
2019-11-13 23:44:02 -08:00
|
|
|
type = string
|
2017-09-17 21:40:33 -07:00
|
|
|
description = <<EOD
|
|
|
|
CIDR IPv4 range to assign Kubernetes services.
|
2018-07-01 19:41:57 -07:00
|
|
|
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
2017-09-17 21:40:33 -07:00
|
|
|
EOD
|
2019-11-13 23:44:02 -08:00
|
|
|
default = "10.3.0.0/16"
|
2017-09-17 21:40:33 -07:00
|
|
|
}
|
2017-12-09 13:36:59 -08:00
|
|
|
|
2018-11-19 22:45:02 -08:00
|
|
|
variable "enable_reporting" {
|
2019-11-13 23:44:02 -08:00
|
|
|
type = bool
|
2018-11-19 22:45:02 -08:00
|
|
|
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
2019-11-13 23:44:02 -08:00
|
|
|
default = false
|
2018-11-19 22:45:02 -08:00
|
|
|
}
|
2019-04-07 02:29:07 -07:00
|
|
|
|
|
|
|
variable "enable_aggregation" {
|
2019-11-13 23:44:02 -08:00
|
|
|
type = bool
|
2021-12-09 17:25:35 -08:00
|
|
|
description = "Enable the Kubernetes Aggregation Layer"
|
|
|
|
default = true
|
2019-04-07 02:29:07 -07:00
|
|
|
}
|
2019-05-27 20:42:48 -07:00
|
|
|
|
2019-09-29 00:59:24 +03:00
|
|
|
variable "worker_node_labels" {
|
2019-11-13 23:44:02 -08:00
|
|
|
type = list(string)
|
2019-09-28 15:01:14 -07:00
|
|
|
description = "List of initial worker node labels"
|
2019-11-13 23:44:02 -08:00
|
|
|
default = []
|
2019-09-29 00:59:24 +03:00
|
|
|
}
|
|
|
|
|
2019-09-29 11:14:36 -07:00
|
|
|
# unofficial, undocumented, unsupported
|
|
|
|
|
|
|
|
variable "cluster_domain_suffix" {
|
2019-11-13 23:44:02 -08:00
|
|
|
type = string
|
2019-09-29 11:14:36 -07: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-13 23:44:02 -08:00
|
|
|
default = "cluster.local"
|
2019-09-29 11:14:36 -07:00
|
|
|
}
|
|
|
|
|
2022-01-14 09:59:11 -08: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."
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-11 12:08:56 -07: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 = []
|
|
|
|
}
|