-
Notifications
You must be signed in to change notification settings - Fork 2
/
variables.tf
236 lines (207 loc) · 6.79 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
227
228
229
230
231
232
233
234
235
236
variable "name" {
description = "Specifies the cluster name"
type = string
nullable = false
}
variable "name_postfix" {
description = "Specifies the cluster name postfix"
type = string
default = null
}
variable "region" {
description = "Specifies the region in which to create the CCE cluster resource, if omitted, the provider-level region will be used"
type = string
default = null
}
variable "availability_zones" {
description = "Specifies the availability zone of the master node, if omitted, AZ calculates automatically"
type = list(string)
default = []
validation {
condition = length(var.availability_zones) <= 1 || length(var.availability_zones) == 3
error_message = "Specify one or three availability zones."
}
}
variable "flavor_id" {
description = <<DES
Specifies the cluster specifications:
* `cce.s1.small`: small-scale single cluster (up to 50 nodes);
* `cce.s1.medium`: medium-scale single cluster (up to 200 nodes);
* `cce.s2.small`: small-scale HA cluster (up to 50 nodes);
* `cce.s2.medium`: medium-scale HA cluster (up to 200 nodes);
* `cce.s2.large`: large-scale HA cluster (up to 1000 nodes);
* `cce.s2.xlarge`: large-scale HA cluster (up to 2000 nodes).
DES
type = string
default = "cce.s1.small"
validation {
condition = contains(["cce.s1.small", "cce.s1.medium", "cce.s2.small", "cce.s2.medium", "cce.s2.large", "cce.s2.xlarge"], var.flavor_id)
error_message = "Valid values for flavor id are 'cce.s1.small', 'cce.s1.medium', 'cce.s2.small', 'cce.s2.medium', 'cce.s2.large', 'cce.s2.xlarge'."
}
}
variable "vpc_id" {
description = "Specifies the VPC ID"
type = string
nullable = false
}
variable "subnet_id" {
description = "Specifies the network ID of a subnet"
type = string
nullable = false
}
variable "container_network_type" {
description = <<DES
Specifies the container network type:
* `overlay_l2`: An overlay_l2 network built for containers by using Open vSwitch(OVS);
* `vpc-router`: An vpc-router network built for containers by using ipvlan and custom VPC routes;
* `eni`: A Yangtse network built for CCE Turbo cluster. The container network deeply integrates the native ENI
capability of VPC, uses the VPC CIDR block to allocate container addresses, and supports direct connections
between ELB and containers to provide high performance.
DES
type = string
default = "overlay_l2"
}
variable "cluster_version" {
description = "Specifies the cluster version"
type = string
default = "v1.23"
}
variable "cluster_type" {
description = "Specifies the cluster type"
type = string
default = "VirtualMachine"
validation {
condition = contains(["VirtualMachine", "ARM64"], var.cluster_type)
error_message = "Valid values for the cluster type are 'VirtualMachine', 'ARM64'."
}
}
variable "description" {
description = "Specifies the cluster description"
type = string
default = null
}
variable "cce_public" {
description = "Enable public address for Kubernetes API"
type = bool
default = false
}
variable "container_network_cidr" {
description = "Specifies the container network segment"
type = string
default = null
}
variable "service_network_cidr" {
description = "Specifies the service network segment"
type = string
default = null
}
variable "eni_subnet_id" {
description = "Specifies the IPv4 subnet ID of the subnet where the ENI resides, specified when creating a CCE Turbo cluster"
type = string
default = null
}
variable "eni_subnet_cidr" {
description = "Specifies the ENI network segment, specified when creating a CCE Turbo cluster"
type = string
default = null
}
variable "authentication_mode" {
description = "Specifies the authentication mode of the cluster"
type = string
default = "rbac"
validation {
condition = contains(["rbac", "authenticating_proxy"], var.authentication_mode)
error_message = "Possible values are 'rbac' and 'authenticating_proxy'."
}
}
variable "authenticating_proxy" {
description = <<DES
Specifies the Certificate provided for the authenticating_proxy mode.
The input value can be a Base64 encoded string or not.
* `ca` - CA root certificate;
* `cert` - Client certificate;
* `private_key` - Private Key of the client certificate.
DES
type = object({
ca = optional(string)
cert = optional(string)
private_key = optional(string)
})
default = {}
}
variable "kube_proxy_mode" {
description = <<DES
Specifies the service forwarding mode:
* `iptables` - Traditional kube-proxy uses iptables rules to implement service load balancing;
* `ipvs` - Optimized kube-proxy mode with higher throughput and faster speed.
DES
type = string
default = "iptables"
validation {
condition = contains(["iptables", "ipvs"], var.kube_proxy_mode)
error_message = "Possible values are 'iptables' and 'ipvs'."
}
}
variable "extend_param" {
description = "Specifies the extended parameter"
type = map(string)
default = {}
}
variable "delete_all" {
description = "Specified whether to delete all associated storage resources when deleting the CCE cluster"
type = string
default = "false"
validation {
condition = contains(["true", "try", "false"], var.delete_all)
error_message = "Valid values are 'true', 'try' and 'false'."
}
}
variable "delete" {
description = <<DES
Specified whether to delete associated resources when deleting the CCE cluster:
`evs` - EVS disks;
`obs` - OBS buckets;
`sfs` - SFS file systems;
`efs` - SFS Turbo file systems;
`eni` - Network interfaces;
`net` - Networks.
DES
type = object({
evs = optional(string, "false")
eni = optional(string, "false")
obs = optional(string, "false")
sfs = optional(string, "false")
efs = optional(string, "false")
net = optional(string, "false")
})
default = {}
}
variable "hibernate" {
description = "Specifies whether to hibernate the CCE cluster"
type = bool
default = false
}
variable "cluster_eip" {
description = <<DESCRIPTION
EIP configuration
Possible values for type are '5_bgp' (dynamic BGP) and '5_sbgp' (static BGP)
DESCRIPTION
type = object({
type = optional(string, "5_bgp")
ip_address = optional(string, null)
ip_version = optional(number, 4)
bandwidth = object({
size = optional(number, 5)
share_type = optional(string, "PER")
charge_mode = optional(string, "traffic")
})
})
default = {
bandwidth = {}
}
}
variable "tags" {
description = "Specifies the key/value pairs to associate with the resources"
type = map(string)
default = {}
}