diff --git a/infra/load-testing/azure.tf b/infra/load-testing/azure.tf index ba8b0888..b6031539 100644 --- a/infra/load-testing/azure.tf +++ b/infra/load-testing/azure.tf @@ -16,7 +16,7 @@ resource "random_id" "namer" { } variable "username" { - type = "string" + type = "string" default = "amis" } @@ -67,8 +67,9 @@ resource "azurerm_container_service" "test" { resource "null_resource" "kubeconfig" { provisioner "local-exec" { - command = "sleep 10 && scp -o StrictHostKeyChecking=no ${var.username}@istanbul-${random_id.namer.hex}.${azurerm_resource_group.test.location}.cloudapp.azure.com:~/.kube/config ~/.kube/config" + command = "scp -o StrictHostKeyChecking=no ${var.username}@istanbul-${random_id.namer.hex}.${azurerm_resource_group.test.location}.cloudapp.azure.com:~/.kube/config ~/.kube/config" interpreter = ["bash", "-c"] } + depends_on = ["azurerm_container_service.test"] } diff --git a/infra/load-testing/kubernetes.tf b/infra/load-testing/kubernetes.tf index 3d61a398..2f8b76e8 100644 --- a/infra/load-testing/kubernetes.tf +++ b/infra/load-testing/kubernetes.tf @@ -7,9 +7,11 @@ resource "kubernetes_service" "validator-svc" { selector { app = "validator-${count.index}" } + type = "LoadBalancer" + port { - port = 8546 + port = 8546 target_port = 8546 } @@ -17,4 +19,6 @@ resource "kubernetes_service" "validator-svc" { } count = "${length(var.svcs)}" -} \ No newline at end of file + + depends_on = ["null_resource.kubeconfig"] +}