2018-03-26 06:36:10 +02:00
variable " cluster_name " {
2019-05-29 04:19:23 +02:00
type = string
2018-03-26 06:36:10 +02:00
description = " Unique cluster name "
}
# bare-metal
2017-07-25 08:16:34 +02:00
variable " matchbox_http_endpoint " {
2019-05-29 04:19:23 +02:00
type = string
2017-07-25 08:16:34 +02:00
description = " Matchbox HTTP read-only endpoint (e.g. http://matchbox.example.com:8080) "
}
2018-05-17 07:37:37 +02:00
variable " os_channel " {
2019-05-29 04:19:23 +02:00
type = string
2021-02-21 00:36:52 +01:00
description = " Channel for a Flatcar Linux (flatcar-stable, flatcar-beta, flatcar-alpha) "
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_channel )
error_message = " The os_channel must be flatcar-stable, flatcar-beta, or flatcar-alpha. "
2020-11-17 20:30:01 +01:00
}
2017-07-25 08:16:34 +02:00
}
2018-05-17 07:37:37 +02:00
variable " os_version " {
2019-05-29 04:19:23 +02:00
type = string
2020-10-21 09:02:29 +02:00
description = " Version of Flatcar Linux to PXE and install (e.g. 2079.5.1) "
2017-07-25 08:16:34 +02:00
}
2018-03-26 06:36:10 +02:00
# machines
2017-07-25 08:16:34 +02:00
2019-10-06 21:57:15 +02:00
variable " controllers " {
type = list ( object ( {
2019-11-14 08:44:02 +01:00
name = string
mac = string
2019-10-06 21:57:15 +02:00
domain = string
} ) )
description = < < EOD
List of controller machine details ( unique name , identifying MAC address , FQDN )
[ { name = " node1 " , mac = " 52:54:00:a1:9c:ae " , domain = " node1.example.com " } ]
EOD
2017-07-25 08:16:34 +02:00
}
2019-10-06 21:57:15 +02:00
variable " workers " {
type = list ( object ( {
2019-11-14 08:44:02 +01:00
name = string
mac = string
2019-10-06 21:57:15 +02:00
domain = string
} ) )
description = < < EOD
List of worker machine details ( unique name , identifying MAC address , FQDN )
[
{ name = " node2 " , mac = " 52:54:00:b2:2f:86 " , domain = " node2.example.com " } ,
{ name = " node3 " , mac = " 52:54:00:c3:61:77 " , domain = " node3.example.com " }
]
EOD
2023-03-01 23:27:29 +01:00
default = [ ]
2018-07-26 07:44:07 +02:00
}
2020-03-29 20:46:22 +02:00
variable " snippets " {
2019-05-29 04:19:23 +02:00
type = map ( list ( string ) )
2018-07-27 08:31:08 +02:00
description = " Map from machine names to lists of Container Linux Config snippets "
2018-08-22 06:59:55 +02:00
default = { }
2017-07-25 08:16:34 +02:00
}
2023-08-03 14:12:57 +02:00
variable " install_snippets " {
type = map ( list ( string ) )
description = " Map from machine names to lists of Container Linux Config snippets to run during install phase "
default = { }
}
2020-03-09 04:39:18 +01:00
variable " worker_node_labels " {
2020-04-01 06:42:51 +02:00
type = map ( list ( string ) )
2020-03-09 04:39:18 +01:00
description = " Map from worker names to lists of initial node labels "
2020-04-01 06:42:51 +02:00
default = { }
2020-03-09 04:39:18 +01:00
}
variable " worker_node_taints " {
2020-04-01 06:42:51 +02:00
type = map ( list ( string ) )
2020-03-09 04:39:18 +01:00
description = " Map from worker names to lists of initial node taints "
2020-04-01 06:42:51 +02:00
default = { }
2020-03-09 04:39:18 +01:00
}
2018-03-26 06:36:10 +02:00
# configuration
2017-07-25 08:16:34 +02:00
variable " k8s_domain_name " {
2019-05-29 04:19:23 +02:00
type = string
2019-10-06 20:53:49 +02:00
description = " Controller DNS name which resolves to a controller instance. Workers and kubeconfig's will communicate with this endpoint (e.g. cluster.example.com) "
2017-07-25 08:16:34 +02:00
}
2018-03-26 06:36:10 +02:00
variable " ssh_authorized_key " {
2019-05-29 04:19:23 +02:00
type = string
2018-03-26 06:36:10 +02:00
description = " SSH public key for user 'core' "
}
2017-09-01 23:23:25 +02:00
variable " networking " {
2019-05-29 04:19:23 +02:00
type = string
2022-02-07 16:44:09 +01:00
description = " Choice of networking provider (flannel, calico, or cilium) "
default = " cilium "
2017-09-01 23:23:25 +02:00
}
2017-09-06 03:24:57 +02:00
variable " network_mtu " {
2019-10-06 20:53:49 +02:00
type = number
2017-09-06 03:24:57 +02:00
description = " CNI interface MTU (applies to calico only) "
2019-10-06 20:53:49 +02:00
default = 1480
2017-09-06 03:24:57 +02:00
}
2018-05-15 08:35:16 +02:00
variable " network_ip_autodetection_method " {
2019-05-29 04:19:23 +02:00
type = string
2019-10-06 20:53:49 +02:00
description = " Method to autodetect the host IPv4 address (applies to calico only) "
2018-05-15 08:35:16 +02:00
default = " first-found "
}
2017-07-25 08:16:34 +02:00
variable " pod_cidr " {
2019-05-29 04:19:23 +02:00
type = string
2019-10-06 20:53:49 +02:00
description = " CIDR IPv4 range to assign Kubernetes pods "
2017-07-25 08:16:34 +02:00
default = " 10.2.0.0/16 "
}
variable " service_cidr " {
2019-11-14 08:44:02 +01:00
type = string
2017-07-25 08:16:34 +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 1 st IP will be reserved for kube_apiserver , the 10 th IP will be reserved for coredns .
2017-07-25 08:16:34 +02:00
EOD
2019-11-14 08:44:02 +01:00
default = " 10.3.0.0/16 "
2017-07-25 08:16:34 +02:00
}
# optional
2019-03-10 04:34:15 +01:00
variable " download_protocol " {
2019-11-14 08:44:02 +01:00
type = string
2019-03-10 04:34:15 +01:00
description = " Protocol iPXE should use to download the kernel and initrd. Defaults to https, which requires iPXE compiled with crypto support. Unused if cached_install is true. "
2019-11-14 08:44:02 +01:00
default = " https "
2019-03-10 04:34:15 +01:00
}
2017-07-25 08:16:34 +02:00
variable " cached_install " {
2019-11-14 08:44:02 +01:00
type = bool
2020-10-21 09:02:29 +02:00
description = " Whether Flatcar Linux should PXE boot and install from matchbox /assets cache. Note that the admin must have downloaded the os_version into matchbox assets. "
2019-11-14 08:44:02 +01:00
default = false
2017-07-25 08:16:34 +02:00
}
variable " install_disk " {
2019-11-14 08:44:02 +01:00
type = string
default = " /dev/sda "
2020-10-21 09:02:29 +02:00
description = " Disk device to which the install profiles should install Flatcar Linux (e.g. /dev/sda) "
2017-07-25 08:16:34 +02:00
}
2017-10-02 18:47:44 +02:00
variable " kernel_args " {
2019-11-14 08:44:02 +01:00
type = list ( string )
2019-10-06 20:53:49 +02:00
description = " Additional kernel arguments to provide at PXE boot. "
2019-11-14 08:44:02 +01:00
default = [ ]
2017-10-02 18:47:44 +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-10-06 20:53:49 +02:00
}
2023-03-02 09:14:03 +01:00
variable " oem_type " {
type = string
description = < < EOD
An OEM type to install with flatcar - install . Find available types by looking for Flatcar image files
ending in ` image . bin . bz2 ` . The OEM identifier is contained in the filename .
E . g . , ` flatcar_production_vmware_raw_image . bin . bz2 ` leads to ` vmware_raw ` .
See : https : //www.flatcar.org/docs/latest/installing/bare-metal/installing-to-disk/#choose-a-channel
EOD
default = " "
}
2019-10-06 20:53:49 +02:00
# unofficial, undocumented, unsupported
variable " cluster_domain_suffix " {
2019-11-14 08:44:02 +01:00
type = string
2019-10-06 20:53:49 +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-04-07 11:29:07 +02:00
}
2019-05-29 04:19:23 +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
}