Skip to content

Commit

Permalink
fix: node pool creation should depend on necessary firewall rules (#2245
Browse files Browse the repository at this point in the history
)
  • Loading branch information
wjf3121 authored Jan 15, 2025
1 parent 9ad4082 commit 8098489
Show file tree
Hide file tree
Showing 8 changed files with 55 additions and 10 deletions.
9 changes: 6 additions & 3 deletions autogen/main/cluster.tf.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -1153,9 +1153,12 @@ resource "google_container_node_pool" "windows_pools" {
delete = lookup(var.timeouts, "delete", "45m")
}

{% if i == 1 %}
depends_on = [google_container_node_pool.pools[0]]
{% endif %}
depends_on = [
google_compute_firewall.intra_egress,
{% if i == 1 %}
google_container_node_pool.pools[0],
{% endif %}
]
}
{% endfor %}
{% endif %}
8 changes: 7 additions & 1 deletion cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,9 @@ resource "google_container_node_pool" "pools" {
delete = lookup(var.timeouts, "delete", "45m")
}

depends_on = [
google_compute_firewall.intra_egress,
]
}
resource "google_container_node_pool" "windows_pools" {
provider = google
Expand Down Expand Up @@ -1127,5 +1130,8 @@ resource "google_container_node_pool" "windows_pools" {
delete = lookup(var.timeouts, "delete", "45m")
}

depends_on = [google_container_node_pool.pools[0]]
depends_on = [
google_compute_firewall.intra_egress,
google_container_node_pool.pools[0],
]
}
8 changes: 7 additions & 1 deletion modules/beta-private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,9 @@ resource "google_container_node_pool" "pools" {
delete = lookup(var.timeouts, "delete", "45m")
}

depends_on = [
google_compute_firewall.intra_egress,
]
}
resource "google_container_node_pool" "windows_pools" {
provider = google-beta
Expand Down Expand Up @@ -1312,5 +1315,8 @@ resource "google_container_node_pool" "windows_pools" {
delete = lookup(var.timeouts, "delete", "45m")
}

depends_on = [google_container_node_pool.pools[0]]
depends_on = [
google_compute_firewall.intra_egress,
google_container_node_pool.pools[0],
]
}
8 changes: 7 additions & 1 deletion modules/beta-private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,9 @@ resource "google_container_node_pool" "pools" {
delete = lookup(var.timeouts, "delete", "45m")
}

depends_on = [
google_compute_firewall.intra_egress,
]
}
resource "google_container_node_pool" "windows_pools" {
provider = google-beta
Expand Down Expand Up @@ -1229,5 +1232,8 @@ resource "google_container_node_pool" "windows_pools" {
delete = lookup(var.timeouts, "delete", "45m")
}

depends_on = [google_container_node_pool.pools[0]]
depends_on = [
google_compute_firewall.intra_egress,
google_container_node_pool.pools[0],
]
}
8 changes: 7 additions & 1 deletion modules/beta-public-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,9 @@ resource "google_container_node_pool" "pools" {
delete = lookup(var.timeouts, "delete", "45m")
}

depends_on = [
google_compute_firewall.intra_egress,
]
}
resource "google_container_node_pool" "windows_pools" {
provider = google-beta
Expand Down Expand Up @@ -1282,5 +1285,8 @@ resource "google_container_node_pool" "windows_pools" {
delete = lookup(var.timeouts, "delete", "45m")
}

depends_on = [google_container_node_pool.pools[0]]
depends_on = [
google_compute_firewall.intra_egress,
google_container_node_pool.pools[0],
]
}
8 changes: 7 additions & 1 deletion modules/beta-public-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,9 @@ resource "google_container_node_pool" "pools" {
delete = lookup(var.timeouts, "delete", "45m")
}

depends_on = [
google_compute_firewall.intra_egress,
]
}
resource "google_container_node_pool" "windows_pools" {
provider = google-beta
Expand Down Expand Up @@ -1199,5 +1202,8 @@ resource "google_container_node_pool" "windows_pools" {
delete = lookup(var.timeouts, "delete", "45m")
}

depends_on = [google_container_node_pool.pools[0]]
depends_on = [
google_compute_firewall.intra_egress,
google_container_node_pool.pools[0],
]
}
8 changes: 7 additions & 1 deletion modules/private-cluster-update-variant/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -956,6 +956,9 @@ resource "google_container_node_pool" "pools" {
delete = lookup(var.timeouts, "delete", "45m")
}

depends_on = [
google_compute_firewall.intra_egress,
]
}
resource "google_container_node_pool" "windows_pools" {
provider = google
Expand Down Expand Up @@ -1239,5 +1242,8 @@ resource "google_container_node_pool" "windows_pools" {
delete = lookup(var.timeouts, "delete", "45m")
}

depends_on = [google_container_node_pool.pools[0]]
depends_on = [
google_compute_firewall.intra_egress,
google_container_node_pool.pools[0],
]
}
8 changes: 7 additions & 1 deletion modules/private-cluster/cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,9 @@ resource "google_container_node_pool" "pools" {
delete = lookup(var.timeouts, "delete", "45m")
}

depends_on = [
google_compute_firewall.intra_egress,
]
}
resource "google_container_node_pool" "windows_pools" {
provider = google
Expand Down Expand Up @@ -1157,5 +1160,8 @@ resource "google_container_node_pool" "windows_pools" {
delete = lookup(var.timeouts, "delete", "45m")
}

depends_on = [google_container_node_pool.pools[0]]
depends_on = [
google_compute_firewall.intra_egress,
google_container_node_pool.pools[0],
]
}

0 comments on commit 8098489

Please sign in to comment.