generated from clouddrove/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoverride_values.tf
421 lines (366 loc) · 10.4 KB
/
override_values.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
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
#----------------------------- CLUSTER AUTOSCALER ----------------------------
resource "local_file" "cluster_autoscaler_helm_config" {
count = var.cluster_autoscaler && (var.cluster_autoscaler_helm_config == null) ? 1 : 0
content = <<EOT
## Node affinity for particular node in which labels key is "Infra-Services" and value is "true"
## Node affinity for particular node in which labels key is "Infra-Services" and value is "true"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "cloud.google.com/gke-nodepool"
operator: In
values:
- "critical"
## Using limits and requests
resourc_helm_configes:
limits:
cpu: 300m
memory: 250Mi
requests:
cpu: 50m
memory: 150Mi
podAnnotations:
co.elastic.logs/enabled: "true"
additionalLabels: {}
affinity: {}
autoDiscovery:
clusterName: ${data.google_container_cluster.my_cluster.name}
labels: []
roles:
- worker
tags:
- k8s.io/cluster-autoscaler/enabled
- k8s.io/cluster-autoscaler/{{ .Values.autoDiscovery.clusterName }}
cloudProvider: gce
extraArgs:
leader-elect: false
EOT
filename = "${path.module}/override_values/cluster_autoscaler.yaml"
}
#---------------------------------------- Reloader -------------------------------------
resource "local_file" "reloader_helm_config" {
count = var.reloader && (var.reloader_helm_config == null) ? 1 : 0
content = <<EOT
reloader:
deployment:
# If you wish to run multiple replicas set reloader.enableHA = true
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "cloud.google.com/gke-nodepool"
operator: In
values:
- "critical"
resources:
limits:
cpu: "100m"
memory: "512Mi"
requests:
cpu: "10m"
memory: "128Mi"
EOT
filename = "${path.module}/override_values/reloader.yaml"
}
#-------------INGRESS NGINX-------------------
resource "local_file" "ingress_nginx_helm_config" {
count = var.ingress_nginx && (var.ingress_nginx_helm_config == null) ? 1 : 0
content = <<EOT
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "cloud.google.com/gke-nodepool"
operator: In
values:
- "critical"
## Using limits and requests
resources:
limits:
cpu: 150m
memory: 150Mi
requests:
cpu: 100m
memory: 90Mi
podAnnotations:
co.elastic.logs/enabled: "true"
EOT
filename = "${path.module}/override_values/ingress_nginx.yaml"
}
#---------------------- CERTIFICATION-MANAGER --------------------------
resource "local_file" "certification_manager_helm_config" {
count = var.certification_manager && (var.certification_manager_helm_config == null) ? 1 : 0
content = <<EOT
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "cloud.google.com/gke-nodepool"
operator: In
values:
- "critical"
resources:
limits:
cpu: 200m
memory: 250Mi
requests:
cpu: 50m
memory: 150Mi
installCRDs: true
EOT
filename = "${path.module}/override_values/certification_manager.yaml"
}
#-------------------------- KEDA ----------------------------------
resource "local_file" "keda_helm_config" {
count = var.keda && (var.keda_helm_config == null) ? 1 : 0
content = <<EOT
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "cloud.google.com/gke-nodepool"
operator: In
values:
- "critical"
## Using limits and requests
resourc_helm_configes:
limits:
cpu: 100m
memory: 512Mi
requests:
cpu: 10m
memory: 128Mi
EOT
filename = "${path.module}/override_values/keda.yaml"
}
#---------------------------- EXTERNAL DNS ---------------------------------
resource "local_file" "external_dns_helm_config" {
count = var.external_dns && (var.external_dns_helm_config == null) ? 1 : 0
content = <<EOT
nameOverride: external-dns-gcp
sources:
- service
- ingress
provider: google
google:
project: "${var.project_id}"
serviceAccountSecret: "external-dns"
zoneVisibility: "public"
domainFilters: ["external-dns-test.gcp.zalan.do"]
registry: "txt"
txtOwnerId: "k8s"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "cloud.google.com/gke-nodepool"
operator: In
values:
- "critical"
EOT
filename = "${path.module}/override_values/external_dns.yaml"
}
#----------------------- KUBECLARITY ------------------------------
resource "local_file" "kubeclarity_helm_config" {
count = var.kubeclarity && (var.kubeclarity_helm_config == null) ? 1 : 0
content = <<EOT
## Using limits and requests
kubeclarity:
resources:
limits:
memory: "500Mi"
cpu: "200m"
requests:
memory: "200Mi"
cpu: "100m"
podAnnotations:
co.elastic.logs/enabled: "true"
# Be careful when using ingress. As there is no authentication on Kubeclarity yet, your instance may be accessible.
# Make sure the ingress remains internal if you decide to enable it.
service:
type: LoadBalancer
port: 80
annotations: {}
# service.beta.kubernetes.io/aws-load-balancer-scheme: "internet-facing"
# service.beta.kubernetes.io/aws-load-balancer-name: "kubeclarity"
EOT
filename = "${path.module}/override_values/kubeclarity.yaml"
}
#-------------------------- FILEBEAT --------------------------------------
resource "local_file" "filebeat_helm_config" {
count = var.filebeat && (var.filebeat_helm_config == null) ? 1 : 0
content = <<EOT
daemonset:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "cloud.google.com/gke-nodepool"
operator: In
values:
- "critical"
## Using limits and requests
resources:
limits:
cpu: "300m"
memory: "200Mi"
requests:
cpu: 100m
memory: 100Mi
deployment:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "cloud.google.com/gke-nodepool"
operator: In
values:
- "critical"
## Using limits and requests
resources:
limits:
cpu: "300m"
memory: "200Mi"
requests:
cpu: 100m
memory: 100Mi
EOT
filename = "${path.module}/override_values/filebeat.yaml"
}
#------------------------- EXTERNAL SECRETS -----------------------------
resource "local_file" "external_secrets_helm_config" {
count = var.external_secrets && (var.external_secrets_helm_config == null) ? 1 : 0
content = <<EOT
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "cloud.google.com/gke-nodepool"
operator: In
values:
- "critical"
## Using limits and requests
resourc_helm_configes:
limits:
cpu: "100m"
memory: "512Mi"
requests:
cpu: "10m"
memory: "128Mi"
EOT
filename = "${path.module}/override_values/externalsecret.yaml"
}
#-----------ACTIONS-RUNNER-CONTROLLER--------------------
resource "local_file" "actions_runner_controller_helm_config" {
count = var.actions_runner_controller && (var.actions_runner_controller_helm_config == null) ? 1 : 0
content = <<EOT
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "cloud.google.com/gke-nodepool"
operator: In
values:
- "critical"
resources:
limits:
cpu: 200m
memory: 250Mi
requests:
cpu: 50m
memory: 150Mi
EOT
filename = "${path.module}/override_values/actions_runner_controller.yaml"
}
#---------------------------- REDIS -----------------------------------------
resource "local_file" "redis_helm_config" {
count = var.redis && (var.redis_helm_config == null) ? 1 : 0
content = <<EOT
global:
storageClass: ""
redis:
password: "redisPassword"
# -- master configuration parameters
master:
count: 1
persistence:
size: 4Gi
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "cloud.google.com/gke-nodepool"
operator: In
values:
- "critical"
# -- replicas configuration parameters
replica:
replicaCount: 2
persistence:
size: 4Gi
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "cloud.google.com/gke-nodepool"
operator: In
values:
- "critical"
EOT
filename = "${path.module}/override_vales/redis.yaml"
}
#------------------------- PROMETHEUS -------------------------------
resource "local_file" "prometheus_helm_config" {
count = var.prometheus && (var.prometheus_helm_config == null) ? 1 : 0
content = <<EOT
server:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "cloud.google.com/gke-nodepool"
operator: In
values:
- "critical"
persistentVolume:
storageClass: standard-rwo
EOT
filename = "${path.module}/override_vales/prometheus.yaml"
}
#------------------------------- Grafana ------------------------------------
resource "local_file" "grafana_helm_config" {
count = var.grafana && (var.grafana_helm_config == null) ? 1 : 0
content = <<EOT
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "cloud.google.com/gke-nodepool"
operator: In
values:
- "critical"
resources:
limits:
cpu: 300m
memory: 250Mi
requests:
cpu: 50m
memory: 150Mi
EOT
filename = "${path.module}/override_vales/grafana.yaml"
}