Josh Black 5e90024b26
Add Enos benchmark scenario (#30675)
* Add Enos benchmark scenario

* add docs on how to run the scenario

* update description again

* see if this works better if we return an empty map

* hopefully disabling telemetry doesn't crash everything now

* yet another try at making telemetry configurable

* swap consul nodes over to be the same as the vault ones

* adjust up IOPs and add a note about it to the docs

* fix missing variables in the ec2 shim

* randomly pick an az for k6 and metrics instances

* enos(benchmark): futher modularize and make target infra cloud agnostic

The initial goal of this was to resolve an issue where sometimes the
one-or-more target instances would attempt to be provisioned in an
avaliability zone that doesn't support it. The target_ec2_instances
module already supports assigning based on instance offerings so I
wanted to use it for all instances. It also has a side effect of
provisioning instances in parallel to speed up overall scenario time.

I ended up futher modularizing the `benchmark` module into several
sub-modules that perform a single task well, and rely on provisioning in
the root module. This will allow us to utilize the module in other
clouds more easily should we desire to do that in the future.

Signed-off-by: Ryan Cragun <me@ryan.ec>

* add copywrite headers

Signed-off-by: Ryan Cragun <me@ryan.ec>

* address some feedback and limit disk iops to 16k by default

Signed-off-by: Ryan Cragun <me@ryan.ec>

---------

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
2025-06-20 09:40:21 -07:00

71 lines
1.8 KiB
HCL

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
terraform {
required_providers {
enos = {
source = "hashicorp-forge/enos"
}
}
}
module "set_up_k6" {
source = "../set_up_k6"
cluster_id = var.vpc_id
host = var.k6_host
leader_addr = var.leader_addr
metrics_collector_host = var.metrics_host
retry_interval = var.retry_interval
timeout = var.timeout
vault_token = var.vault_token
vault_hosts = var.vault_hosts
}
module "set_up_telemetry_collector" {
source = "../set_up_telemetry_collector"
cluster_id = var.vpc_id
consul_hosts = var.consul_hosts
grafana_version = var.grafana_version
grafana_http_port = var.grafana_http_port
host = var.metrics_host
k6_host = var.k6_host
prometheus_version = var.prometheus_version
retry_interval = var.retry_interval
timeout = var.timeout
vault_hosts = var.vault_hosts
}
module "enable_telemetry_consul" {
source = "../enable_telemetry_consul"
hosts = var.consul_hosts
}
locals {
vault_hosts = {
for k, v in var.vault_hosts : "vault_${k}" => v
}
consul_hosts = {
for k, v in var.consul_hosts : "consul_${k}" => v if length(var.consul_hosts) > 0
}
all_hosts = merge(local.vault_hosts, local.consul_hosts, module.set_up_k6.hosts)
}
module "enable_telemetry_node_exporter" {
depends_on = [
module.set_up_telemetry_collector
]
source = "../enable_telemetry_node_exporter"
hosts = local.all_hosts
prometheus_node_exporter_version = var.prometheus_node_exporter_version
retry_interval = var.retry_interval
timeout = var.timeout
}
output "dashboard_url" {
value = module.set_up_telemetry_collector.dashboard_url
}