-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create a k8s cluster with two different node pools to run k6 te…
…sts from
- Loading branch information
1 parent
c68f94f
commit e3fa5cf
Showing
4 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
infrastructure/adminservices-test/altinn-monitor-test-rg/k6-tests-rg/amw.tf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
34 changes: 34 additions & 0 deletions
34
infrastructure/adminservices-test/altinn-monitor-test-rg/k6-tests-rg/k8s.tf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
infrastructure/adminservices-test/altinn-monitor-test-rg/k6-tests-rg/providers.tf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
] | ||
} | ||
*/ |
4 changes: 4 additions & 0 deletions
4
infrastructure/adminservices-test/altinn-monitor-test-rg/k6-tests-rg/rg.tf
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
resource "azurerm_resource_group" "k6tests_rg" { | ||
name = "k6tests-rg" | ||
location = "norwayeast" | ||
} |