-
Notifications
You must be signed in to change notification settings - Fork 600
/
main.tf
executable file
·61 lines (50 loc) · 1.42 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
provider "google" {
credentials = file(var.account_file_path)
project = var.project
region = var.gcloud-region
}
resource "google_container_cluster" "gcp_kubernetes" {
name = var.cluster_name
location = var.gcloud-zone
initial_node_count = var.gcp_cluster_count
# Temporal workaround for Google provider issue $4010
maintenance_policy {
daily_maintenance_window {
start_time = "03:00"
}
}
master_auth {
username = var.linux_admin_username
password = "${var.linux_admin_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",
]
labels = {
this-is-for = "dev-cluster"
}
tags = ["dev", "work"]
}
}
#--------------------------------------------
# Outputs
#--------------------------------------------
output "gcp_cluster_endpoint" {
value = google_container_cluster.gcp_kubernetes.endpoint
}
output "gcp_cluster_name" {
value = google_container_cluster.gcp_kubernetes.name
}
output "gcp_ssh_command" {
value = "ssh ${var.linux_admin_username}@${google_container_cluster.gcp_kubernetes.endpoint}"
}
output "gcp_zone" {
value = google_container_cluster.gcp_kubernetes.location
}
output "gcp_project" {
value = var.project
}