2017-06-27 06:55:39 +02:00
|
|
|
variable "cluster_name" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = string
|
2018-03-26 06:36:10 +02:00
|
|
|
description = "Unique cluster name (prepended to dns_zone)"
|
2017-06-27 06:55:39 +02:00
|
|
|
}
|
|
|
|
|
2018-03-26 06:36:10 +02:00
|
|
|
# Google Cloud
|
|
|
|
|
2017-11-04 18:57:12 +01:00
|
|
|
variable "region" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = string
|
2017-11-04 18:57:12 +01:00
|
|
|
description = "Google Cloud Region (e.g. us-central1, see `gcloud compute regions list`)"
|
|
|
|
}
|
|
|
|
|
2017-08-13 22:02:52 +02:00
|
|
|
variable "dns_zone" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = string
|
2018-03-26 06:36:10 +02:00
|
|
|
description = "Google Cloud DNS Zone (e.g. google-cloud.example.com)"
|
2017-06-27 06:55:39 +02:00
|
|
|
}
|
|
|
|
|
2017-08-13 22:02:52 +02:00
|
|
|
variable "dns_zone_name" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = string
|
2018-03-26 06:36:10 +02:00
|
|
|
description = "Google Cloud DNS Zone name (e.g. example-zone)"
|
2017-06-27 06:55:39 +02:00
|
|
|
}
|
|
|
|
|
2018-03-26 06:36:10 +02:00
|
|
|
# instances
|
|
|
|
|
|
|
|
variable "controller_count" {
|
2019-10-01 07:04:35 +02:00
|
|
|
type = number
|
2018-03-26 06:36:10 +02:00
|
|
|
description = "Number of controllers (i.e. masters)"
|
2019-10-01 07:04:35 +02:00
|
|
|
default = 1
|
2018-03-26 06:36:10 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "worker_count" {
|
2019-10-01 07:04:35 +02:00
|
|
|
type = number
|
2018-03-26 06:36:10 +02:00
|
|
|
description = "Number of workers"
|
2019-10-01 07:04:35 +02:00
|
|
|
default = 1
|
2017-06-27 06:55:39 +02:00
|
|
|
}
|
|
|
|
|
2018-04-12 07:19:58 +02:00
|
|
|
variable "controller_type" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = string
|
2018-03-26 07:11:18 +02:00
|
|
|
description = "Machine type for controllers (see `gcloud compute machine-types list`)"
|
2019-10-01 07:04:35 +02:00
|
|
|
default = "n1-standard-1"
|
2018-03-26 07:11:18 +02:00
|
|
|
}
|
|
|
|
|
2018-04-12 07:19:58 +02:00
|
|
|
variable "worker_type" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = string
|
2018-03-26 07:11:18 +02:00
|
|
|
description = "Machine type for controllers (see `gcloud compute machine-types list`)"
|
2019-10-01 07:04:35 +02:00
|
|
|
default = "n1-standard-1"
|
2017-06-27 06:55:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "os_image" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = string
|
2022-01-29 05:59:15 +01:00
|
|
|
description = "Flatcar Linux image for compute instances (flatcar-stable, flatcar-beta, flatcar-alpha)"
|
|
|
|
default = "flatcar-stable"
|
|
|
|
|
|
|
|
validation {
|
|
|
|
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."
|
|
|
|
}
|
2017-06-27 06:55:39 +02:00
|
|
|
}
|
|
|
|
|
2018-03-26 07:04:14 +02:00
|
|
|
variable "disk_size" {
|
2019-10-01 07:04:35 +02:00
|
|
|
type = number
|
2018-03-26 07:04:14 +02:00
|
|
|
description = "Size of the disk in GB"
|
2021-04-26 20:04:30 +02:00
|
|
|
default = 30
|
2018-03-26 07:04:14 +02:00
|
|
|
}
|
|
|
|
|
2017-06-27 06:55:39 +02:00
|
|
|
variable "worker_preemptible" {
|
2019-10-01 07:04:35 +02:00
|
|
|
type = bool
|
2017-06-27 06:55:39 +02:00
|
|
|
description = "If enabled, Compute Engine will terminate workers randomly within 24 hours"
|
2019-10-01 07:04:35 +02:00
|
|
|
default = false
|
2017-06-27 06:55:39 +02:00
|
|
|
}
|
|
|
|
|
2020-03-29 20:46:22 +02:00
|
|
|
variable "controller_snippets" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = list(string)
|
2018-02-20 17:36:21 +01:00
|
|
|
description = "Controller Container Linux Config snippets"
|
|
|
|
default = []
|
|
|
|
}
|
|
|
|
|
2020-03-29 20:46:22 +02:00
|
|
|
variable "worker_snippets" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = list(string)
|
2018-02-20 17:36:21 +01:00
|
|
|
description = "Worker Container Linux Config snippets"
|
|
|
|
default = []
|
|
|
|
}
|
|
|
|
|
2018-03-26 06:36:10 +02:00
|
|
|
# configuration
|
|
|
|
|
|
|
|
variable "ssh_authorized_key" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = string
|
2018-03-26 06:36:10 +02:00
|
|
|
description = "SSH public key for user 'core'"
|
|
|
|
}
|
2017-06-27 06:55:39 +02:00
|
|
|
|
2017-09-05 06:14:05 +02:00
|
|
|
variable "networking" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = string
|
2019-10-01 07:04:35 +02:00
|
|
|
description = "Choice of networking provider (flannel or calico)"
|
2017-09-12 18:16:58 +02:00
|
|
|
default = "calico"
|
2017-09-05 06:14:05 +02:00
|
|
|
}
|
|
|
|
|
2017-06-27 06:55:39 +02:00
|
|
|
variable "pod_cidr" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = string
|
2019-10-01 07:04:35 +02:00
|
|
|
description = "CIDR IPv4 range to assign Kubernetes pods"
|
2017-06-27 06:55:39 +02:00
|
|
|
default = "10.2.0.0/16"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "service_cidr" {
|
2019-11-14 08:44:02 +01:00
|
|
|
type = string
|
2017-06-27 06:55:39 +02:00
|
|
|
description = <<EOD
|
2018-03-26 06:36:10 +02:00
|
|
|
CIDR IPv4 range to assign Kubernetes services.
|
2018-07-02 04:41:57 +02:00
|
|
|
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
2017-06-27 06:55:39 +02:00
|
|
|
EOD
|
2019-11-14 08:44:02 +01:00
|
|
|
default = "10.3.0.0/16"
|
2017-06-27 06:55:39 +02:00
|
|
|
}
|
2017-12-09 22:36:59 +01: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:14:25 +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
|
|
|
}
|
|
|
|
|
2019-10-01 07:04:35 +02:00
|
|
|
# unofficial, undocumented, unsupported
|
|
|
|
|
|
|
|
variable "cluster_domain_suffix" {
|
2019-11-14 08:44:02 +01:00
|
|
|
type = string
|
2019-10-01 07:04:35 +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:04:35 +02:00
|
|
|
}
|
|
|
|
|
2021-04-11 21:08:56 +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 = []
|
|
|
|
}
|