forked from cetic/fadi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
56 lines (48 loc) · 1.26 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
provider "google" {
credentials = "${file("sa_gke.json")}"
project = "<your-project-id>"
region = "europe-west1"
}
# Use gce for storing the terraform state.
terraform {
backend "gcs" {
bucket = "<your-project-id>-tfstate"
prefix = "terraform/state"
credentials = "sa_gke.json"
}
}
resource "google_container_cluster" "primary" {
name = "gke-fadi"
location = "europe-west1-d"
remove_default_node_pool = true
initial_node_count = 1
# We can't create a cluster with no node pool defined, but we want to only use
# separately managed node pools. So we create the smallest possible default
# node pool and immediately delete it.
# Setting an empty username and password explicitly disables basic auth
master_auth {
username = ""
password = ""
}
addons_config {
kubernetes_dashboard {
disabled = true
}
}
}
resource "google_container_node_pool" "primary_pool" {
name = "primary-pool"
cluster = "${google_container_cluster.primary.name}"
location = "europe-west1-d"
node_config {
machine_type = "n1-standard-1"
}
management {
auto_repair = true
auto_upgrade = true
}
autoscaling {
min_node_count = 2
max_node_count = 5
}
}