Last active
March 30, 2021 07:10
-
-
Save heoelri/383f7c398c2754bda9d3e84ab8304187 to your computer and use it in GitHub Desktop.
locust-worker-terraform
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource "azurerm_container_group" "worker" { | |
count = var.locustWorkerNodes | |
name = "${random_pet.deployment.id}-locust-worker-${count.index}" | |
location = var.locustWorkerLocations[count.index % length(var.locustWorkerLocations)] | |
resource_group_name = azurerm_resource_group.deployment.name | |
ip_address_type = "Public" | |
os_type = "Linux" | |
container { | |
name = "${random_pet.deployment.id}-worker-${count.index}" | |
image = var.locustVersion | |
cpu = "2" | |
memory = "2" | |
commands = [ | |
"locust", | |
"--locustfile", | |
"/home/locust/locust/${azurerm_storage_share_file.locustfile.name}", | |
"--worker", | |
"--master-host", | |
azurerm_container_group.master[0].fqdn | |
] | |
volume { | |
name = "locust" | |
mount_path = "/home/locust/locust" | |
storage_account_key = azurerm_storage_account.deployment.primary_access_key | |
storage_account_name = azurerm_storage_account.deployment.name | |
share_name = azurerm_storage_share.locust.name | |
} | |
ports { | |
port = 8089 | |
protocol = "TCP" | |
} | |
} | |
tags = local.default_tags | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment