-
Notifications
You must be signed in to change notification settings - Fork 0
/
aks_cluster.tf
51 lines (44 loc) · 1.62 KB
/
aks_cluster.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// data "azurerm_user_assigned_identity" "umid" {
// name = var.umid_name
// resource_group_name = var.resource_group_name
// }
resource "azurerm_kubernetes_cluster" "k8s" {
name = "${var.cluster_name}"
location = var.resource_group_location
resource_group_name = var.resource_group_name
dns_prefix = var.dns_prefix
kubernetes_version = var.k8s_version
api_server_authorized_ip_ranges = var.private_cluster_enabled ? null : var.api_server_authorized_ip_ranges
private_cluster_enabled = var.private_cluster_enabled
default_node_pool {
name = var.node_pool_name
orchestrator_version = var.k8s_version
vm_size = var.node_pool_vm_size
type = "VirtualMachineScaleSets"
os_disk_size_gb = var.node_pool_osdisk_size
enable_auto_scaling = var.enable_auto_scaling ? true : false
max_count = var.enable_auto_scaling ? var.node_pool_max_count : null
min_count = var.enable_auto_scaling ? var.node_pool_min_count : null
vnet_subnet_id = var.subnet_id
}
lifecycle {
ignore_changes = [
default_node_pool[1],
]
}
// identity {
// type = "UserAssigned"
// identity_ids = [data.azurerm_user_assigned_identity.umid.id]
// }
service_principal {
client_id = var.client_id
client_secret = var.client_secret
}
network_profile {
network_plugin = var.network_plugin
load_balancer_sku = var.load_balancer_sku
}
tags = {
Environment = var.env
}
}