-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoffeewip-cluster.tf
49 lines (40 loc) · 1.02 KB
/
coffeewip-cluster.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
# https://pbhadani.com/posts/gke-terraform/
# Specify the GCP Provider
provider "google" {
project = var.project_id
region = var.region
version = "~> 3.31"
alias = "gb3"
}
# Create a GKE cluster
resource "google_container_cluster" "coffeewip_cluster" {
provider = google.gb3
name = "coffeewip-cluster"
location = var.region
initial_node_count = 1
master_auth {
username = ""
password = ""
}
# Enable Workload Identity
workload_identity_config {
identity_namespace = "${var.project_id}.svc.id.goog"
}
node_config {
machine_type = var.machine_type
oauth_scopes = [
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring",
]
metadata = {
"disable-legacy-endpoints" = "true"
}
# workload_metadata_config {
# node_metadata = "GKE_METADATA_SERVER"
# }
labels = { # Update: Replace with desired labels
"environment" = "test"
"team" = "devops"
}
}
}