-
Notifications
You must be signed in to change notification settings - Fork 4
/
variables.tf
226 lines (197 loc) · 5.94 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
################################################################################
# GLOBAL
################################################################################
variable "install_clickhouse_cluster" {
description = "Enable the installation of the ClickHouse cluster"
type = bool
default = true
}
variable "install_clickhouse_operator" {
description = "Enable the installation of the Altinity Kubernetes operator for ClickHouse"
type = bool
default = true
}
variable "aws_profile" {
description = "AWS profile of deployed cluster."
type = string
default = null
}
################################################################################
# ClickHouse Operator
################################################################################
variable "clickhouse_operator_namespace" {
description = "Namespace to install the Altinity Kubernetes operator for ClickHouse"
default = "kube-system"
type = string
}
variable "clickhouse_operator_version" {
description = "Version of the Altinity Kubernetes operator for ClickHouse"
default = "0.23.4"
type = string
}
################################################################################
# ClickHouse Cluster
################################################################################
variable "clickhouse_cluster_name" {
description = "Name of the ClickHouse cluster"
default = "dev"
type = string
}
variable "clickhouse_cluster_namespace" {
description = "Namespace of the ClickHouse cluster"
default = "clickhouse"
type = string
}
variable "clickhouse_cluster_user" {
description = "ClickHouse user"
default = "test"
type = string
}
variable "clickhouse_cluster_password" {
description = "ClickHouse password"
type = string
default = null
}
variable "clickhouse_cluster_enable_loadbalancer" {
description = "Enable waiting for the ClickHouse LoadBalancer to receive a hostname"
type = bool
default = false
}
variable "clickhouse_cluster_chart_version" {
description = "Version of the ClickHouse cluster helm chart version"
default = "0.1.5"
type = string
}
variable "clickhouse_keeper_chart_version" {
description = "Version of the ClickHouse Keeper cluster helm chart version"
default = "0.1.4"
type = string
}
################################################################################
# EKS
################################################################################
variable "eks_region" {
description = "The AWS region"
type = string
default = "us-east-1"
}
variable "eks_cluster_name" {
description = "The name of the cluster"
type = string
default = "clickhouse-cluster"
}
variable "eks_cluster_version" {
description = "Version of the cluster"
type = string
default = "1.29"
}
variable "eks_autoscaler_version" {
description = "Version of AWS Autoscaler"
type = string
default = "1.29.2"
}
variable "eks_autoscaler_replicas" {
description = "Number of replicas for AWS Autoscaler"
type = number
default = 1
}
variable "autoscaler_replicas" {
description = "Autoscaler replicas"
type = number
default = 1
}
variable "eks_tags" {
description = "A map of AWS tags"
type = map(string)
default = {}
}
variable "eks_cidr" {
description = "CIDR block"
type = string
default = "10.0.0.0/16"
}
variable "eks_node_pools" {
description = "Node pools configuration. The module will create a node pool for each combination of instance type and subnet. For example, if you have 3 subnets and 2 instance types, this module will create 6 different node pools."
type = list(object({
name = string
instance_type = string
ami_type = optional(string)
disk_size = optional(number)
desired_size = number
max_size = number
min_size = number
zones = optional(list(string))
labels = optional(map(string))
taints = optional(list(object({
key = string
value = string
effect = string
})), [])
}))
default = [
{
name = "clickhouse"
instance_type = "m6i.large"
ami_type = "AL2_x86_64"
desired_size = 0
disk_size = 20
max_size = 10
min_size = 0
zones = ["us-east-1a", "us-east-1b", "us-east-1c"]
},
{
name = "system"
instance_type = "t3.large"
ami_type = "AL2_x86_64"
disk_size = 20
desired_size = 1
max_size = 10
min_size = 0
zones = ["us-east-1a"]
}
]
validation {
condition = alltrue([
for np in var.eks_node_pools :
startswith(np.name, "clickhouse") || startswith(np.name, "system")
])
error_message = "Each node pool name must start with either 'clickhouse' or 'system' prefix."
}
}
variable "eks_enable_nat_gateway" {
description = "Enable NAT Gateway and private subnets (recommeded)"
type = bool
default = true
}
variable "eks_private_cidr" {
description = "List of private CIDR. When set, the number of private CIDRs must match the number of availability zones"
type = list(string)
default = [
"10.0.1.0/24",
"10.0.2.0/24",
"10.0.3.0/24"
]
}
variable "eks_public_cidr" {
description = "List of public CIDR. When set, The number of public CIDRs must match the number of availability zones"
type = list(string)
default = [
"10.0.101.0/24",
"10.0.102.0/24",
"10.0.103.0/24"
]
}
variable "eks_availability_zones" {
description = ""
type = list(string)
default = [
"us-east-1a",
"us-east-1b",
"us-east-1c"
]
}
variable "eks_public_access_cidrs" {
description = "List of CIDRs for public access, use this variable to restrict access to the EKS control plane."
type = list(string)
default = ["0.0.0.0/0"]
}