From 0008c135cf437d705c08c3789a70015efc06c7f2 Mon Sep 17 00:00:00 2001 From: Garrett Delfosse Date: Mon, 13 Jan 2025 12:08:40 -0500 Subject: [PATCH] feat: add scaletest load generation infrastructure (#15816) Closes https://github.com/coder/internal/issues/149 This creates workspaces in each region and runs traffic generation against the workspaces colocated in the region. --- .../terraform/action/coder_helm_values.tftpl | 8 +- scaletest/terraform/action/coder_templates.tf | 348 +++++++++++++----- scaletest/terraform/action/coder_traffic.tf | 236 ++++++++++++ .../terraform/action/coder_workspaces.tf | 180 +++++++++ scaletest/terraform/action/gcp_clusters.tf | 5 + scaletest/terraform/action/k8s_coder_asia.tf | 6 + .../terraform/action/k8s_coder_europe.tf | 6 + .../terraform/action/k8s_coder_primary.tf | 6 +- scaletest/terraform/action/kubeconfig.tftpl | 17 + scaletest/terraform/action/scenarios.tf | 95 +---- 10 files changed, 740 insertions(+), 167 deletions(-) create mode 100644 scaletest/terraform/action/coder_traffic.tf create mode 100644 scaletest/terraform/action/coder_workspaces.tf create mode 100644 scaletest/terraform/action/kubeconfig.tftpl diff --git a/scaletest/terraform/action/coder_helm_values.tftpl b/scaletest/terraform/action/coder_helm_values.tftpl index 7de0c598a1..be24bf61cd 100644 --- a/scaletest/terraform/action/coder_helm_values.tftpl +++ b/scaletest/terraform/action/coder_helm_values.tftpl @@ -34,7 +34,11 @@ coder: - name: "CODER_URL" value: "${access_url}" - name: "CODER_PROVISIONERD_TAGS" - value: "scope=organization" + value: "scope=organization,deployment=${deployment}" + - name: "CODER_PROVISIONER_DAEMON_NAME" + valueFrom: + fieldRef: + fieldPath: metadata.name - name: "CODER_CONFIG_DIR" value: "/tmp/config" %{~ endif ~} @@ -76,6 +80,8 @@ coder: value: "${experiments}" - name: "CODER_DANGEROUS_DISABLE_RATE_LIMITS" value: "true" + - name: "CODER_DANGEROUS_ALLOW_PATH_APP_SITE_OWNER_ACCESS" + value: "true" image: repo: ${image_repo} tag: ${image_tag} diff --git a/scaletest/terraform/action/coder_templates.tf b/scaletest/terraform/action/coder_templates.tf index c2334a488a..d27c25844b 100644 --- a/scaletest/terraform/action/coder_templates.tf +++ b/scaletest/terraform/action/coder_templates.tf @@ -1,91 +1,111 @@ resource "local_file" "kubernetes_template" { filename = "${path.module}/.coderv2/templates/kubernetes/main.tf" content = <