Skip to content

Commit 50a09de

Browse files
[DEV-13237] Allow Alert Tuning. Fix Standalone EKS Cluster (#410)
1 parent f02d7e3 commit 50a09de

File tree

4 files changed

+54
-1
lines changed

4 files changed

+54
-1
lines changed

monitoring.tf

+9
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,16 @@ alerting:
9999
enabled: ${var.alerting_pagerduty_enabled}
100100
integrationKey: ${var.alerting_pagerduty_integration_key}
101101
integrationUrl: "https://events.pagerduty.com/generic/2010-04-15/create_event.json"
102+
${local.standard_rules}
102103
EOT
104+
)
105+
standard_rules = var.alerting_standard_rules != "" ? (<<EOT
106+
standardRules:
107+
${indent(4, base64decode(var.alerting_standard_rules))}
108+
EOT
109+
) : (<<EOT
110+
noExtraConfigs: true
111+
EOT
103112
)
104113
alertmanager_tls = var.acm_arn == "" ? (<<EOT
105114
tls:

nodes.tf

+38-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ locals {
1818
spot = false
1919
desired_capacity = "0"
2020
taints = "--register-with-taints=indico.io/celery=true:NoSchedule"
21+
additional_node_labels = ""
2122
},
2223
static-workers = {
2324
min_size = 1
@@ -26,6 +27,8 @@ locals {
2627
type = "cpu"
2728
spot = false
2829
desired_capacity = "0"
30+
additional_node_labels = ""
31+
taints = ""
2932
},
3033
pdf-workers = {
3134
min_size = 0
@@ -35,6 +38,7 @@ locals {
3538
spot = false
3639
desired_capacity = "1"
3740
taints = "--register-with-taints=indico.io/pdfextraction=true:NoSchedule"
41+
additional_node_labels = ""
3842
},
3943
highmem-workers = {
4044
min_size = 0
@@ -44,6 +48,7 @@ locals {
4448
spot = false
4549
desired_capacity = "0"
4650
taints = "--register-with-taints=indico.io/highmem=true:NoSchedule"
51+
additional_node_labels = ""
4752
},
4853
monitoring-workers = {
4954
min_size = 1
@@ -53,6 +58,7 @@ locals {
5358
spot = false
5459
desired_capacity = "1"
5560
taints = "--register-with-taints=indico.io/monitoring=true:NoSchedule"
61+
additional_node_labels = ""
5662
},
5763
pgo-workers = {
5864
min_size = 1
@@ -62,6 +68,7 @@ locals {
6268
spot = false
6369
desired_capacity = "1"
6470
taints = "--register-with-taints=indico.io/crunchy=true:NoSchedule"
71+
additional_node_labels = ""
6572
},
6673
readapi-servers = {
6774
min_size = 0
@@ -71,6 +78,7 @@ locals {
7178
spot = false
7279
desired_capacity = "0"
7380
taints = "--register-with-taints=indico.io/readapi-server=true:NoSchedule"
81+
additional_node_labels = ""
7482
},
7583
readapi-azurite = {
7684
min_size = 0
@@ -80,6 +88,7 @@ locals {
8088
spot = false
8189
desired_capacity = "1"
8290
taints = "--register-with-taints=indico.io/azurite=true:NoSchedule"
91+
additional_node_labels = ""
8392
}
8493
}
8594

@@ -91,6 +100,8 @@ locals {
91100
min_size = 1
92101
max_size = 5
93102
desired_capacity = "3"
103+
additional_node_labels = ""
104+
taints = ""
94105
},
95106
pgo-workers = {
96107
type = "cpu"
@@ -100,6 +111,7 @@ locals {
100111
max_size = 2
101112
desired_capacity = "2"
102113
taints = "--register-with-taints=indico.io/crunchy=true:NoSchedule"
114+
additional_node_labels = ""
103115
},
104116
celery-workers = {
105117
type = "cpu"
@@ -109,6 +121,7 @@ locals {
109121
max_size = 3
110122
desired_capacity = "1"
111123
taints = "--register-with-taints=indico.io/celery-workers=true:NoSchedule"
124+
additional_node_labels = ""
112125
},
113126
minio = {
114127
type = "cpu"
@@ -118,6 +131,7 @@ locals {
118131
max_size = 4
119132
desired_capacity = "4"
120133
taints = "--register-with-taints=indico.io/minio=true:NoSchedule"
134+
additional_node_labels = ""
121135
},
122136
monitoring-workers = {
123137
min_size = 1
@@ -127,6 +141,7 @@ locals {
127141
spot = false
128142
desired_capacity = "1"
129143
taints = "--register-with-taints=indico.io/monitoring=true:NoSchedule"
144+
additional_node_labels = ""
130145
},
131146
weaviate = {
132147
type = "cpu"
@@ -136,6 +151,7 @@ locals {
136151
max_size = 3
137152
desired_capacity = "3"
138153
taints = "--register-with-taints=indico.io/weaviate=true:NoSchedule"
154+
additional_node_labels = ""
139155
},
140156
weaviate-workers = {
141157
type = "cpu"
@@ -145,10 +161,31 @@ locals {
145161
max_size = 4
146162
desired_capacity = "2"
147163
taints = "--register-with-taints=indico.io/weaviate-workers=true:NoSchedule"
164+
additional_node_labels = ""
148165
}
149166
}
150167

151-
default_node_groups = merge((var.insights_enabled ? local.insights_default_node_groups : tomap(null)), (var.ipa_enabled ? local.intake_default_node_groups : tomap(null)))
168+
standalone_node_groups = {
169+
default-workers = {
170+
min_size = 1
171+
max_size = 3
172+
instance_types = ["m5.xlarge"]
173+
type = "cpu"
174+
spot = false
175+
desired_capacity = "0"
176+
additional_node_labels = ""
177+
taints = ""
178+
}
179+
}
180+
181+
default_node_groups = (
182+
var.ipa_enabled == false && var.insights_enabled == false
183+
? local.standalone_node_groups
184+
: merge(
185+
var.insights_enabled ? local.insights_default_node_groups : tomap(null),
186+
var.ipa_enabled ? local.intake_default_node_groups : tomap(null)
187+
)
188+
)
152189

153190
# This is to avoid terraform errors when the node groups variable is set,
154191
# as different keys make the objects incompatible for a ternary function.

tf-smoketest-variables.tf

+1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ resource "kubernetes_config_map" "terraform-variables" {
119119
alerting_email_host = "${jsonencode(var.alerting_email_host)}"
120120
alerting_email_username = "${jsonencode(var.alerting_email_username)}"
121121
alerting_email_password = "${jsonencode(var.alerting_email_password)}"
122+
alerting_standard_rules = "${jsonencode(var.alerting_standard_rules)}"
122123
eks_addon_version_guardduty = "${jsonencode(var.eks_addon_version_guardduty)}"
123124
use_static_ssl_certificates = "${jsonencode(var.use_static_ssl_certificates)}"
124125
ssl_static_secret_name = "${jsonencode(var.ssl_static_secret_name)}"

variables.tf

+6
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,12 @@ variable "alerting_email_password" {
711711
description = "alerting_email_password"
712712
}
713713

714+
variable "alerting_standard_rules" {
715+
type = string
716+
default = ""
717+
description = "alerting_standard_rules"
718+
}
719+
714720
variable "eks_addon_version_guardduty" {
715721
type = bool
716722
default = true

0 commit comments

Comments
 (0)