-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
80 lines (66 loc) · 1.92 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
provider "google" {
credentials = "${file("CREDENTIAL.json")}"
project = "${var.project}"
region = "$(var.region)"
}
resource "google_container_cluster" "cluster" {
name = "${var.cluster_name}"
location = "${var.cluster_location}"
min_master_version = "${var.cluster_k8s_version}"
addons_config {
network_policy_config {
disabled = true
}
http_load_balancing {
disabled = false
}
kubernetes_dashboard {
disabled = false
}
}
node_pool {
name = "default-pool"
initial_node_count = "${var.initial_node_count}"
management {
auto_repair = true
}
autoscaling {
min_node_count = "${var.autoscaling_min_node_count}"
max_node_count = "${var.autoscaling_max_node_count}"
}
node_config {
preemptible = false
disk_size_gb = "${var.disk_size_gb}"
disk_type = "${var.disk_type}"
machine_type = "${var.machine_type}"
oauth_scopes = [
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring",
"https://www.googleapis.com/auth/service.management.readonly",
"https://www.googleapis.com/auth/servicecontrol",
"https://www.googleapis.com/auth/trace.append",
"https://www.googleapis.com/auth/compute",
]
}
}
}
#
# Output for K8S
#
output "client_certificate" {
value = "${google_container_cluster.cluster.master_auth.0.client_certificate}"
sensitive = true
}
output "client_key" {
value = "${google_container_cluster.cluster.master_auth.0.client_key}"
sensitive = true
}
output "cluster_ca_certificate" {
value = "${google_container_cluster.cluster.master_auth.0.cluster_ca_certificate}"
sensitive = true
}
output "host" {
value = "${google_container_cluster.cluster.endpoint}"
sensitive = true
}