forked from datadarius/tf-aks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aks.tf
58 lines (46 loc) · 1.57 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
#
# Terraform Azure Kubernetes Service
#
# Resource Group
resource "azurerm_resource_group" "tf_aks" {
name = "${var.projectname}"
location = "${var.location}"
# tags = "${(var.resource_tags, map("Name", "${var.projectname}-${var.location}-aks-volume"))}"
}
# Azure File
# ToDo Create Condition if to be created or not.
module "azure-file" {
source = "./terraform-azure-file-aks"
projectname = "${var.projectname}"
location = "${var.location}"
resource_group_name = "${azurerm_resource_group.tf_aks.name}"
tf_aks_volume_sa_replication_type = "${var.tf_aks_volume_sa_replication_type}"
tf_aks_volume_sa_tier = "${var.tf_aks_volume_sa_tier}"
tags = "${var.resource_tags}"
}
# Azure Kubernetes Service
# ToDos: Handling Secrets accordingly
resource "azurerm_kubernetes_cluster" "tf_aks" {
name = "${var.projectname}"
location = "${azurerm_resource_group.tf_aks.location}"
resource_group_name = "${azurerm_resource_group.tf_aks.name}"
kubernetes_version = "${var.k8s_cluster_version}"
dns_prefix = "${var.dns_prefix}"
linux_profile {
admin_username = "${var.admin_username}"
ssh_key {
key_data = "${var.admin_rsa_pubkey}"
}
}
agent_pool_profile {
name = "${var.projectname}"
count = "${var.k8s_node_count}"
vm_size = "${var.k8s_node_size}"
os_type = "Linux"
}
service_principal {
client_id = "${var.service_principal}"
client_secret = "${var.service_principal_secret}"
}
tags = "${var.resource_tags}"
}