-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
131 lines (105 loc) · 3.68 KB
/
variables.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
variable "api_key" {
description = "The Equinix API key."
sensitive = true
type = string
}
variable "equinix_metal_project" {
description = "The Equinix project to use."
type = string
default = "Demos"
}
variable "metro" {
description = "The Equinix metro to use."
type = string
default = "ny"
}
variable "infra_name" {
description = "The name of the equinix metal infrastructure."
type = string
}
variable "server_type" {
description = "The server type to use."
type = string
default = "m3.small.x86"
}
variable "router_password" {
description = "The login password for vyos."
type = string
default = "R0uter123!"
}
variable "private_network_ipv4_cidr" {
description = "the private network IPv4 cidr block for VMs, only /24 is supported for now"
type = string
default = "192.168.1.0/24"
validation {
condition = can(regex("\\/24$", var.private_network_ipv4_cidr))
error_message = "please use ipv4 network with /24"
}
}
variable "private_network_ipv6_cidr" {
description = "the private network IPv6 cidr block for VMs, and only /112 is supported for now"
type = string
default = "fd03::/112"
validation {
condition = can(regex("\\/112$", var.private_network_ipv6_cidr))
error_message = "please use ipv6 network with /112"
}
}
variable "dns_base_domain" {
description = "base domain for the LAN network so the k8s nodes can get unique the FQDN name and resolved by the router"
type = string
default = "local"
}
variable "k8s_cluster_name" {
description = "this will be used to create the FQDN name in the DNS record to follow the OCP guide(https://docs.openshift.com/container-platform/4.11/installing/installing_bare_metal/installing-bare-metal.html#installation-dns-user-infra-example_installing-bare-metal)"
type = string
default = "liyi-test"
}
# the count number will be used to caculate the mac/ipv4/ipv6/hostname etc in local.tf of the nodes so the router can have the static mapping of the nodes,
# that's why we have limited number support
variable "k8s_master_hostname_prefix" {
description = "prefix hostname of the master nodes"
type = string
default = "k8s-masters"
}
variable "k8s_master_mac_prefix" {
description = "prefix mac address of the master nodes"
type = string
default = "52:54:00:aa:bb:a"
validation {
condition = can(regex("(?:[0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]$", var.k8s_master_mac_prefix))
error_message = "please use this format aa:bb:cc:dd:ee:ff:a as the prefix"
}
}
variable "k8s_master_count" {
description = "number of master nodes, and we only support numbers 1 or 3 for now"
type = number
default = "3"
validation {
condition = var.k8s_master_count == 1 || var.k8s_master_count == 3
error_message = "please use 1 or 3"
}
}
variable "k8s_worker_hostname_prefix" {
description = "prefix hostname of the worker nodes"
type = string
default = "k8s-workers"
}
variable "k8s_worker_mac_prefix" {
description = "prefix mac address of the worker nodes"
type = string
default = "52:54:00:aa:bb:b"
validation {
condition = can(regex("(?:[0-9A-Fa-f]{2}:){5}[0-9A-Fa-f]$", var.k8s_worker_mac_prefix))
error_message = "please use this format aa:bb:cc:dd:ee:ff:a as the prefix"
}
}
variable "k8s_worker_count" {
description = "number of worker nodes, and we only support numbers less than 9 for now"
type = number
default = "2"
validation {
condition = var.k8s_worker_count <= 9 && var.k8s_worker_count >= 1
error_message = "please use a number between 1 and 9"
}
}