-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.tf
80 lines (64 loc) · 1.82 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
locals {
gke_version = "${var.gke_version != "latest" ? var.gke_version : data.google_container_engine_versions.gke_std.latest_node_version}"
}
data "google_client_config" "default" {}
provider "kubernetes" {
alias = "gke_std"
load_config_file = false
host = "${google_container_cluster.gke_std.endpoint}"
cluster_ca_certificate = "${base64decode(google_container_cluster.gke_std.master_auth.0.cluster_ca_certificate)}"
token = "${data.google_client_config.default.access_token}"
}
data "google_container_engine_versions" "gke_std" {}
resource "google_container_cluster" "gke_std" {
name = "${var.name}"
min_master_version = "${local.gke_version}"
node_version = "${local.gke_version}"
enable_legacy_abac = false
monitoring_service = "none"
addons_config {
http_load_balancing {
disabled = false
}
kubernetes_dashboard {
disabled = true
}
horizontal_pod_autoscaling {
disabled = false
}
}
maintenance_policy {
daily_maintenance_window {
start_time = "03:00"
}
}
node_pool {
name = "default-pool"
initial_node_count = "${var.initial_node_count}"
management {
auto_repair = "true"
auto_upgrade = "true"
}
node_config {
image_type = "COS"
machine_type = "${var.machine_type}"
oauth_scopes = [
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring",
]
}
}
timeouts {
create = "30m"
update = "30m"
delete = "30m"
}
lifecycle {
ignore_changes = [
"initial_node_count",
"node_pool.0.node_config.0.metadata",
]
}
}