-
Notifications
You must be signed in to change notification settings - Fork 3
/
aks.tf
58 lines (49 loc) · 1.65 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
resource "azurerm_resource_group" "k8s" {
name = "${var.resource_group_name}"
location = "${var.location}"
}
resource "azurerm_virtual_network" "myvnet" {
name = "myvnet"
location = "${azurerm_resource_group.k8s.location}"
resource_group_name = "${azurerm_resource_group.k8s.name}"
address_space = ["10.240.0.0/16"]
dns_servers = ["${var.custom_dns}"]
}
resource "azurerm_subnet" "mysubnet" {
name = "mysubnet"
resource_group_name = "${azurerm_resource_group.k8s.name}"
address_prefixes = ["10.240.10.0/24"]
virtual_network_name = "${azurerm_virtual_network.myvnet.name}"
}
resource "azurerm_kubernetes_cluster" "k8s" {
name = "${var.cluster_name}"
location = "${azurerm_resource_group.k8s.location}"
resource_group_name = "${azurerm_resource_group.k8s.name}"
dns_prefix = "${var.dns_prefix}"
kubernetes_version = "${var.kubernetes_version}"
private_cluster_enabled = true
linux_profile {
admin_username = "azureuser"
ssh_key {
key_data = "${file("${var.ssh_public_key}")}"
}
}
default_node_pool {
name = "agentpool1"
node_count = "${var.agent_count}"
vm_size = "Standard_D2_v3"
os_disk_size_gb = 30
vnet_subnet_id = "${azurerm_subnet.mysubnet.id}"
}
service_principal {
client_id = "${var.client_id}"
client_secret = "${var.client_secret}"
}
network_profile {
network_plugin = "azure"
service_cidr = "10.0.0.0/16"
dns_service_ip = "10.0.0.10"
docker_bridge_cidr = "172.17.0.1/16"
load_balancer_sku = "standard"
}
}