2018-03-04 01:21:38 +01:00
|
|
|
variable "name" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = string
|
2018-03-26 06:36:10 +02:00
|
|
|
description = "Unique name for the worker pool"
|
2018-03-04 01:21:38 +01:00
|
|
|
}
|
|
|
|
|
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 = "Must be set to `cluster_name of cluster`"
|
2017-06-27 06:55:39 +02:00
|
|
|
}
|
|
|
|
|
2018-03-26 06:36:10 +02:00
|
|
|
# Google Cloud
|
|
|
|
|
2018-03-04 01:21:38 +01:00
|
|
|
variable "region" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = string
|
2018-03-26 06:36:10 +02:00
|
|
|
description = "Must be set to `region` of cluster"
|
2017-06-27 06:55:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "network" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = string
|
2018-03-26 06:36:10 +02:00
|
|
|
description = "Must be set to `network_name` output by cluster"
|
2017-06-27 06:55:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# instances
|
|
|
|
|
2019-05-28 01:33:21 +02:00
|
|
|
variable "worker_count" {
|
2019-10-01 07:04:35 +02:00
|
|
|
type = number
|
2017-06-27 06:55:39 +02:00
|
|
|
description = "Number of worker compute instances the instance group should manage"
|
2019-10-01 07:04:35 +02:00
|
|
|
default = 1
|
2017-06-27 06:55:39 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "machine_type" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = string
|
2017-06-27 06:55:39 +02:00
|
|
|
description = "Machine type for compute instances (e.g. 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
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2017-06-27 06:55:39 +02:00
|
|
|
}
|
|
|
|
|
2024-09-20 23:31:17 +02:00
|
|
|
variable "disk_type" {
|
|
|
|
type = string
|
|
|
|
description = "Type of managed disk"
|
|
|
|
default = "pd-standard"
|
|
|
|
validation {
|
|
|
|
condition = contains(["pd-standard", "pd-ssd", "pd-balanced"], var.disk_type)
|
|
|
|
error_message = "The disk_type must be pd-standard, pd-ssd or pd-balanced."
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-06-27 06:55:39 +02:00
|
|
|
variable "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 instances 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 "snippets" {
|
2019-11-14 08:44:02 +01:00
|
|
|
type = list(string)
|
2019-09-29 00:01:14 +02:00
|
|
|
description = "Container Linux Config snippets"
|
2019-11-14 08:44:02 +01:00
|
|
|
default = []
|
2019-09-29 00:01:14 +02:00
|
|
|
}
|
|
|
|
|
2017-06-27 06:55:39 +02:00
|
|
|
# configuration
|
|
|
|
|
2018-03-04 01:21:38 +01:00
|
|
|
variable "kubeconfig" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = string
|
2018-03-26 06:36:10 +02:00
|
|
|
description = "Must be set to `kubeconfig` output by cluster"
|
2018-03-04 01:21:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "ssh_authorized_key" {
|
2019-05-28 06:14:25 +02:00
|
|
|
type = string
|
2018-02-20 17:36:21 +01:00
|
|
|
description = "SSH public key for user 'core'"
|
2018-03-04 01:21:38 +01:00
|
|
|
}
|
|
|
|
|
2017-06-27 06:55:39 +02:00
|
|
|
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
|
|
|
}
|
|
|
|
|
2019-09-28 23:59:24 +02:00
|
|
|
variable "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 node labels"
|
2019-11-14 08:44:02 +01:00
|
|
|
default = []
|
2018-02-20 17:36:21 +01:00
|
|
|
}
|
|
|
|
|
2021-04-11 21:08:56 +02:00
|
|
|
variable "node_taints" {
|
|
|
|
type = list(string)
|
|
|
|
description = "List of initial node taints"
|
|
|
|
default = []
|
|
|
|
}
|
|
|
|
|
2024-08-03 00:01:48 +02:00
|
|
|
# advanced
|
2019-10-01 07:04:35 +02:00
|
|
|
|
2018-03-03 02:26:51 +01:00
|
|
|
variable "accelerator_type" {
|
2019-11-14 08:44:02 +01:00
|
|
|
type = string
|
|
|
|
default = ""
|
2018-03-03 02:26:51 +01:00
|
|
|
description = "Google Compute Engine accelerator type (e.g. nvidia-tesla-k80, see gcloud compute accelerator-types list)"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "accelerator_count" {
|
2019-11-14 08:44:02 +01:00
|
|
|
type = string
|
|
|
|
default = "0"
|
2018-03-03 02:26:51 +01:00
|
|
|
description = "Number of compute engine accelerators"
|
|
|
|
}
|