generated from camptocamp/devops-stack-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
240 lines (207 loc) · 7.77 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
237
238
239
240
#######################
## Standard variables
#######################
variable "cluster_name" {
description = "Name given to the cluster. Value used for naming some the resources created by the module."
type = string
default = "cluster"
}
variable "base_domain" {
description = "Base domain of the cluster. Value used for the ingress' URL of the application."
type = string
default = null
}
variable "subdomain" {
description = "Subdomain of the cluster. Value used for the ingress' URL of the application."
type = string
default = "apps"
nullable = false
}
variable "cluster_issuer" {
description = "SSL certificate issuer to use. Usually you would configure this value as `letsencrypt-staging` or `letsencrypt-prod` on your root `*.tf` files."
type = string
default = "selfsigned-issuer"
}
variable "argocd_project" {
description = "Name of the Argo CD AppProject where the Application should be created. If not set, the Application will be created in a new AppProject only for this Application."
type = string
default = null
}
variable "argocd_labels" {
description = "Labels to attach to the Argo CD Application resource."
type = map(string)
default = {}
}
variable "destination_cluster" {
description = "Destination cluster where the application should be deployed."
type = string
default = "in-cluster"
}
variable "target_revision" {
description = "Override of target revision of the application chart."
type = string
default = "v4.0.0" # x-release-please-version
}
variable "helm_values" {
description = "Helm chart value overrides. They should be passed as a list of HCL structures."
type = any
default = []
}
variable "app_autosync" {
description = "Automated sync options for the Argo CD Application resource."
type = object({
allow_empty = optional(bool)
prune = optional(bool)
self_heal = optional(bool)
})
default = {
allow_empty = false
prune = true
self_heal = true
}
}
variable "dependency_ids" {
description = "IDs of the other modules on which this module depends on."
type = map(string)
default = {}
}
#######################
## Module variables
#######################
variable "storage_over_provisioning_percentage" {
description = "Set the storage over-provisioning percentage. **This values should be modified only when really needed.**"
type = number
default = 100
}
variable "storage_minimal_available_percentage" {
description = "Set the minimal available storage percentage. **This values should be modified only when really needed.** The default is 25%, as https://longhorn.io/docs/1.3.1/best-practices/#minimal-available-storage-and-over-provisioning[recommended in the best practices] for single-disk nodes."
type = number
default = 25
}
variable "enable_pv_backups" {
description = "Boolean to enable backups of Longhorn volumes to an external object storage."
type = bool
default = false
}
variable "set_default_storage_class" {
description = "Boolean to set the Storage Class with the backup configuration as the default for all Persistent Volumes."
type = bool
default = true
}
variable "backup_storage" {
description = "Exoscale SOS bucket configuration where the backups will be stored. **This configuration is required if the variable `enable_pv_backups` is set to `true`.**"
type = object({
bucket_name = string
region = string
endpoint = string
access_key = string
secret_key = string
})
default = null
}
variable "backup_configuration" {
description = <<-EOT
The following values can be configured:
. `snapshot_enabled` - Enable Longhorn automatic snapshots.
. `snapshot_cron` - Cron schedule to configure Longhorn automatic snapshots.
. `snapshot_retention` - Retention of Longhorn automatic snapshots in days.
. `backup_enabled` - Enable Longhorn automatic backups to object storage.
. `backup_cron` - Cron schedule to configure Longhorn automatic backups.
. `backup_retention` - Retention of Longhorn automatic backups in days.
/!\ These settings cannot be changed after StorageClass creation without having to recreate it!
EOT
type = object({
snapshot_enabled = bool
snapshot_cron = string
snapshot_retention = number
backup_enabled = bool
backup_cron = string
backup_retention = number
})
default = {
snapshot_enabled = false
snapshot_cron = "0 */2 * * *"
snapshot_retention = "1"
backup_enabled = false
backup_cron = "30 */12 * * *"
backup_retention = "2"
}
}
variable "enable_preupgrade_check" {
description = "Boolean to enable the pre-upgrade check. Usually this value should be set to `true` and only set to `false` if you are bootstrapping a new cluster, otherwise the first deployment will not work."
type = bool
default = true
}
variable "enable_service_monitor" {
description = "Boolean to enable the deployment of a service monitor."
type = bool
default = false
}
variable "additional_alert_labels" {
description = "Additional labels to add to Longhorn alerts."
type = map(string)
default = {}
}
variable "enable_dashboard_ingress" {
description = "Boolean to enable the creation of an ingress for the Longhorn's dashboard. **If enabled, you must provide a value for `base_domain`.**"
type = bool
default = false
}
variable "enable_monitoring_dashboard" {
description = "Boolean to enable the provisioning of a Longhorn dashboard for Grafana."
type = bool
default = true
}
variable "oidc" {
description = "OIDC settings to configure OAuth2-Proxy which will be used to protect Longhorn's dashboard."
type = object({
issuer_url = string
oauth_url = optional(string, "")
token_url = optional(string, "")
api_url = optional(string, "")
client_id = string
client_secret = string
oauth2_proxy_extra_args = optional(list(string), [])
})
default = null
}
variable "automatic_filesystem_trim" {
description = "Settings to enable and configure automatic filesystem trim of volumes managed by Longhorn."
type = object({
enabled = bool
cron = string
job_group = string
})
default = {
enabled = false
cron = "0 6 * * *"
job_group = ""
}
}
variable "recurring_job_selectors" {
description = "Define a group list to add to recurring job selector for the default storage class (the custom backup one if `set_default_storage_class` is set or else the Longhorn default one)."
type = list(object({
name = string
isGroup = bool
}))
default = null
}
variable "replica_count" {
description = "Amount of replicas created by Longhorn for each volume."
type = number
default = 2
}
variable "tolerations" {
description = <<-EOT
Tolerations to be added to the core Longhorn components that manage storage on nodes. **These tolerations are required if you want Longhorn to schedule storage on nodes that are tainted.**
These settings only have an effect on the first deployment. If added at a later time, you need to also add them on the _Settings_ tab in the Longhorn Dashboard. Check the https://longhorn.io/docs/latest/advanced-resources/deploy/taint-toleration/[official documentation] for more detailed information.
**Only tolerations with the "Equal" operator are supported**, because the Longhorn Helm chart expects a parsed list as a string in the `defaultSettings.taintToleration` value.
EOT
type = list(object({
key = string
operator = string
value = string
effect = string
}))
default = []
}