-
Notifications
You must be signed in to change notification settings - Fork 0
/
aks.tf
69 lines (60 loc) · 2.39 KB
/
aks.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "gitops-demo" {
name = "aks-gitops-demo"
location = "eastus"
}
module "network" {
source = "Azure/network/azurerm"
resource_group_name = azurerm_resource_group.example.name
address_space = "10.0.0.0/16"
subnet_prefixes = ["10.0.1.0/24"]
subnet_names = ["subnet1"]
depends_on = [azurerm_resource_group.example]
}
data "azuread_group" "aks_cluster_admins" {
name = "AKS-cluster-admins"
}
module "aks" {
source = "Azure/aks/azurerm"
resource_group_name = azurerm_resource_group.example.name
client_id = "your-service-principal-client-appid"
client_secret = "your-service-principal-client-password"
kubernetes_version = "1.19.3"
orchestrator_version = "1.19.3"
prefix = "prefix"
cluster_name = "cluster-name"
network_plugin = "azure"
vnet_subnet_id = module.network.vnet_subnets[0]
os_disk_size_gb = 50
sku_tier = "Paid" # defaults to Free
enable_role_based_access_control = true
rbac_aad_admin_group_object_ids = [data.azuread_group.aks_cluster_admins.id]
rbac_aad_managed = true
private_cluster_enabled = true # default value
enable_http_application_routing = true
enable_azure_policy = true
enable_auto_scaling = true
agents_min_count = 1
agents_max_count = 2
agents_count = null # Please set `agents_count` `null` while `enable_auto_scaling` is `true` to avoid possible `agents_count` changes.
agents_max_pods = 100
agents_pool_name = "exnodepool"
agents_availability_zones = ["1", "2"]
agents_type = "VirtualMachineScaleSets"
agents_labels = {
"nodepool" : "defaultnodepool"
}
agents_tags = {
"Agent" : "defaultnodepoolagent"
}
network_policy = "azure"
net_profile_dns_service_ip = "10.0.0.10"
net_profile_docker_bridge_cidr = "170.10.0.1/16"
net_profile_service_cidr = "10.0.0.0/16"
depends_on = [module.network]
}
output "env-dynamic-url" {
value = azurerm_kubernetes_cluster.aks.kube_config.0.host
}