-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvariables.tf
234 lines (208 loc) · 7.44 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
variable "kubernetes_namespace" {
type = string
description = "Kubernetes namespace to deploy the Grafana Alloy into. NOTE: The namespace must exist and be available for deployment!"
}
variable "kubernetes_cluster_name" {
type = string
description = "Kubernetes cluster name. NOTE: This gets injected into labels/attributes of all collected data."
}
variable "agent_name" {
type = string
description = "Name of the Grafana Alloy."
}
variable "kubernetes_kind" {
type = string
default = "deployment"
description = "Grafana Alloy Kubernetes resource kind. Valid values are \"deployment\" or \"daemonset\". If you want to use clustering, you should use \"deployment\" with multiple replicas."
validation {
condition = contains(["deployment", "daemonset"], var.kubernetes_kind)
error_message = "Valid values for kubernetes_kind are \"deployment\" or \"daemonset\"."
}
}
variable "replicas" {
type = number
default = 1
description = "Number of Grafana Alloy replicas. NOTE: Only valid for `kubernetes_kind = \"deployment\"`."
}
variable "clustering_enabled" {
type = bool
default = false
description = "Enable Grafana Alloy clustering. NOTE: This is only supported for certain kinds of resources - RTFM"
}
variable "default_config_enabled" {
type = bool
default = true
description = "Enable default Grafana Alloy config templates. NOTE: Set this to `false` only if you want to use your own config without the enclosed templates."
}
variable "config" {
type = list(string)
default = []
description = "Grafana Alloy River configuration. Some configuration should be provided. You're encouraged to use the provided templates. You can also provide your completely own config with `default_config_enabled = false`."
}
variable "agent_resources" {
type = object({
requests = optional(object({
cpu = optional(string, "100m")
memory = optional(string, "256Mi")
}), {})
limits = optional(object({
cpu = optional(string, null)
memory = optional(string, null)
}), {})
})
default = {}
description = "Resources for the Grafana Alloy"
}
variable "kubernetes_security_context" {
type = object({
runAsUser = optional(number)
privileged = optional(bool)
})
default = {}
description = "Kubernetes security context configuration for the Grafana Alloy. This is needed with node_exporter to run privileged and as root (UID 0)."
}
variable "controller_resources" {
type = object({
requests = optional(object({
cpu = optional(string, "1m")
memory = optional(string, "5Mi")
}), {})
limits = optional(object({
cpu = optional(string, "100m")
memory = optional(string, "50Mi")
}), {})
})
default = {}
description = "Resources for the Grafana Alloy controller"
}
variable "chart_version" {
type = string
description = "Helm chart version of Grafana Alloy"
default = "1.0.2"
}
variable "image" {
type = object({
registry = optional(string, "docker.io")
repository = optional(string, "grafana/alloy")
})
default = {}
description = "Image registry for Grafana Alloy. This is meant to be used with custom pull-through proxies/registries."
}
variable "metrics" {
type = object({
endpoint = optional(string, "http://mimir:9090")
tenant = optional(string, "default")
backend_type = optional(string, "mimir")
ssl_enabled = optional(bool, true)
})
default = {}
description = "Grafana Alloy metrics endpoint of Prometheus-compatible receiver. NOTE: You must provide the base URL of the API."
validation {
condition = contains(["mimir", "prometheus"], var.metrics.backend_type)
error_message = "Valid values for metrics.backend_type are \"mimir\" or \"prometheus\"."
}
}
variable "otel" {
type = object({
http_port = optional(number, 4318)
grpc_port = optional(number, 4317)
endpoint = optional(string, "http://tempo:4318")
service_graphs_dimensions = optional(list(string), [])
})
default = {}
description = "Grafana Alloy OTel configuration. NOTE: There can be only one OTel receiver at the moment."
}
variable "host_volumes" {
type = list(object({
name = string
host_path = string
mount_path = string
}))
default = []
description = "Extra volumes to mount to the Grafana Alloy. This is needed for some integrations like node_exporter."
}
variable "envs" {
type = map(string)
default = {}
sensitive = true
description = "Additional environment variables for the Grafana Alloy. You can use this attribute to provide additional secrets without exposing them in the config map output."
}
variable "iam_role_arn" {
type = string
default = ""
description = "This role is for assuming by cloudwatch exporter"
}
variable "kafka_jmx_metrics" {
type = object({
scrape_interval = optional(string, "1m")
scrape_timeout = optional(string, "30s")
scrape_period = optional(string, "1m")
kafka_broker_list = optional(list(string), [])
distinguisher = optional(string, "default")
metrics_endpoint_path = optional(string, "/metrics")
})
default = {}
description = "Grafana Alloy scrape JMX kafka metrics"
}
variable "global_tolerations" {
type = list(object({
key = string
operator = string
value = optional(string)
effect = string
tolerationSeconds = optional(number)
}))
default = []
description = "Global tolerations for the Grafana Alloy"
}
variable "k8s_pods" {
type = object({
scrape_pods_global = optional(bool, false)
scrape_pods_annotation = optional(string, "prometheus_io_scrape")
})
default = {}
description = "Grafana Alloy scrape settings for K8S pods"
}
variable "loki" {
type = object({
url = optional(string, "http://loki:3100")
tenant_id = optional(string, "default")
username = optional(string, "admin")
password = optional(string, "admin")
auth_enabled = optional(bool, false)
scrape_pods_global = optional(bool, true)
scrape_pods_annotation = optional(string, "loki.logs.enabled")
})
default = {}
description = "Grafana Alloy scrape settings for Loki logs"
}
variable "integrations" {
type = object({
otel_collector = optional(bool, false)
loki_logs = optional(bool, false)
k8s_cadvisor = optional(bool, false)
k8s_kubelet = optional(bool, false)
k8s_mimir_rules = optional(bool, false)
k8s_pods = optional(bool, false)
k8s_services = optional(bool, false)
node_exporter = optional(bool, false)
aws_alb = optional(bool, false)
aws_rds = optional(bool, false)
aws_sqs = optional(bool, false)
aws_mq = optional(bool, false)
aws_opensearch = optional(bool, false)
remote_write_metrics = optional(bool, true)
kafka_jmx_metrics = optional(bool, false)
})
default = {}
description = "Grafana Alloy integrations configuration"
}
variable "stability_level" {
type = string
default = "generally-available"
}
variable "live_debug" {
type = bool
default = false
description = "Enable live debug for the Grafana Alloy"
}