Skip to content

Commit c370d92

Browse files
authored
Adapt AKS infra for managed identity rather than explicit service account creds (#1784)
1 parent 94371f3 commit c370d92

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

kubernetes/test-infra/aks/main.tf

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,9 @@ resource "azurerm_kubernetes_cluster" "tf-k8s-acc" {
7878
vnet_subnet_id = azurerm_subnet.tf-k8s-acc.id
7979
}
8080

81-
service_principal {
82-
client_id = var.aks_client_id
83-
client_secret = var.aks_client_secret
84-
}
8581

86-
role_based_access_control {
87-
enabled = true
82+
identity {
83+
type = "SystemAssigned"
8884
}
8985

9086
network_profile {

kubernetes/test-infra/aks/outputs.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ output "kubeconfig_path" {
22
value = local_file.kubeconfig.filename
33
}
44

5+
output "cluster_name" {
6+
value = azurerm_kubernetes_cluster.tf-k8s-acc.name
7+
}

kubernetes/test-infra/aks/variables.tf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ variable "workers_type" {
2222
default = "Standard_DS4_v2"
2323
}
2424

25-
variable "aks_client_id" {
26-
description = "The Client ID for the Service Principal to use for this Managed Kubernetes Cluster"
27-
}
28-
29-
variable "aks_client_secret" {
30-
description = "The Client Secret for the Service Principal to use for this Managed Kubernetes Cluster"
31-
}
32-
3325
# Uncomment to enable SSH access to nodes
3426
#
3527
# variable "public_ssh_key_path" {

0 commit comments

Comments
 (0)