diff --git a/infrastructure/adminservices-test/altinn-monitor-test-rg/k6-tests-rg/amw.tf b/infrastructure/adminservices-test/altinn-monitor-test-rg/k6-tests-rg/amw.tf new file mode 100644 index 00000000..ac773766 --- /dev/null +++ b/infrastructure/adminservices-test/altinn-monitor-test-rg/k6-tests-rg/amw.tf @@ -0,0 +1,5 @@ +resource "azurerm_monitor_workspace" "k6tests_amw" { + name = "k6tests-amw" + resource_group_name = azurerm_resource_group.k6tests_rg.name + location = azurerm_resource_group.k6tests_rg.location +} diff --git a/infrastructure/adminservices-test/altinn-monitor-test-rg/k6-tests-rg/k8s.tf b/infrastructure/adminservices-test/altinn-monitor-test-rg/k6-tests-rg/k8s.tf new file mode 100644 index 00000000..4a73e8fe --- /dev/null +++ b/infrastructure/adminservices-test/altinn-monitor-test-rg/k6-tests-rg/k8s.tf @@ -0,0 +1,34 @@ +resource "azurerm_kubernetes_cluster" "k6tests" { + name = "k6tests-cluster" + location = azurerm_resource_group.k6tests_rg.location + resource_group_name = azurerm_resource_group.k6tests_rg.name + + default_node_pool { + name = "default" + node_count = 0 + vm_size = "Standard_D2_v2" + } + + workload_identity_enabled = true + oidc_issuer_enabled = true + + identity { + type = "SystemAssigned" + } +} + +resource "azurerm_kubernetes_cluster_node_pool" "spot" { + name = "spot" + kubernetes_cluster_id = azurerm_kubernetes_cluster.k6tests.id + vm_size = "Standard_DS2_v2" + auto_scaling_enabled = true + node_count = 0 + min_count = 0 + max_count = 1 + priority = "Spot" + eviction_policy = "Delete" + spot_max_price = -1 # (the current on-demand price for a Virtual Machine) + node_labels = { + spot : true + } +} diff --git a/infrastructure/adminservices-test/altinn-monitor-test-rg/k6-tests-rg/providers.tf b/infrastructure/adminservices-test/altinn-monitor-test-rg/k6-tests-rg/providers.tf new file mode 100644 index 00000000..4ed8e329 --- /dev/null +++ b/infrastructure/adminservices-test/altinn-monitor-test-rg/k6-tests-rg/providers.tf @@ -0,0 +1,24 @@ +/* +terraform { + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = "~> 4.0" + } + } + backend "azurerm" { + use_azuread_auth = true + } +} + +provider "azurerm" { + subscription_id = "1ce8e9af-c2d6-44e7-9c5e-099a308056fe" + features {} + resource_providers_to_register = [ + "Microsoft.Monitor", + "Microsoft.AlertsManagement", + "Microsoft.Dashboard", + "Microsoft.KubernetesConfiguration" + ] +} +*/ diff --git a/infrastructure/adminservices-test/altinn-monitor-test-rg/k6-tests-rg/rg.tf b/infrastructure/adminservices-test/altinn-monitor-test-rg/k6-tests-rg/rg.tf new file mode 100644 index 00000000..126bcd7d --- /dev/null +++ b/infrastructure/adminservices-test/altinn-monitor-test-rg/k6-tests-rg/rg.tf @@ -0,0 +1,4 @@ +resource "azurerm_resource_group" "k6tests_rg" { + name = "k6tests-rg" + location = "norwayeast" +}