-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
149 lines (134 loc) · 4.71 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
variable "k8s_version" {
description = "Version of the created K8s Cluster (see available version in Metakube)"
type = object({
major = number
minor = number
patch = optional(number)
})
default = {
major = 1
minor = 28
}
}
variable "cluster_name" {
description = "Name of the created cluster (must be unique per Metakube project)"
type = string
}
variable "dc_name" {
description = "Datacenter name at SysEleven (DBl, ...)"
type = string
default = "syseleven-dbl1"
}
variable "metakube_project_id" {
description = "The ID of the metakube project"
type = string
sensitive = true
}
variable "openstack_application_credential_id" {
description = "The OpenStack application credential ID to use for the metakube cluster"
type = string
sensitive = true
}
variable "openstack_application_credential_secret" {
description = "The OpenStack application credential to use for the metakube cluster"
type = string
sensitive = true
}
variable "openstack_network_config" {
type = object({
network_name = optional(string)
subnet_id = optional(string)
subnet_cidr = optional(string)
})
nullable = true
description = "The network configuration for the metakube cluster. Either network_name or subnet_id or subnet_cidr must be set."
validation {
condition = ((var.openstack_network_config.network_name == null && var.openstack_network_config.subnet_id == null) && var.openstack_network_config.subnet_cidr != null) || ((var.openstack_network_config.network_name != null && var.openstack_network_config.subnet_id != null) && var.openstack_network_config.subnet_cidr == null)
error_message = "Either network_name and subnet_id or subnet_cidr must be set."
}
validation {
condition = var.openstack_network_config.subnet_cidr != null ? can(regex("^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}/([1|2]+\\d|8|9)$", var.openstack_network_config.subnet_cidr)) : true
error_message = "No valid IP range in CIDR given in field openstack_network_config.subnet_cidr"
}
}
variable "syseleven_auth_realm" {
type = string
description = "The realm to use for the syseleven auth"
}
variable "cluster_update_window" {
type = object({
start = string
length = string
})
description = "The update window for the cluster. If set to null, no update window will be set."
default = null
}
variable "cidr_ranges" {
description = "All different CIDR ranges for the different needed IP ranges for a cluster"
type = object({
services_cidr = string
pods_cidr = string
})
validation {
condition = can(regex("^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}/([1|2]+\\d|8|9)$", var.cidr_ranges.services_cidr))
error_message = "No valid IP range in CIDR given in field cidr_ranges.services_cidr"
}
validation {
condition = can(regex("^((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}/([1|2]+\\d|8|9)$", var.cidr_ranges.pods_cidr))
error_message = "No valid IP range in CIDR given in field cidr_ranges.pods_cidr"
}
default = {
services_cidr = "10.240.0.0/16"
pods_cidr = "10.0.0.0/16"
}
}
variable "node_pools" {
description = "List all node pools that should be created in the cluster"
type = map(object({
replicas = object({
min = number
max = number
})
labels = optional(map(string))
os_config = object({
image = string
auto_update = bool
})
node_config = object({
flavor = string
use_floating_ip = bool
})
taints = optional(list(object({
key = string
value = string
effect = string
})))
}))
}
variable "cluster_rbac" {
type = map(list(object({
kind = string
name = string
})))
description = "The RBAC configuration for the cluster. The key is the name of the cluster role and the value is a list of subjects."
}
variable "argocd_daemon_enabled" {
description = "Create a dedicated ArgoCD daemon namespace and service account for the cluster."
type = bool
default = false
}
variable "argocd_daemon_name" {
description = "Name of the ArgoCD daemon namespace."
type = string
default = "argo-daemon"
}
variable "default_priority_classes_enabled" {
type = bool
description = "Enable the creation of the default priority classes. If set to false, the default priority classes will not be created. Default priority classes are: ingress-critical (100000000), monitoring-critical (99900000), logging-critical (99800000), platform-critical (99700000)"
default = true
}
variable "additional_priority_classes" {
type = map(number)
description = "Additional priority classes to create. In form name -> value"
default = {}
}