Skip to content

Commit 10a2cba

Browse files
Damien J. BurksDamien J. Burks
Damien J. Burks
authored and
Damien J. Burks
committed
adding kube configuration
1 parent 21780bb commit 10a2cba

File tree

1 file changed

+31
-2
lines changed

1 file changed

+31
-2
lines changed

main.tf

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
data "google_project" "default" {}
22
resource "google_storage_bucket" "default" {
3-
name = "dsb-devsecops-lab"
3+
name = "dsb-devsecops-lab-bucket"
44
location = var.region
55
force_destroy = true
66

@@ -9,4 +9,33 @@ resource "google_storage_bucket" "default" {
99
}
1010

1111
uniform_bucket_level_access = true
12-
}
12+
}
13+
14+
resource "google_container_cluster" "primary" {
15+
name = "dsb-devsecops-cluster"
16+
location = var.region
17+
18+
# Only one node pool with one node
19+
initial_node_count = 1
20+
21+
# Enable GKE features
22+
remove_default_node_pool = true
23+
deletion_protection = false
24+
25+
# Specify network and subnetwork
26+
network = "default"
27+
subnetwork = "default"
28+
}
29+
30+
resource "google_container_node_pool" "primary_nodes" {
31+
cluster = google_container_cluster.primary.name
32+
location = google_container_cluster.primary.location
33+
node_count = 1 # Single node in the pool - super cheap :)
34+
35+
node_config {
36+
machine_type = "e2-standard-8"
37+
oauth_scopes = [
38+
"https://www.googleapis.com/auth/cloud-platform",
39+
]
40+
}
41+
}

0 commit comments

Comments
 (0)