-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
67 lines (53 loc) · 1.69 KB
/
main.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
module "labels" {
source = "git::https://github.com/slovink/terraform-google-labels.git"
name = var.name
environment = var.environment
label_order = var.label_order
}
resource "google_container_cluster" "primary" {
count = var.google_container_cluster_enabled && var.module_enabled ? 1 : 0
name = module.labels.id
location = var.location
network = var.network
subnetwork = var.subnetwork
remove_default_node_pool = var.remove_default_node_pool
initial_node_count = var.initial_node_count
min_master_version = var.gke_version
}
resource "google_container_node_pool" "node_pool" {
# provider = google-beta
name = module.labels.id
project = var.project_id
location = var.location
cluster = join("", google_container_cluster.primary.*.id)
node_count = var.node_count
# autoscaling {
# min_node_count = var.min_node_count
# max_node_count = var.max_node_count
# location_policy = var.location_policy
# }
# management {
# auto_repair = var.auto_repair
# auto_upgrade = var.auto_upgrade
# }
node_config {
# image_type = var.image_type
machine_type = var.machine_type
service_account = var.service_account
disk_size_gb = var.disk_size_gb
disk_type = var.disk_type
preemptible = var.preemptible
}
network_config {
enable_private_nodes = true
}
lifecycle {
ignore_changes = [initial_node_count]
create_before_destroy = false
}
timeouts {
create = var.cluster_create_timeouts
update = var.cluster_update_timeouts
delete = var.cluster_delete_timeouts
}
}