2017-07-29 20:35:53 +02:00
|
|
|
variable "cluster_name" {
|
2019-05-28 00:37:36 +02:00
|
|
|
type = string
|
2018-03-26 06:36:10 +02:00
|
|
|
description = "Unique cluster name (prepended to dns_zone)"
|
2017-07-29 20:35:53 +02:00
|
|
|
}
|
|
|
|
|
2018-03-26 06:36:10 +02:00
|
|
|
# Digital Ocean
|
|
|
|
|
2017-07-29 20:35:53 +02:00
|
|
|
variable "region" {
|
2019-05-28 00:37:36 +02:00
|
|
|
type = string
|
2017-07-29 20:35:53 +02:00
|
|
|
description = "Digital Ocean region (e.g. nyc1, sfo2, fra1, tor1)"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "dns_zone" {
|
2019-05-28 00:37:36 +02:00
|
|
|
type = string
|
2017-08-23 07:56:52 +02:00
|
|
|
description = "Digital Ocean domain (i.e. DNS zone) (e.g. do.example.com)"
|
2017-07-29 20:35:53 +02:00
|
|
|
}
|
|
|
|
|
2018-03-26 06:36:10 +02:00
|
|
|
# instances
|
2017-07-29 20:35:53 +02:00
|
|
|
|
|
|
|
variable "controller_count" {
|
2019-10-03 06:48:24 +02:00
|
|
|
type = number
|
2018-03-26 06:36:10 +02:00
|
|
|
description = "Number of controllers (i.e. masters)"
|
2019-10-03 06:48:24 +02:00
|
|
|
default = 1
|
2017-07-29 20:35:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
variable "worker_count" {
|
2019-10-03 06:48:24 +02:00
|
|
|
type = number
|
2017-07-29 20:35:53 +02:00
|
|
|
description = "Number of workers"
|
2019-10-03 06:48:24 +02:00
|
|
|
default = 1
|
2017-07-29 20:35:53 +02:00
|
|
|
}
|
|
|
|
|
2018-03-26 06:36:10 +02:00
|
|
|
variable "controller_type" {
|
2019-05-28 00:37:36 +02:00
|
|
|
type = string
|
2018-03-26 06:36:10 +02:00
|
|
|
description = "Droplet type for controllers (e.g. s-2vcpu-2gb, s-2vcpu-4gb, s-4vcpu-8gb)."
|
2019-10-03 06:48:24 +02:00
|
|
|
default = "s-2vcpu-2gb"
|
2018-03-26 06:36:10 +02:00
|
|
|
}
|
|
|
|
|
2017-08-23 07:56:52 +02:00
|
|
|
variable "worker_type" {
|
2019-05-28 00:37:36 +02:00
|
|
|
type = string
|
2019-06-01 22:49:56 +02:00
|
|
|
description = "Droplet type for workers (e.g. s-1vcpu-2gb, s-2vcpu-2gb)"
|
2019-10-03 06:48:24 +02:00
|
|
|
default = "s-1vcpu-2gb"
|
2017-08-23 07:56:52 +02:00
|
|
|
}
|
|
|
|
|
2020-03-25 07:45:31 +01:00
|
|
|
variable "os_image" {
|
2019-05-28 00:37:36 +02:00
|
|
|
type = string
|
2020-09-25 04:55:32 +02:00
|
|
|
description = "Flatcar Linux image for instances (e.g. custom-image-id)"
|
2017-07-29 20:35:53 +02:00
|
|
|
}
|
|
|
|
|
2020-03-29 20:46:22 +02:00
|
|
|
variable "controller_snippets" {
|
2019-05-28 00:37:36 +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 00:37:36 +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_fingerprints" {
|
2019-05-28 00:37:36 +02:00
|
|
|
type = list(string)
|
2018-03-26 06:36:10 +02:00
|
|
|
description = "SSH public key fingerprints. (e.g. see `ssh-add -l -E md5`)"
|
|
|
|
}
|
2017-07-29 20:35:53 +02:00
|
|
|
|
2019-05-06 09:38:23 +02:00
|
|
|
variable "networking" {
|
2019-05-28 00:37:36 +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
|
|
|
}
|
|
|
|
|
2017-07-29 20:35:53 +02:00
|
|
|
variable "pod_cidr" {
|
2019-05-28 00:37:36 +02:00
|
|
|
type = string
|
2019-10-03 06:48:24 +02:00
|
|
|
description = "CIDR IPv4 range to assign Kubernetes pods"
|
2017-07-29 20:35:53 +02:00
|
|
|
default = "10.2.0.0/16"
|
|
|
|
}
|
|
|
|
|
|
|
|
variable "service_cidr" {
|
2019-11-14 08:44:02 +01:00
|
|
|
type = string
|
2017-07-29 20:35:53 +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-07-29 20:35:53 +02:00
|
|
|
EOD
|
2019-11-14 08:44:02 +01:00
|
|
|
default = "10.3.0.0/16"
|
2017-07-29 20:35:53 +02:00
|
|
|
}
|
2017-12-09 22:36:59 +01:00
|
|
|
|
2024-08-03 00:01:48 +02:00
|
|
|
# advanced
|
2019-05-28 00:37:36 +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))
|
Introduce the component system for managing pre-installed addons
* Previously: Typhoon provisions clusters with kube-system components
like CoreDNS, kube-proxy, and a chosen CNI provider (among flannel,
Calico, or Cilium) pre-installed. This is convenient since clusters
come with "batteries included". But it also means upgrading these
components is generally done in lock-step, by upgrading to a new
Typhoon / Kubernetes release
* It can be valuable to manage these components with a separate
plan/apply process or through automations and deploy systems. For
example, this allows managing CoreDNS separately from the cluster's
lifecycle.
* These "components" will continue to be pre-installed by default,
but a new `components` variable allows them to be disabled and
managed as "addons", components you apply after cluster creation
and manage on a rolling basis. For some of these, we may provide
Terraform modules to aide in managing these components.
```
module "cluster" {
# defaults
components = {
enable = true
coredns = {
enable = true
}
kube_proxy = {
enable = true
}
# Only the CNI set in var.networking will be installed
flannel = {
enable = true
}
calico = {
enable = true
}
cilium = {
enable = true
}
}
}
```
An earlier variable `install_container_networking = true/false` has
been removed, since it can now be achieved with this more extensible
and general components mechanism by setting the chosen networking
provider enable field to false.
2024-05-19 00:05:33 +02:00
|
|
|
flannel = optional(map(any))
|
|
|
|
calico = optional(map(any))
|
|
|
|
cilium = optional(map(any))
|
2024-05-13 06:03:40 +02:00
|
|
|
})
|
|
|
|
default = null
|
|
|
|
}
|