-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
49 lines (40 loc) · 1.23 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
resource "google_container_cluster" "primary" {
name = "${var.cluster_name}"
zone = "${var.gc_zone}"
initial_node_count = "${var.node_count}"
project = "${var.project_id}"
master_auth {
username = ""
password = ""
}
node_config {
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",
]
disk_size_gb = "${var.disk_size_in_gb}"
machine_type = "${var.machine}"
tags = ["k8s"]
}
}
resource "google_compute_firewall" "default" {
name = "k8s-allow"
network = "default"
project = "${var.project_id}"
allow {
protocol = "tcp"
ports = ["30000-32767"]
}
}
# The following outputs allow authentication and connectivity to the GKE Cluster.
output "client_certificate" {
value = "${google_container_cluster.primary.master_auth.0.client_certificate}"
}
output "client_key" {
value = "${google_container_cluster.primary.master_auth.0.client_key}"
}
output "cluster_ca_certificate" {
value = "${google_container_cluster.primary.master_auth.0.cluster_ca_certificate}"
}